Install Sitemagic CMS with Nginx on CentOS 7

Sitemagic CMS powers thousands of the most beautiful websites on the internet.
That's because creative professionals choose Sitemagic CMS as their platform.
But don't let the beauty fool you.

Underneath Sitemagic CMS runs a highly capable framework that allow developers to extend and customize everything.
Despite all that power, Sitemagic CMS is a super userfriendly Content Management System.
Anyone who knows how to use a browser, can create stunning websites with Sitemagic CMS.
Installation Requirements:
  • PHP 5.2 or higher with the following PHP extensions enabled: GD, mbstring and SimpleXML;
  • Apache or Nginx web server installed on you system
  • MySQL or MariaDB – optional.
So, let's start with the installation. Make sure that all OS packages are up to date by running the following commands:
yum clean all
yum update
Stop and remove Apache if it is installed and running on your server:
systemctl stop httpd
systemctl disable httpd
yum remove httpd
Install required packages:
yum install nginx mariadb mariadb-server php php-fpm php-cli php-curl php-gd php-mbstring php-mysql php-xml
Edit the /etc/php-fpm.d/www.conf configuration file and change:
user = apache
group = apache
user = nginx
group = nginx
Run the following command:
chown nginx: -R /var/lib/php/session
Start the PHP-FPM, Nginx and MariaDB services and enable them to start on boot:
systemctl start php-fpm
systemctl start nginx
systemctl start mariadb
systemctl enable php-fpm
systemctl enable nginx
systemctl enable mariadb
Download the latest stable version of Sitemagic at to the '/opt' directory on the server. Then, extract it and move the Sitemagic files and directories to the '/var/www/html/sitemagic' directory. At the time of writing this tutorial, the latest stable version of Sitemagic is 4.1.2.
cd /opt/
unzip -d /var/www/html/
mv /var/www/html/Sitemagic/ /var/www/html/sitemagic/
Create a new Nginx configuration file for your website:
vi /etc/nginx/conf.d/
Add the following content:
server {
    listen 80;
    root /var/www/html/sitemagic;
    access_log /var/log/nginx/;
    error_log /var/log/nginx/;
    index index.php;
    location / {
        try_files  $uri $uri/ /index.php?$args;

    location ~* \.(jpg|jpeg|gif|css|png|js|ico|html)$ {
        access_log off;
        expires max;

    location ~ \.php$ {
        try_files $uri = 404;
        fastcgi_split_path_info ^(.+\.php)(/.+)$;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

    location ~ /\.ht {
        deny all;

Replace all of '' with your own domain name. Also, the web server user (nginx) needs to be able to write to 'data', 'files' and 'templates' directories and config.xml.php file. It can easily be accomplished by executing the following command:
chown -R nginx:nginx /var/www/html/sitemagic/
Test the Nginx configuration:
nginx -t
It the test is successful, restart the Nginx service:
systemctl restart nginx
Sitemagic CMS stores data as XML files in the '/var/www/html/sitemagic/data' directory on the server by default, so there is no need to create and use a database.

Open with your favorite web browser and log in using 'admin' as username and 'admin' as password. Then, go to the administrator menu and click 'Settings', change the administrator username and password and click 'Save'.

About Author:

I am a Linux Administrator and Security Expert with this site i can help lot's of people about linux knowladge and as per security expert i also intersted about hacking related news.TwitterFacebook

Newer Post
Older Post


Post a Comment