How to install WonderCMS on Fedora 30

How to install WonderCMS on Fedora 30

WonderCMS is a free and open source flat file CMS whose goal is to be very small, light and simple. It is built using PHP, jQuery, HTML / CSS, and development started in 2008. No initial configuration is required. The installation process is very simple-unzip and upload 5 files. By copying / pasting all files to other locations, you can easily move, backup and restore all files. Moving them to another host does not require any reconfiguration. WonderCMS also does not require a traditional / relational database like MySQL. Flat file technology enables WonderCMS to save all data into a text file (flat file) called database.js, which is constructed in JSON format. In this tutorial, we will use Nginx as a web server to complete the installation and setup of WonderCMS on a Fedora 30 system, and you can choose to use the Acme.sh client and Let’s Encrypt certification authority to add SSL support to protect the transport layer.

Claim

The requirements for installing and running WonderCMS are:

  • PHP version 7.1 or higher with curl, mbstring and zip extensions.
  • Web server (Apache and mod_rewrite Enabled modules, Nginx, IIS).

prerequisites

  • Fedora 30 operating system.
  • Non-root user with the following permissions sudo privilege.

Preliminary steps

Check your Fedora version:

cat /etc/fedora-release# Fedora release 30 (Thirty)

Set time zone:

timedatectl list-timezonessudo timedatectl set-timezone 'Region/City'

Update your operating system package (software). This is an important first step because it ensures that you have the latest updates and security fixes for the operating system’s default packages:

sudo dnf update -y

Install some basic packages that are required for basic management of the Fedora operating system:

sudo dnf install -y curl wget vim git unzip socat bash-completion

Step 1-install PHP and necessary PHP extensions

Install PHP and necessary PHP extensions:

sudo dnf install -y php-cli php-fpm php-common php-curl php-zip php-mbstring php-json

To display PHP compiled in the module, run:

php -mctypecurlexiffileinfo. . .. . .

Check PHP version:

php --version# PHP 7.3.6 (cli) (built: May 28 2019 09:32:59) ( NTS )# Copyright (c) 1997-2018 The PHP Group# Zend Engine v3.3.6, Copyright (c) 1998-2018 Zend Technologies

Start and enable the PHP-FPM service:

sudo systemctl start php-fpm.servicesudo systemctl enable php-fpm.service

Step 2-Install the acme.sh client and obtain the “Let’s Encrypt” certificate (optional)

There is no need to secure the forum with HTTPS, but it is a good practice to protect your website traffic. In order to obtain a TLS certificate from Let’s Encrypt, we will use the acme.sh client. Acme.sh is a pure UNIX Shell software for obtaining TLS certificates (zero correlation) from Let’s Encrypt.

Download and install acme.sh:

sudo su - rootgit clone https://github.com/Neilpang/acme.sh.gitcd acme.sh ./acme.sh --install --accountemail [email protected]source ~/.bashrccd ~

Check the acme.sh version:

acme.sh --version# v2.8.2

Gain RSA with ECC / ECDSA Your domain / hostname certificate:

# RSA 2048acme.sh --issue --standalone -d example.com --keylength 2048# ECDSAacme.sh --issue --standalone -d example.com --keylength ec-256

If you want to test with a fake certificate, you can add --staging Mark the above command.

After running the above command, your certificate and key will be located at:

  • For RSA: /home/username/example.com table of Contents.
  • For ECC / ECDSA: /home/username/example.com_ecc table of Contents.

To list the certificates you issued, you can run:

acme.sh --list

Create a directory to store your certificates. We will use /etc/letsencrypt table of Contents.

mkdir -p /etc/letsecnrypt/example.comsudo mkdir -p /etc/letsencrypt/example.com_ecc

Install / copy the certificate to the / etc / letsencrypt directory.

# RSAacme.sh --install-cert -d example.com --cert-file /etc/letsencrypt/example.com/cert.pem --key-file /etc/letsencrypt/example.com/private.key --fullchain-file /etc/letsencrypt/example.com/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"# ECC/ECDSAacme.sh --install-cert -d example.com --ecc --cert-file /etc/letsencrypt/example.com_ecc/cert.pem --key-file /etc/letsencrypt/example.com_ecc/private.key --fullchain-file /etc/letsencrypt/example.com_ecc/fullchain.pem --reloadcmd "sudo systemctl reload nginx.service"

All certificates will be automatically renewed every 60 days.

After obtaining the certificate, log out from the root user and return to the normal sudo user:

exit

Step 3-install and configure NGINX

WonderCMS works with many popular web server software. In this tutorial, we chose NGINX.

Install NGINX:

sudo dnf install -y nginx

Check NGINX version:

nginx -v# nginx version: nginx/1.16.0

Start and enable the NGINX service:

sudo systemctl start nginx.servicesudo systemctl enable nginx.service

Next, configure NGINX for WonderCMS. Run sudo vim /etc/nginx/conf.d/wondercms.conf And add the following configuration:

server {
  
  listen 80;  listen 443 ssl;  ssl_certificate /etc/letsencrypt/example.com/fullchain.pem;  ssl_certificate_key /etc/letsencrypt/example.com/private.key;  ssl_certificate /etc/letsencrypt/example.com_ecc/fullchain.pem;  ssl_certificate_key /etc/letsencrypt/example.com_ecc/private.key;

  server_name example.com;
  root /var/www/wondercms;

  index index.php;

  location / {
    if (!-e $request_filename) {
      rewrite ^/(.+)$ /index.php?page=$1 last;
    }
  }
  location ~ database.js {
    return 403;
  }

  location ~ .php(/|$) {
    include default.d/php.conf;
    fastcgi_pass unix:/run/php-fpm/www.sock;
  }

}

Check the NGINX configuration for syntax errors:

sudo nginx -t

Reload the NGINX service:

sudo systemctl reload nginx.service

Step 4- Install WonderCMS

Create a document root directory for WonderCMS.

sudo mkdir -p /var/www/wondercms

Change ownership /var/www/wondercms Directory to[y[y[y[your_username]:

sudo chown -R [your_username]:[your_username] /var/www/wondercms

replace[y[y[y[your_username] with the username that you are logged into the server.

Navigate to the document root:

cd /var/www/wondercms

Download and unzip the WonderCMS source code:

wget https://github.com/robiso/wondercms/releases/download/2.7.0/WonderCMS-2.7.0.zipunzip WonderCMS-2.7.0.ziprm WonderCMS-2.7.0.zip

Move the WonderCMS file to the document root directory.

mv wondercms/* .mv wondercms/.* .rmdir wondercms

Change ownership /var/www/wondercms Directory to nginx:

sudo chown -R nginx:nginx /var/www/wondercms

Run sudo vim /etc/php-fpm.d/www.conf And set users and groups to nginx. Initially it was set up as users and groups apache:

sudo vim /etc/php-fpm.d/www.conf# user = nginx# group = nginx

Create /var/lib/php/session/ Directory and change ownership to nginx:

sudo mkdir -p /var/lib/php/session/ && sudo chown -R nginx:nginx /var/lib/php/session/

Restart the PHP-FPM service.

sudo systemctl restart php-fpm.service

Open your website in a web browser and log in with the default password admin Then change the default password.

link

  • https://www.wondercms.com/
  • https://github.com/robiso/wondercms
Sidebar