How to Install Concrete5 CMS with free Let's Encrypt SSL on Debian 11
Concrete5 is a free and open-source content management system for publishing Internet content. It was designed for those users who are beginners with minimal computer skills and allowed them to edit the website directly from the web browser. It is simple, lightweight, easy to use, and written in PHP. It comes with tons of useful features including, an Intuitive web interface, SEO friendly, Social media, Mobile Optimized, Extendable, Integrated Reporting, and more.
This post will show you how to install Concrete5 CMS with Apache and Let's Encrypt SSL on Debian 11.
Prerequisites
- A server running Debian 11.
- A valid domain name pointed with your server IP.
- A root password is configured on your server.
Install Apache, MariaDB, and PHP
First, you will need to install Apache web server, MariaDB database server, PHP and other required extensions to your server. You can install all of them by running the following command:
apt-get install apache2 mariadb-server php libapache2-mod-php libapache2-mod-php php-common php-mbstring php-xmlrpc php-soap php-gd php-xml php-intl php-mysql php-cli php-ldap php-zip php-curl -y
Once all the packages are installed, edit the php.ini file and tweak some PHP settings:
nano /etc/php/7.3/apache2/php.ini
Change the following lines:
file_uploads = On allow_url_fopen = On memory_limit = 256M upload_max_filesize = 64M date.timezone = UTC
Save and close the file when you are finished then restart the Apache service to apply the changes:
systemctl restart apache2
Create a Database for Concrete5
Concrete5 uses a MariaDB or MySQL as a database backend. So you will need to create a database and user for Concrete5.
First, log in to the MariaDB with the following command:
mysql
Once you are log in, create a database and user with the following command:
MariaDB [(none)]> CREATE DATABASE concrete5;
MariaDB [(none)]> CREATE USER 'concrete5'@'localhost' IDENTIFIED BY 'password';
Next, grant all the privileged to the Concrete5 database with the following command:
MariaDB [(none)]> GRANT ALL ON concrete5.* TO 'concrete5'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
Next, flush the privileges and exit from the MariaDB console with the following command:
MariaDB [(none)]> FLUSH PRIVILEGES;
MariaDB [(none)]> EXIT;
Install Concrete5 CMS
Next, go to the Concrete5 CMS download page, copy the URL of the latest Concrete5 and run the following command to download it to your system:
wget https://www.concretecms.org/application/files/3916/3649/1545/concrete-cms-9.0.1.zip
Once the download is completed, unzip the downloaded file using the command below:
unzip concrete-cms-9.0.1.zip
Next, move the extracted directory to the Apache web root directory:
mv concrete-cms-9.0.1 /var/www/html/concrete5
Next, change the ownership and permission of the concrete5 directory using the following command:
chown -R www-data:www-data /var/www/html/concrete5/
chmod -R 755 /var/www/html/concrete5/
Once you are finished, you can proceed to the next step.
Create an Apache Virtual Host Configuration File
Next, you will need to create an Apache virtual host configuration file for Concrete5 CMS. You can create it using the following command:
nano /etc/apache2/sites-available/concrete5.conf
Add the following lines:
<VirtualHost *:80> ServerAdmin [email protected] DocumentRoot /var/www/html/concrete5 ServerName concrete5.yourdomain.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>
Save and close the file then enable the Apache virtual host and rewrite module using the following command:
a2ensite concrete5.conf
a2enmod rewrite
Finally, restart the Apache service using the following command:
systemctl restart apache2
You can also check the Apache service status using the following command:
systemctl status apache2
You should see the following output:
? apache2.service - The Apache HTTP Server Loaded: loaded (/lib/systemd/system/apache2.service; enabled; vendor preset: enabled) Active: active (running) since Fri 2021-12-10 14:29:49 UTC; 5s ago Docs: https://httpd.apache.org/docs/2.4/ Process: 16050 ExecStart=/usr/sbin/apachectl start (code=exited, status=0/SUCCESS) Main PID: 16054 (apache2) Tasks: 6 (limit: 4701) Memory: 15.4M CGroup: /system.slice/apache2.service ??16054 /usr/sbin/apache2 -k start ??16055 /usr/sbin/apache2 -k start ??16056 /usr/sbin/apache2 -k start ??16057 /usr/sbin/apache2 -k start ??16058 /usr/sbin/apache2 -k start ??16059 /usr/sbin/apache2 -k start Dec 10 14:29:49 debian11 systemd[1]: Starting The Apache HTTP Server...
Once you are finished, you can proceed to the next step.
Access Concrete5 CMS
Now, open your web browser and access the Concrete5 CMS using the URL http://concrete5.yourdomain.com. You will be redirected to the following page:
Select your language and click on the > button. You should see the following page:
Make sure all the PHP extensions are installed then click on the Continue to Installation button. You should see the following page:
Provide your admin username, password, database name, database username, password, and click on the Install Concrete5 button. Once the installation has been finished, you should see the following page:
Click on Edit Your Site. You should see the Concrete5 dashboard on the following page:
Secure Open Concrete5 with Let's Encrypt SSL
If you want to secure your open website with Let's Encrypt SSL then you will need to install the Certbot client package to install and manage the Let's Encrypt SSL for your open website.
You can install it by running the following command:
apt-get install python3-certbot-apache -y
Once the Certbot package is installed, run the following command to download and install the Let's Encrypt SSL for your website.
certbot --apache -d concrete5.yourdomain.com
You will be asked to provide your email and accept the term of service as shown below:
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 concrete5.yourdomain.com Enabled Apache rewrite module Waiting for verification... Cleaning up challenges Created an SSL vhost at /etc/apache2/sites-available/concrete5-le-ssl.conf Enabled Apache socache_shmcb module Enabled Apache ssl module Deploying Certificate to VirtualHost /etc/apache2/sites-available/concrete5-le-ssl.conf Enabling available site: /etc/apache2/sites-available/concrete5-le-ssl.conf
Next, select whether or not to redirect HTTP traffic to HTTPS as shown below:
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
Type 2 and hit Enter to install the Let's Encrypt SSL for your website:
Enabled Apache rewrite module Redirecting vhost in /etc/apache2/sites-enabled/concrete5.conf to ssl vhost in /etc/apache2/sites-available/concrete5-le-ssl.conf - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Congratulations! You have successfully enabled https://concrete5.yourdomain.com You should test your configuration at: https://www.ssllabs.com/ssltest/analyze.html?d=open.yourdomain.com - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - IMPORTANT NOTES: - Congratulations! Your certificate and chain have been saved at: /etc/letsencrypt/live/concrete5.yourdomain.com/fullchain.pem Your key file has been saved at: /etc/letsencrypt/live/open.yourdomain.com/privkey.pem Your cert will expire on 2022-03-11. 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
Now, you can access your website securely using the URL https://concrete5.yourdomain.com.
Conclusion
Congratulations! you have successfully installed Concrete5 CMS with Apache and Let's Encrypt SSL on Debian 11. You can now create and edit your website easily from the web browser. Feel free to ask me if you have any questions.