在本教程中,我們將向您展示如何在Ubuntu22.04 長期支持。 對於那些不知道的人,Concrete5 是一個開源內容管理平台,用於在線發布和管理內容。 它靈活、安全、移動就緒,並且基於模型-視圖-控制器架構。 它提供了一組豐富的功能,包括所見即所得的內容編輯器、媒體管理器、拖放內容、上下文編輯等等。
本文假設您至少對 Linux 有基本的了解,您知道如何使用 shell,最重要的是,您在自己的 VPS 上託管您的站點。 安裝非常簡單,它假定您在 root 帳戶下運行,如果不是,您可能需要添加 ' sudo
' 獲取 root 權限的命令。 我將向您展示在 Ubuntu 22.04 (Jammy Jellyfish) 上逐步安裝 CMS Concrete5。 您可以按照 Ubuntu 22.04 和任何其他基於德比安比如 Linux Mint、Elementary OS、Pop!_OS 等等。
以前的要求
- 運行以下操作系統之一的服務器:Ubuntu 22.04、20.04 和任何其他基於 Debian 的發行版,如 Linux Mint。
- 建議您使用全新的操作系統安裝以避免潛在問題。
- 通過 SSH 訪問服務器(如果您在桌面上,則只需打開終端)。
- 到
non-root sudo user
或訪問root user
. 我們建議充當non-root sudo user
但是,如果您在以 root 身份運行時不小心,可能會損壞您的系統。
在 Ubuntu 22.04 LTS Jammy Jellyfish 上安裝 Concrete5 CMS
第 1 步:首先,通過運行以下命令確保系統上的所有軟件包都是最新的 apt
終端中的命令。
sudo apt update sudo apt upgrade
步驟 2. 在 Ubuntu 22.04 上安裝 LAMP Stack。
在開始本教程之前,必須在您的服務器上安裝 LAMP 服務器。 如果您沒有安裝 LAMP Stack,您可以按照我們的指南進行操作。
步驟 3. 在 Ubuntu 22.04 上安裝 Concrete5 CMS。
默認情況下,Concrete5 在 Ubuntu 22.04 基本存儲庫中不可用。 現在運行下面的命令從你的 Ubuntu 系統的官方頁面下載最新的穩定版本的 Concrete5:
wget --trust-server-names https://www.concrete5.org/download_file/-/view/115589/ -O concrete5.zip
接下來,使用以下命令將 Shopware zip 文件解壓縮到 webroot 目錄:
unzip concrete5.zip
我們將不得不更改一些文件夾權限:
chown -R www-data:www-data /var/www/html/concrete5/ chmod -R 755 /var/www/html/concrete5/
第 4 步。為 Concrete5 配置 MariaDB。
默認情況下,MariaDB 未加固。 您可以使用以下方法保護 MariaDB mysql_secure_installation
腳本。 您應該仔細閱讀下面的每個步驟,這將設置 root 密碼、刪除匿名用戶、禁止遠程 root 登錄、刪除測試數據庫並訪問安全的 MariaDB:
mysql_secure_installation
像這樣設置:
- Set root password? [Y/n] y - 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 控制台並為 Concrete5 創建一個數據庫。 運行以下命令:
mysql -u root -p
這將提示您輸入密碼,因此請輸入您的 MariaDB root 密碼並按 Enter。 登錄到數據庫服務器後,您需要為 Concrete5 安裝創建一個數據庫:
MariaDB [(none)]> CREATE DATABASE concrete5; MariaDB [(none)]> CREATE USER 'concrete5user'@'localhost' IDENTIFIED BY 'your-strong-password'; MariaDB [(none)]> GRANT ALL ON concrete5.* TO 'concrete5user'@'localhost' IDENTIFIED BY 'your-strong-password' WITH GRANT OPTION;MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT;
有關安裝 MariaDB 的其他資源,請閱讀以下帖子:
- 如何在 Ubuntu Linux 上安裝 MariaDB √
步驟 5. 為 Concreto5 CMS 配置 Apache。
現在為 Shopware 創建虛擬主機配置文件:
nano /etc/apache2/sites-available/concrete5.conf
添加以下文件:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/concrete5/ ServerName your-domain.com <Directory /var/www/html/concrete5/> Options +FollowSymlinks AllowOverride All Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>
保存並關閉文件,然後重啟 Apache 網絡服務器以使更改生效:
sudo a2ensite concrete5.conf sudo a2enmod rewrite sudo systemctl restart apache2
有關安裝和管理 Apache 的其他資源,請閱讀以下文章:
- 如何在 Ubuntu Linux 上安裝 Apache √
第 6 步。使用 Let's Encrypt 保護 Concrete5 CMS。
首先,您需要安裝 Certbot 以使用 Let's Encrypt 獲取 SSL 證書:
sudo apt install certbot python3-certbot-apache
接下來,按照以下步驟使用 Let's Encrypt 獲取您的 SSL 證書:
sudo certbot --apache
您將需要按照交互式提示安裝證書。 由於我有兩個域,我將為兩個域安裝 SSL 證書:
Saving debug log to /var/log/letsencrypt/letsencrypt.log 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. Do you agree? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - (Y)es/(N)o: Y - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Would you be willing, once your first certificate is successfully issued, 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: N Account registered. Which names would you like to activate HTTPS for? - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1: your - domain.com 2: www.your-domain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Select the appropriate numbers separated by commas and/or spaces, or leave input blank to select all options shown (Enter 'c' to cancel): 1,2 Requesting a certificate for your - domain.com and www.your-domain.com Successfully received certificate. Certificate is saved at: /etc/letsencrypt/live/domain.com/fullchain.pem Key is saved at: /etc/letsencrypt/live/domain.com/privkey.pem This certificate expires on 2022-12-10. These files will be updated when the certificate renews. Certbot has set up a scheduled task to automatically renew this certificate in the background. Deploying certificate Successfully deployed certificate for domain.com to /etc/apache2/sites-available/www.your-domain.com-le-ssl.conf Successfully deployed certificate for www.domain.com to /etc/apache2/sites-available/www.your-domain.com-le-ssl.conf Congratulations! You have successfully enabled HTTPS on https://domain.com and https://www.your-domain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 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 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Let's Encrypt 證書有效期為 90 天,強烈建議在證書過期前續訂證書。 您可以通過運行以下命令來測試證書的自動續訂:
sudo certbot renew --dry-run
步驟 7. 配置防火牆。
現在我們使用 Apache 配置一個簡單的防火牆 (UFW),以允許公共訪問 HTTP 和 HTTPS 的默認 Web 端口:
sudo ufw allow OpenSSH sudo ufw allow 'Apache Full' sudo ufw enable
步驟 8. 訪問 Concrete5 CMS Web 界面。
成功安裝後,打開您的 Web 瀏覽器並使用 URL 訪問 Shopware 安裝嚮導 https://your-domain.com
. 您將被重定向到以下頁面:
恭喜! 您已經成功安裝了 Concrete5。 感謝您使用本教程在 Ubuntu 22.04 LTS Jammy Jellyfish 系統上安裝帶有 LAMP 的 Concrete5 CMS。 如需更多幫助或有用信息,我們建議您諮詢混凝土網站.