WonderCMS is an open source, fast and small flat file CMS written in PHP. WonderCMS source code is hosted on Github. This guide will show you how to install WonderCMS on a fresh Ubuntu 18.04 LTS Rcs instance with Nginx as a web server.
Requirements
- PHP version 7.1 or greater with the
curl,mbstringandzipextensions. - Web server, such as Apache with
mod_rewritemodule enabled, Nginx or IIS. This guide will use Nginx.
Before you begin
Check the Ubuntu version.
lsb_release -ds
# Ubuntu 18.04.1 LTSCreate a new non-root user account with sudo access and switch to it.
adduser johndoe --gecos "John Doe"
usermod -aG sudo johndoe
su - johndoeNOTE: Replace johndoe with your username.
Set up the timezone.
sudo dpkg-reconfigure tzdataEnsure that your system is up to date.
sudo apt update && sudo apt upgrade -yInstall necessary packages.
sudo apt install -y zip unzip curl wget gitInstall PHP
Install PHP, as well as the necessary PHP extensions.
sudo apt install -y php7.2 php7.2-cli php7.2-fpm php7.2-common php7.2-curl php7.2-zip php7.2-mbstringCheck the version.
php --version
# PHP 7.2.15-0ubuntu0.18.04.1 (cli) (built: Feb 8 2019 14:54:22) ( NTS )Install Nginx
Install Nginx.
sudo apt install -y nginxCheck the version.
sudo nginx -v
# nginx version: nginx/1.14.0 (Ubuntu)Run sudo vim /etc/nginx/sites-available/wondercms.conf and configure Nginx for WonderCMS.
server {
listen 80;
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 snippets/fastcgi-php.conf;
fastcgi_pass unix:/var/run/php/php7.2-fpm.sock;
}
}Save the file and exit.
Activate the new wondercms.conf configuration by linking the file to the sites-enabled directory.
sudo ln -s /etc/nginx/sites-available/wondercms.conf /etc/nginx/sites-enabled/Test the configuration.
sudo nginx -tReload Nginx.
sudo systemctl reload nginx.serviceInstall WonderCMS
Create a document root directory.
sudo mkdir -p /var/www/wondercmsChange ownership of the /var/www/wondercms directory to johndoe.
sudo chown -R johndoe:johndoe /var/www/wondercmsNavigate to the document root folder.
cd /var/www/wondercmsDownload and unzip WonderCMS.
wget https://github.com/robiso/wondercms/releases/download/2.6.0/WonderCMS-2.6.0.zip
unzip WonderCMS-2.6.0.zip
rm WonderCMS-2.6.0.zipMove WonderCMS files to the document root directory.
mv wondercms/* . && mv wondercms/.* .
rmdir wondercmsChange ownership of the /var/www/wondercms directory to www-data.
sudo chown -R www-data:www-data /var/www/wondercmsOpen your site in a web browser and log in with the default password admin and change the default password afterward.