In our previous guide, we discussed how to install WonderCMS on Debian 10 Buster which uses Apache as the webserver. In this guide, we will learn how to install WonderCMS with Nginx on Debian 10 Buster.
If you want to check our previous guide on installing WonderCMS with Apache, follow the link below;
Install WonderCMS on Debian 10 Buster
Install WonderCMS with Nginx on Debian 10
Prerequisites
There are a number of requirements that WonderCMS requires. These include;
- PHP version 7.1 or greater
- cURL extension
- mbstring extension
- Zip extension
- mod_rewrite module enabled
- any type of server (Apache, NGINX, IIS)
Install WonderCMS Requirements
To begin with, update and upgrade your system packages.
apt update
apt upgrade
Install Nginx Web server, PHP and the required extensions. PHP 7.3 is the default available version on Debian 10 Buster.
apt install nginx php php-fpm php-mbstring php-curl php-zip
Running Nginx
Apache installs by default with PHP. Hence, stop it and run Nginx.
systemctl stop apache2
systemctl disable apache2
systemctl mask apache2
Start and enable Nginx to run on boot.
systemctl start nginx
systemctl enable nginx
Configure Nginx for WonderCMS
Create WonderCMS Nginx configuration file with the following content.
vim /etc/nginx/sites-available/wondercms.conf
server {
listen 80;
server_name wondercms.example.com;
root /usr/share/nginx/html/wondercms;
index index.php;
autoindex off;
location / {
if (!-e $request_filename) {
rewrite ^/(.+)$ /index.php?page=$1 last;
}
}
# prevent access to database.js
location ~ database.js {
return 403;
}
location ~ \.php(/|$) {
include fastcgi.conf;
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
}
}
Run Nginx configuration test.
nginx -t
Enable WonderCMS Nginx site.
ln -s /etc/nginx/sites-available/wondercms.conf /etc/nginx/sites-enabled/
Reload Nginx service to effect the changes
systemctl restart nginx
Install WonderCMS on Debian 10 Buster
Download WonderCMS zipped configuration and extract them to the WonderCMS Nginx root web directory.
git clone https://github.com/robiso/wondercms.git /var/www/html/wondercms
Change the user and group ownership of WonderCMS configuration to web server user.
chown -R www-data:www-data /var/www/html/wondercms
Restart Nginx
systemctl restart nginx
Accessing WonderCMS
You can now access WonderCMS via the address, http://wondercms.example.com.
Click on “Click to login” to login to your site using the provided password.
Change the default password by navigating to Settings > Security.
You have successfully installed WonderCMS with Nginx on Debian 10 Buster.
From WonderCMS, here are five safety recommended tips.
- Change the default password and default login URL immediately. The default login URL will then automatically disappear from your footer.
- Install themes and plugins only from sources you trust.
- Regularly update WonderCMS and always create backups.
- WonderCMS supports running JavaScript anywhere. Be careful not to paste random JavaScript code.
- WonderCMS supports uploading SVG’s, which could also contain JavaScript code. Don’t get tricked into uploading malicious SVG’s. If in doubt, avoid uploading SVG file extensions.
Read more about WonderCMS on WonderCMS wiki.
More Tutorials
Install Automad CMS on Debian 10/Ubuntu 18.04
Install Snipe-IT on Debian 10/Ubuntu 18.04