Setup WonderCMS With Apache On FreeBSD

WonderCMS is an open source CMS written in PHP, very small in size with flat files, fast, responsive, and requires no configuration. This is an easy way to create and edit websites. You can get the WonderCMS open source code on Github.

Unlike other CMS which have large files, WonderCMS is a content management system (CMS) which is claimed to be the smallest CMS in the world. We have not calculated this size with other supporting files, such as ReadME. htaccess, style sheets, and even images to create gradient backgrounds.

The creator of WonderCMS is Robert Isoski. This CMS has its own official website https://www.wondercms.com. It is from this site that you can download the latest version of WonderCMS for free. You can also download WonderCMS from the official Github Repository.

When we start running WonderCMS, you can immediately feel the ease of editing a website. Because all its features are intentionally made to make things easier, such as one-step installation, one-click update, one-click backup, theme/plugin installer, and more. Supports most server types (Apache, NGINX, IIS). WonderCMS does not track users or store personal cookies. There is only one session state cookie. Your WonderCMS installation is completely separate from the WonderCMS server. One-click updates are delivered via GitHub.

This guide will show you how to install WonderCMS on a new FreeBSD 13.2 with Apache24 as the web server.


1. System Requirements

OS: FreeBSD 13.2
Hostname: ns3
IP address: 192.168.5.2
WEb server: apache24
PHP version: PHP82
Dependencies: php82-mbstring, php82-zip, mod_php82
PHP-FPM


2. Install WonderCMS

Because WonderCMS is a content management system (CMS), it requires a web server to run it. In this article we will web server apache24.

a. Install apache24

We will use Apache24 to connect WonderCMS to the web server. To run WonderCMS, you must install Apache first. On FreeBSD the apache24 repository is available, use the PKG package to install apache24.
root@ns3:~ # pkg install apache24
Open the /usr/local/etc/apache24 folder, look for the httpd.conf file. In the httpd.conf file, change several scripts below.

Listen 80
ServerAdmin datainchi@gmail.com
ServerName datainchi.com:80

To activate apache24 immediately, open the /etc/rc.conf file, and add the script below to the file.

apache24_enable="YES"

Run the apache24 web server.
root@ns3:~ # service apache24 restart

b. Install Dependencies

WonderCMS is made in PHP, therefore you have to install PHP dependencies to be active with the Apache web server. Run the command below to enable some of the dependencies that WonderCMS requires.
root@ns3:~ # pkg install php82-8.2.14
root@ns3:~ # pkg install php82-mbstring-8.2.14 php82-curl-8.2.14
root@ns3:~ # pkg install php82-zip-8.2.14
root@ns3:~ # pkg install mod_php82-8.2.14
To activate the PHP module, open the "/usr/local/etc/apache24/httpd.conf" file, and type add the script below in the file.

LoadModule rewrite_module libexec/apache24/mod_rewrite.so
LoadModule php_module         libexec/apache24/libphp.so
<IfModule dir_module>
    DirectoryIndex index.php index.html
</IfModule>

AddType application/x-httpd-php .php
AddType application/x-httpd-php .php .phtml .php3
AddType application/x-httpd-php-source .phps
Alias /wondercms "/usr/local/www/wondercms"
    <Directory "/usr/local/www/wondercms">
        Options Indexes FollowSymlinks MultiViews
        AllowOverride all
        Require all granted
    </Directory>


c. Install PHP-FPM

PHP-FPM is a processor for PHP, one of the most common scripting languages. WonderCMS uses PHP-FPM to handle larger volumes of web traffic without relying on server resources. You must enable PHP-FPM to run WonderCMS.

Open the /usr/local/etc/php-fpm.d/www.conf file, and activate the script below into the file.

user = www
group = www
listen = 127.0.0.1:9000
listen.owner = www
listen.group = www
listen.mode = 0660

After that you create /usr/local/etc/apache24/Includes/php-fpm.conf file, and type the script below in the php-fpm.conf file.

<IfModule proxy_fcgi_module>
   <IfModule dir_module>
       DirectoryIndex index.php
   </IfModule>
   <FilesMatch "\.(php|phtml|inc)$">
       SetHandler "proxy:fcgi://127.0.0.1:9000"
   </FilesMatch>
</IfModule>

Enable the script below "/usr/local/etc/apache24/httpd.conf" file.

LoadModule mpm_prefork_module libexec/apache24/mod_mpm_prefork.so
#LoadModule mpm_worker_module libexec/apache24/mod_mpm_worker.so
LoadModule authnz_fcgi_module libexec/apache24/mod_authnz_fcgi.so
LoadModule proxy_module libexec/apache24/mod_proxy.so
LoadModule proxy_http_module libexec/apache24/mod_proxy_http.so
LoadModule proxy_fcgi_module libexec/apache24/mod_proxy_fcgi.so
LoadModule proxy_scgi_module libexec/apache24/mod_proxy_scgi.so

Enable PHP-FPM in the /etc/rc.conf file by adding the script below.

php_fpm_enable="YES"

Run PHP-FPM.
root@ns3:~ # service php-fpm restart
root@ns3:~ # service apache24 restart

d. Download WonderCMS

On FreeBSD the WonderCMS repository is not available, you have to download it from the official site or Github. To make things easier, we will download it from the Github repository. Run this command to clone WonderCMS.
root@ns3:~ # cd /usr/local/www
root@ns3:/usr/local/www # git clone https://github.com/WonderCMS/wondercms.git
Run ownership and permissions.
root@ns3:/usr/local/www # chown -R www:www /usr/local/www/wondercms
root@ns3:/usr/local/www # chmod 775 /usr/local/www/wondercms
Before you run WonderCMS restart apache and PHP-FPM.
root@ns3:~ # service php-fpm restart
root@ns3:~ # service apache24 restart
Now we run WonderCMS, open the Google Chrome web browser or another, type "http://192.168.5.2/wondercms" on your monitor screen it will appear like the image below.


Click "CLICK HERE TO LOGIN", you will be displayed by a password menu. Type the WonderCMS password.



WonderCMS is a database-less flat file content management system. The file size is very small, so it is easy to use. Not only that, the structure will make it easier for you with a number of functionalities needed in a flat file CMS solution. With the help of Apache you can set up a simple server without a database.
Iwan Setiawan

I Like Adventure: Mahameru Mount, Rinjani Mount I Like Writer FreeBSD

Post a Comment

Previous Post Next Post