GNU/Linux >> Linux の 問題 >  >> Ubuntu

Ubuntu20.04にElkArteフォーラムソフトウェアをインストールする方法

ElkArteは、SimpleMachinesForumに基づく無料のオープンソースで強力なコミュニティフォーラム構築ソフトウェアです。 PHPで記述されており、モバイルデバイスやワイヤレスデバイスに完全に対応するコミュニティフォーラムを作成できます。フル機能のコミュニティフォーラムに必要なすべての機能をすぐに利用できるように設計されています。

ElkArteは、カスタマイズが簡単なシンプルでわかりやすいフォーラムプラットフォームをお探しの場合に最適です。

このチュートリアルでは、Ubuntu20.04にLet'sEncryptSSLを使用してElkArteをインストールする方法を示します。

前提条件
  • Ubuntu20.04を実行しているサーバー。
  • サーバーで指定された有効なドメイン名。
  • ルートパスワードはサーバーで構成されています。

Apache、PHP、MariaDBをインストールします

ElkArteは、PHPに基づいてWebサーバー上で実行され、MariaDBをデータベースバックエンドとして使用します。そのため、サーバーにApache、MariaDB、PHP、およびその他のPHP拡張機能をインストールする必要があります。次のコマンドを使用して、すべてのパッケージをインストールできます。

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

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

nano /etc/php/7.4/apache2/php.ini
Change the following lines:
memory_limit = 256M
upload_max_filesize = 100M
max_execution_time = 360
date.timezone = Asia/Kolkata

ファイルを保存して閉じてから、Apacheサービスを再起動して変更を適用します。

systemctl restart apache2

MariaDBデータベースを構成する

まず、MariaDBのインストールを保護し、次のコマンドを使用してMariaDBのrootパスワードを設定します。

mysql_secure_installation

以下に示すように、すべての質問に答えてください。

Enter current password for root (enter for none):
Set root password? [Y/n] Y
New password:
Re-enter new password:
Remove anonymous users? [Y/n] Y
Disallow root login remotely? [Y/n] Y
Remove test database and access to it? [Y/n] Y
Reload privilege tables now? [Y/n] Y

次に、次のコマンドを使用してMariaDBシェルにログインします。

mysql -u root -p

ログイン後、ElkArteのデータベースとユーザーを作成します:

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

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

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

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

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

データベースが構成されたら、次のステップに進むことができます。

ElkArteをダウンロード

まず、次のコマンドを使用して、Gitリポジトリから最新バージョンのElkArteをダウンロードします。

wget https://github.com/elkarte/Elkarte/releases/download/v1.1.6/ElkArte_v1-1-6_install.zip

ダウンロードが完了したら、次のコマンドを使用して、ダウンロードしたファイルをApacheWebルートディレクトリに解凍します。

unzip ElkArte_v1-1-6_install.zip -d /var/www/html/elkarte

次に、次のコマンドを使用して、elkarteディレクトリに適切な権限を付与します。

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

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

ElkArte用にApacheを構成する

次に、ElkArte用の新しいApache仮想ホスト構成ファイルを作成します。

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

次の行を追加します:

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

     <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サービスを再起動して変更を実装します。

systemctl restart apache2
SSLを暗号化してLet'sで安全なElkArte

まず、Certbot Let's Encrypt Clientをインストールして、WebサイトのSSLを管理します。

apt-get install certbot python3-certbot-apache -y

Certbotがインストールされたら、次のコマンドを実行して、Webサイト用のLet'sEncryptSSLをダウンロードしてインストールします。

certbot --apache -d elk.linuxbuz.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 elk.linuxbuz.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/elk-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/elk-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/elk-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を押します 以下に示すようにインストールを完了します。

Redirecting vhost in /etc/apache2/sites-enabled/elk.conf to ssl vhost in /etc/apache2/sites-available/elk-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/elk.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/elk.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-08-19. 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

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

この時点で、ElkArteはLet'sEncryptSSLで保護されています。

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

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

続行をクリックします ボタン。データベースサーバーの設定ページが表示されます:

データベースの詳細を入力し、続行をクリックします ボタン。フォーラム設定ページが表示されます:

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

続行をクリックします ボタン。管理者アカウントの作成ページが表示されます:

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

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

結論

おめでとう!これで、Ubuntu20.04にApacheとLet'sEncryptSSLを使用してElkArteが正常にインストールされました。 ElkArteを使用して独自のコミュニティフォーラムを簡単にホストできるようになりました。ご不明な点がございましたら、お気軽にお問い合わせください。


Ubuntu
  1. Ubuntu18.04にMariaDB10.4をインストールする方法

  2. Ubuntu18.04にMariaDBをインストールする方法

  3. Ubuntu18.04LTSにProcessWireCMSをインストールする方法

  1. Ubuntu18.04LTSにSEOパネルをインストールする方法

  2. Ubuntu18.04LTSにEPESICRMをインストールする方法

  3. Ubuntu18.04LTSにvTigerCRMをインストールする方法

  1. Ubuntu18.04LTSにOctoberCMSをインストールする方法

  2. MyBBフォーラムソフトウェアをUbuntu18.04LTSにインストールする方法

  3. Ubuntu20.04にRedmineプロジェクト管理ソフトウェアをインストールする方法