GNU/Linux >> Linux の 問題 >  >> Debian

ApacheでJoomlaをインストールし、Debian10でSSLを暗号化する方法

Joomlaは、Webサイトのコンテンツを作成、変更、および管理するために使用される無料のオープンソースコンテンツ管理システムです。シンプルで使いやすいので、Webサイトを構築するためにHTMLやCSSの知識は必要ありません。これはPHPで記述されており、MySQLをデータベースとして使用します。すぐに使用できる柔軟なコンテンツ管理システムとなる幅広い機能を提供します。機能をカスタマイズおよび拡張できる何百もの無料の拡張機能が付属しています。

このチュートリアルでは、Apacheを使用してJoomlaCMSをインストールする方法とDebian10にLet'sEncryptをインストールする方法を紹介します。

前提条件
  • Debian10を実行しているサーバー。
  • サーバーIPで指定された有効なドメイン名。
  • ルートパスワードがサーバーに設定されます。
はじめに

まず、次のコマンドを実行して、システムパッケージを更新されたバージョンに更新します。

apt-get update -y

すべてのパッケージが更新されたら、次のステップに進むことができます。

LAMPサーバーをインストールする

次に、Apache Webサーバー、MariaDBデータベース、PHP、およびその他のPHP拡張機能をシステムにインストールする必要があります。次のコマンドですべてをインストールできます:

apt-get install apache2 mariadb-server php openssl php-imagick php-common php-curl php-gd php-imap php-intl php-json php-ldap php-mbstring php-mysql php-pgsql php-smbclient php-ssh2 php-sqlite3 php-xml php-zip -y

すべてのパッケージがインストールされたら、次のステップに進むことができます。

Joomlaのデータベースを作成する

JoomlaはMySQLまたはMariaDBを使用してコンテンツを保存します。したがって、Joomlaのデータベースとユーザーを作成する必要があります。

まず、次のコマンドを使用してMariaDBに接続します。

mysql

接続したら、次のコマンドを使用してデータベースとユーザーを作成します。

MariaDB [(none)]> CREATE DATABASE joomladb;
MariaDB [(none)]> GRANT ALL ON joomladb.* TO 'joomlauser'@'localhost' IDENTIFIED BY 'password';

次に、特権をフラッシュし、次のコマンドでMariaDBを終了します。

MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;

終了したら、次のステップに進むことができます。

Joomlaをインストール

次に、次のコマンドを使用してJoomlaの最新バージョンをダウンロードします。

wget https://downloads.joomla.org/cms/joomla3/3-9-25/Joomla_3-9-25-Stable-Full_Package.tar.bz2

ダウンロードが完了したら、ApacheWebルート内にJoomlaのディレクトリを作成します。

mkdir /var/www/html/joomla

次に、次のコマンドを実行して、ダウンロードしたファイルをJoomlaディレクトリに抽出します。

bunzip2 Joomla_3-9-25-Stable-Full_Package.tar.bz2
tar -xvf Joomla_3-9-25-Stable-Full_Package.tar -C /var/www/html/joomla/

次に、次のコマンドを使用して、Joomlaディレクトリに適切な権限と所有権を設定します。

chown -R www-data:www-data /var/www/html/joomla
chmod -R 755 /var/www/html/joomla

終了したら、次のステップに進むことができます。

ApacheWebサーバーを構成する

次に、JoomlaをホストするためのApache仮想ホスト構成ファイルを作成する必要があります。

次のコマンドで作成できます:

nano /etc/apache2/sites-available/joomla.conf

次の行を追加します:

<VirtualHost *:80>
   ServerName joomla.example.com 
   ServerAdmin [email protected]
   DocumentRoot /var/www/html/joomla
   <Directory /var/www/html/joomla>
	    Allowoverride all
   </Directory>
</VirtualHost>

ファイルを保存して閉じ、次のコマンドでApache仮想ホストを有効にします。

a2ensite joomla

次に、Apacheサービスを再起動して、変更を適用します。

systemctl restart apache2

次に、次のコマンドを使用してApacheのステータスを確認します。

systemctl status apache2

次の出力が得られるはずです:

