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

Ubuntu20.04でSSLを暗号化することでTYPO3CMSをインストールする方法

TYPO3は、PHPで書かれた無料のオープンソースコンテンツ管理システムです。これは、オープンソースコードと信頼性および真のスケーラビリティを組み合わせたエンタープライズクラスのCMSです。 Webサーバー上で実行され、Windows、Linux、macOSなどの多くのオペレーティングシステムをサポートします。シンプルで応答性が高く、モバイル対応で安全なCMSであり、コードを記述せずに簡単にカスタマイズおよび拡張できます。これは、Webサイトをすばやく立ち上げて実行するための非常に人気があり、優れた選択肢です。

このチュートリアルでは、ApacheWebサーバーを使用してTYPO3CMSをインストールし、Ubuntu20.04にSSLを暗号化する方法を示します。

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

まず、システムパッケージを最新バージョンに更新することをお勧めします。次のコマンドを実行して、すべてのパッケージを更新できます。

apt-get update -y

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

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

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

apt-get install apache2 mariadb-server php libapache2-mod-php php-common php-gmp php-curl php-intl php-mbstring php-xmlrpc php-mysql php-gd php-xml php-cli php-zip curl git gnupg2 -y

すべてのパッケージをインストールした後、php.iniファイルを編集し、いくつかの推奨設定を変更します。

nano /etc/php/7.4/apache2/php.ini

次の行を変更します:

memory_limit = 256M
upload_max_filesize = 100M
post_max_size = 100M
max_execution_time = 360
max_input_vars = 1500
date.timezone = Asia/Kolkata

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

systemctl restart apache2

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

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

mysql

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

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

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

MariaDB [(none)]> GRANT ALL ON typo3db.* TO 'typo3'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

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

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

この時点で、MariaDBデータベースが構成されています。

TYPO3CMSをインストールする

まず、公式ウェブサイトからTYPO3の最新バージョンをダウンロードする必要があります。 curlコマンドを使用してダウンロードできます:

curl -L -o typo3_src.tgz https://get.typo3.org/10.4.9

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

tar -xvzf typo3_src.tgz

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

mv typo3_src-10.4.9 /var/www/html/typo3

次に、次のコマンドを使用して適切な権限と権限を付与します。

chown -R www-data:www-data /var/www/html/typo3
chmod -R 775 /var/www/html/typo3

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

ApacheをTYPO3用に設定

次に、TYPO3CMSをホストするためのApache仮想ホスト設定ファイルを作成します。次のコマンドで作成できます:

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

次の行を追加します:

<VirtualHost *:80>
     ServerAdmin [email protected]
     DocumentRoot /var/www/html/typo3
     ServerName typo3.example.com
     <Directory /var/www/html/typo3>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
     </Directory>

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

</VirtualHost>

ファイルを保存して閉じ、仮想ホスト構成ファイルを有効にして、次のコマンドでモジュールを書き換えます。

a2ensite typo3.conf
a2enmod rewrite

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

systemctl restart apache2

この時点で、ApacheWebサーバーはTYPO3を提供するように設定されています。これで、次のステップに進むことができます。

TYPO3CMSにアクセス

次に、Webブラウザを開き、URLhttp://typo3.example.comを使用してTYPO3にアクセスします。次のページが表示されます:

新しいサーバーにTYPO3をインストールする場合は、 FIRST_INSTALLを作成する必要があります TYPO3ウェブルートディレクトリ内のファイル。次のコマンドで作成できます:

touch /var/www/html/typo3/FIRST_INSTALL

次に、Webページを更新します。次のページが表示されます:

問題は検出されませんでした。インストールを続行しますをクリックします。 次のページが表示されます:

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

TYPO3データベース名を選択し、続行をクリックします ボタン。次のページが表示されます:

次に、管理者のユーザー名、パスワード、サイト名を入力し、続行をクリックします ボタン。 TYPO3ログインページにリダイレクトされます:

管理者のユーザー名とパスワードを入力し、ログインをクリックします ボタン。次のページにTYPO3ダッシュボードが表示されます:

Let'sEncryptでTYPO3を保護する

Let's EncryptFreeSSLを使用してWebサイトを保護することをお勧めします。まず、Certbotクライアントをインストールして、SSLをインストールおよび管理します。次のコマンドでインストールできます:

apt-get install python3-certbot-apache -y

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

certbot --apache -d typo3.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 typo3.example.com
Enabled Apache rewrite module
Waiting for verification...
Cleaning up challenges
Created an SSL vhost at /etc/apache2/sites-available/typo3-le-ssl.conf
Enabled Apache socache_shmcb module
Enabled Apache ssl module
Deploying Certificate to VirtualHost /etc/apache2/sites-available/typo3-le-ssl.conf
Enabling available site: /etc/apache2/sites-available/typo3-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/typo3.conf to ssl vhost in /etc/apache2/sites-available/typo3-le-ssl.conf

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

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

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/typo3.example.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/typo3.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

これで、URLhttps://typo3.example.comを使用してTYPO3CMSに安全にアクセスできます。

結論

おめでとう!これでTYPO3CMSが正常にインストールされ、Ubuntu20.04でLet'sEncryptSSLを使用して保護されました。これで、Webブラウザを介してWebサイトとブログを簡単に作成できます。ご不明な点がございましたら、お気軽にお問い合わせください。


Ubuntu
  1. Nginxを使用してNextcloudをインストールし、Ubuntu20.04LTSでSSLを暗号化する方法

  2. Nginxを使用してMagento2をインストールし、Ubuntu20.04LTSでSSLを暗号化する方法

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

  1. Nginxを使用してAutomadCMSをインストールし、Ubuntu18.04でSSLを暗号化できるようにします

  2. Nginxを使用してGravCMSをインストールし、Ubuntu18.04LTSに暗号化する方法

  3. Nginxを使用してDrupalをインストールし、Ubuntu20.04LTSでSSLを暗号化する方法

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

  2. Webminをインストールし、Ubuntu20.04LTSでLetsEncryptSSLを使用して保護する方法

  3. Nginxを使用してShopware6をインストールし、Ubuntu20.04でSSLを暗号化する方法