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

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

ElkArteは、独自のオンラインフォーラムコミュニティを作成できる、無料のオープンソースの強力なフォーラムソフトウェアです。これは、PHPに基づくシンプルで軽量な最新のフォーラムプラットフォームであり、MySQL/MariaDBを使用してデータを保存します。 ElkArteには、通知、投稿のいいね、下書き、自動保存、ドラッグアンドドロップファイルの添付、YouTubeの統合動画埋め込み、メールによる投稿、スパム対策の改善など、豊富な機能が備わっています。

このチュートリアルでは、Debian10サーバーにElkArteをインストールする方法を説明します。

要件
  • Debian10を実行しているサーバー。
  • サーバーにルートパスワードが設定されています。
はじめに

開始する前に、システムを最新バージョンに更新する必要があります。これを行うには、次のコマンドを実行します。

apt-get update -y
apt-get upgrade -y

サーバーが更新されたら、サーバーを再起動して変更を適用します。

Apache、MariaDB、PHPをインストール

まず、Apache Webサーバー、MariaDBデータベースサーバー、PHP、およびその他の必要なライブラリをサーバーにインストールする必要があります。次のコマンドを実行して、それらすべてをインストールできます。

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-pgsql php-xml php-cli php-imagick php-bcmath php-gmp php-zip unzip -y

すべてのパッケージがインストールされたら、php.iniファイルを開き、いくつかの設定を微調整します。

nano /etc/php/7.3/apache2/php.ini

次の行を変更します:

memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = America/Chicago

終了したら、ファイルを保存して閉じます。次に、次のコマンドを使用してApacheWebサーバーを再起動します。

systemctl restart apache2

ElkArte用にデータベースを構成する

次に、ElkArteのデータベースとユーザーを作成する必要があります。これを行うには、次のコマンドを使用してMariaDBシェルにログインします。

mysql -u root -p

プロンプトが表示されたらrootパスワードを入力し、次のコマンドでデータベースとユーザーを作成します。

MariaDB [(none)]> CREATE DATABASE elkartedb;
MariaDB [(none)]> CREATE USER 'elkarte'@'localhost' IDENTIFIED BY 'password';

次に、次のコマンドを使用して、ElkArteにすべての権限を付与します。

MariaDB [(none)]> GRANT ALL ON elkartedb.* TO 'elkarte'@'localhost' WITH GRANT OPTION;

次に、特権をフラッシュし、次のコマンドを使用してMariaDBシェルを終了します。

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

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

ElkArteをダウンロード

まず、Gitリポジトリから最新バージョンのElkArteをダウンロードする必要があります。ダウンロードするには、次のコマンドを実行します。

wget https://github.com/elkarte/Elkarte/archive/master.zip

ダウンロードが完了したら、次のコマンドを使用してダウンロードしたファイルを解凍します。

unzip master.zip

次に、抽出したディレクトリをApacheWebルートディレクトリに移動します。

mv Elkarte-master /var/www/html/elkarte

次に、elkarteディレクトリの所有権を変更し、次のコマンドで必要な権限を付与します。

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

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

ElkArteの仮想ホストを作成

次に、ElkArteにサービスを提供するためのApache仮想ホスト構成ファイルを作成する必要があります。次のコマンドで作成できます:

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

次の行を追加します:

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

     <Directory /var/www/html/elkarte/>
          Options FollowSymlinks
          AllowOverride All
          Require all granted
     </Directory>

     ErrorLog ${APACHE_LOG_DIR}/error.log
     CustomLog ${APACHE_LOG_DIR}/access.log combined
    
</VirtualHost>

終了したら、ファイルを保存して閉じます。次に、次のコマンドを使用して、仮想ホストファイルとApacheリライトモジュールを有効にします。

a2ensite elkarte.conf
a2enmod rewrite

最後に、Apache Webサーバーを再起動して、変更を適用します。

systemctl restart apache2

ElkArteWebインターフェイスにアクセス

これで、ElkArteがインストールおよび構成されました。 ElkArteWebインターフェイスにアクセスする時が来ました。

Webブラウザーを開き、URL http://example.comを入力します 。 ElkArteウェルカムページにリダイレクトされます:

続行をクリックします ボタン。次のページが表示されます:

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

フォーラム名とフォーラムURLを入力し、[続行]ボタンをクリックします。次のページが表示されます:

次に、続行をクリックします ボタン。管理者作成ページが表示されます:

希望する管理者名、パスワード、電子メール、データベースパスワードを入力し、続行をクリックします。 ボタン。インストールが完了すると、次のページが表示されます。

次に、[新しくインストールしたフォーラム]をクリックします "。次の​​ページにElkArteダッシュボードが表示されます:

Let'sEncryptを使用してElkArteを保護

まず、サーバーにCertbotをインストールする必要があります。 Certbotは、Let’s EncryptからSSL証明書を取得し、この証明書を使用するようにApacheを構成するために使用されます。

デフォルトでは、Certbotの最新バージョンはDebian10デフォルトリポジトリで利用できません。そのため、サーバーにCertbotリポジトリを追加する必要があります。

まず、次のコマンドを使用してCertbotリポジトリを追加します。

add-apt-repository ppa:certbot/certbot

リポジトリが追加されたら、リポジトリを更新し、次のコマンドを使用してCertbotをインストールします。

apt-get update -y
apt-get install certbot python-certbot-apache -y

これでCertbotがインストールされ、使用できるようになりました。

次のコマンドを実行して、ドメインのSSL証明書を取得します。

certbot --apache -d example.com

まず、有効なメールアドレスを提供し、以下に示す利用規約に同意する必要があります。

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator apache, Installer apache
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
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/example.com-le-ssl.conf
Deploying Certificate to VirtualHost /etc/apache2/sites-available/example.com-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/example.com-le-ssl.conf

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を選択します ドメインに無料のSSL証明書をダウンロードしてインストールします。インストールが正常に完了したら。次の出力が得られるはずです:

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

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/example.com/privkey.pem
   Your cert will expire on 2019-10-22. 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"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - 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

おめでとう!これで、ElkArteはSSL証明書で保護されます。これで、URL https://example.com にアクセスして、安全にアクセスできます。 。


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

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

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

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

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

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

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

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

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