? apache2.service - The Apache HTTP Server
   Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled)
   Active: active (running) since Mon 2021-03-22 09:26:20 UTC; 4s ago
     Docs: https://httpd.apache.org/docs/2.4/
  Process: 14495 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS)
 Main PID: 14499 (apache2)
    Tasks: 6 (limit: 4701)
   Memory: 18.8M
   CGroup: /system.slice/apache2.service
           ??14499 /usr/sbin/apache2 -k start
           ??14500 /usr/sbin/apache2 -k start
           ??14501 /usr/sbin/apache2 -k start
           ??14502 /usr/sbin/apache2 -k start
           ??14503 /usr/sbin/apache2 -k start
           ??14504 /usr/sbin/apache2 -k start

Mar 22 09:26:20 debian10 systemd[1]: Starting The Apache HTTP Server...
アクセスJoomla

次に、Webブラウザーを開き、URL http://joomla.example.comを使用してJoomlaWebインターフェースにアクセスします。 。次のページにリダイレクトされます:

次に、サイト名、メールアドレス、管理者のユーザー名、パスワードを入力して、[次へ]をクリックします。 ボタン。次のページが表示されます:

データベース名、データベースユーザー名、パスワードを入力し、次へをクリックします ボタン。次のページが表示されます:

次に、すべての設定を確認して、インストールをクリックします。 ボタンをクリックしてインストールを開始します。インストールが完了すると、次のページが表示されます。

削除をクリックします インストール フォルダ 。次のページが表示されます:

次に、管理者をクリックします ボタンをクリックすると、Joomlaログインページが表示されます:

管理者の資格情報を入力し、ログインをクリックします ボタンをクリックすると、次の画像にJoomlaコントロールパネルが表示されます。

SSLを暗号化してLet'sで安全なJoomla

Let'sEncryptSSLを使用してWebサイトを保護することは常に良い考えです。 SSLをインストールして管理するには、Certbotクライアントをインストールする必要があります。次のコマンドでインストールできます:

apt-get install python3-certbot-apache -y

Certbotをインストールしたら、次のコマンドを実行して、Let'sEncryptSSLでWebサイトを保護します。

certbot --apache -d joomla.example.com

以下に示すように、メールアドレスを提供し、利用規約に同意するよう求められます。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator standalone, Installer None
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Plugins selected: Authenticator apache, Installer apache
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for joomla.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/joomla-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/joomla-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/joomla-le-ssl.conf

次に、以下に示すように、HTTPトラフィックをHTTPSにリダイレクトするかどうかを選択します。

Please choose whether or not to redirect HTTP traffic to HTTPS, removing HTTP access.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

2と入力し、Enterキーを押して、WebサイトにLet'sEncryptSSLをインストールします。

Enabled Apache rewrite module
Redirecting vhost in /etc/apache2/sites-enabled/joomla.conf to ssl vhost in /etc/apache2/sites-available/joomla-le-ssl.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://joomla.example.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=joomla.example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/joomla.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/joomla.example.com/privkey.pem
   Your cert will expire on 2020-10-23. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le
結論

おめでとう!これで、Debian10サーバーにJoomlaCMSが正常にインストールされました。これで、Joomlaを使用して独自のWebサイトを簡単に構築できます。ご不明な点がございましたら、お気軽にお問い合わせください。


Debian
  1. ApacheでTikiWikiをインストールし、Debian10でSSLを暗号化する方法

  2. ApacheでAutomadCMSをインストールし、Debian10で暗号化する方法

  3. ElkArteフォーラムをApacheでインストールし、Debian10で暗号化する方法

  1. ApacheでWonderCMSをインストールし、CentOS8でSSLを暗号化する方法

  2. Nginxを使用してOpenCartをインストールし、Debian10で暗号化する方法

  3. Apache2でJoomlaをインストールし、Ubuntu20.04で暗号化する方法

  1. Drupal 9をNginxでインストールし、Debian10でSSLを暗号化する方法

  2. ElkArteフォーラムをApacheでインストールし、CentOS8でSSLを暗号化する方法

  3. Apacheを使用してPrestaShopをインストールし、CentOS8でSSLを暗号化する方法