How to Install WonderCMS on AlmaLinux 9

Estimated reading: 6 minutes 8 views

WonderCMS is a lightweight, open-source content management system (CMS) designed to be simple and efficient. Unlike more complex platforms, it focuses on ease of use, making it an ideal choice for users who want to create and manage websites without extensive technical knowledge. WonderCMS operates without a database, relying instead on flat-file storage, which simplifies installation and maintenance. The entire system can be set up with a single file, and its minimalistic design ensures fast performance. It offers basic features like customizable themes, plugins, and SEO-friendly settings, allowing users to build functional websites with minimal hassle.

In this tutorial, we’ll show you how to install WonderCMS on an AlmaLinux 9 server. You will run WonderCMS with the Httpd web server and PHP 8.x.

Prerequisites

Before you start, make sure you have the following requirements:

  • An AlmaLinux 9 server.
  • A non-root user with administrator privileges.
  • A domain name points to a server IP address.
  • A SELinux with the status permissive.

Installing Apache and PHP

WonderCMS is an open-source content management system written in PHP. It’s a flat CMS, which means it doesn’t require a database like MySQL/MariaDB to install. It used text files as a database.

In this guide, you will install WonderCMS with Apache/httpd web server and PHP 8.x on the AlmaLinux 9 server.

First, run the command below to install the httpd web server and PHP packages on your AlmaLinux server. At this time, you can install WonderCMS with PHP 8.x on your system.

dnf install httpd php php-common php-curl php-opcache php-xml php-gd php-mbstring php-zip php-json wget unzip git

Type y to confirm the installation.

Once the installation is complete, open the default PHP configuration /etc/php.ini using the following nano editor command.

nano /etc/php.ini

Change the default configuration with the following, and make sure to adjust both date.timezone, and memory_limit options with your environment.

date.timezone = Europe/Amsterdam
memory_limit = 512M

upload_max_filesize = 128MB
post_max_size = 128MB

max_execution_time = 300
max_input_vars = 5000

When finished, save the file and quit the editor.

Now run the following command to start and enable the httpd service. Then, verify it to ensure that the service is running.

systemctl enable --now httpd
systemctl status httpd

If the httpd service is running, you should get an output like the following:

Setting up Firewalld

After you have installed Apache and PHP, you need to open ports for both HTTP and HTTPS via the firewalld. This will allow access to your WonderCMS installation on both HTTP and HTTPS protocols.

Open both HTTP and HTTPS services on firewalls using the command below. You will see an output of success.

firewall-cmd --add-service={http,https} --permanent

Now, run the command below to reload Firewalld rules and apply the new changes.

firewall-cmd --reload

Lastly, verify the firewalld rules using the command below. Make sure both HTTP and HTTPS services are added to the firewalld.

firewall-cmd --list-all

Downloading WonderCMS source code

In this section, you will be downloading the WonderCMS source code and configuring the document-root directory with proper permissions and ownership. So, make sure to visit the WonderCMS GitHub page and grab the latest download link.

Move to the /var/www directory and download the latest version of WonderCMS using the wget command below. Make sure to visit the WOnderCMS GitHub page to grab the latest version.

cd /var/www/
wget https://github.com/WonderCMS/wondercms/releases/download/3.4.3/wondercms-343.zip

Once downloaded, run the unzip command below to extract the WonderCMS source code to /var/www/wondercms. This directory will be the DocumentRoot for WonderCMS.

unzip wondercms-343.zip -d .

Now run the following command to change the ownership of the /var/www/wondercms directory to the ‘apache‘ user and the default permission to 755.

chown -R apache:apache /var/www/wondercms
chmod -R 755 /var/www/wondercms

Setting up an httpd virtual host

After you have downloaded and configured the Document-Root for WonderCMS, you will create a new Apache/httpd virtual host configuration that will be used to run the WonderCMS installation. Make sure that you have a domain name pointed to your IP address. Also, you must ensure that the mod_rewrite module in httpd is enabled.

Create a new httpd virtual host configuration /etc/httpd/conf.d/wondercms.conf using the following nano editor command.

nano /etc/httpd/conf.d/wondercms.conf

Insert the configuration below into the file and make sure to change the ServerName option to your target domain name.

```
<VirtualHost *:80>
 ServerName your_domain
 DirectoryIndex index.php
 DocumentRoot /var/www/wondercms 
 Redirect /wondercms/loginURL /loginURL

 ErrorLog /var/log/httpd/your_domain-error.log
 CustomLog /var/log/httpd/your_domain-access.log combined

 <Directory /var/www/wondercms>
 Options FollowSymLinks
 AllowOverride All
 Require all granted
 </Directory>

</VirtualHost>

Save the file and exit the editor.

Now run the command below to verify your httpd syntax and ensure there is no error. You will see an output Syntax OK if you have proper httpd syntax.

apachectl configtest

Lastly, restart the httpd web server to apply the new virtual host file for WonderCMS. After the command is executed, your WonderCMS installation should be accessible.

systemctl restart httpd

Securing WonderCMS with HTTPS via Certbot

Now that you have created the Apache/httpd virtual host, the next step is to secure WonderCMS with HTTPS via Certbot and Let’s Encrypt. You must ensure that the EPEL repository is added to your system, and the Certbot package is available on the EPEL repository.

Install the EPEL repository on your AlmaLinux server with the command below.

dnf install epel-release

Once the EPEL repository is added, install the certbot and python3-certbot-apache plugin using the dnf command below. Type y to confirm the installation.

dnf install certbot python3-certbot-apache

After the installation is complete, run the certbot command below to generate SSL/TLS certificates for your WonderCMS installation. Make sure to change the domain name and email address to your information.

certbot --apache -d domain.com

Accessing WonderCMS

Open the web browser and visit your WonderCMS domain name, such as https://your_domain/. On the WonderCMS homepage, you should see the generated password. Copy the password, save it in a secret place, and press the button CLICK HERE TO LOGIN.

Paste your generated password and click LOGIN.

If successful, you should get the WonderCMS administration page like the following:

Conclusion

Congratulations! You have completed the installation of WonderCMS on the AlmaLinux 9 server. Your WonderCMS installation is running with Httpd web server and PHP 8.x. Also secured with firewalld and HTTPS via certbot. From here, you can upload text files and install new themes or plugins.

Share this Doc

How to Install WonderCMS on AlmaLinux 9

Or copy link

CONTENTS