• Get In Touch
May 29, 2017

How to Install Sitemagic CMS on CentOS 7

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Sitemagic is a free and open source CMS that can be used to build and maintain professional websites.

It is written in PHP and uses XML to store it’s file. Sitemagic CMS is a simple, lightweight and user friendly Content Management System.

Sitemagic CMS powers thousands of the most beautiful websites on the internet. Sitemagic CMS runs a highly capable framework that enables any users to extend and customize everything.

Sitemagic comes with lots of features, some of them are as follows:

  1. Google Analytics support and SEO friendly URLs.
  2. Support multiple languages.
  3. Easily translate Sitemagic CMS into your own language.
  4. Easily embed content or functionality from other websites.
  5. Fast, super reliable, and super flexible.

In this tutorial, we will learn how to install Sitemagic CMS on CentOS 7 server.

Requirements

  • A server running CentOS 7.
  • A normal user with sudo privileges setup on your server.

Update the System

Before starting, you will need to install EPEL repository to your system. You can install it by running the following command:

sudo yum install epel-release -y

Next, make sure that all OS packages are up to date by running the following commands:

sudo yum clean all
sudo yum update -y

Install Nginx Web Server

First, you will need to install Nginx web server and other required packages on your system. You can install it with the following command:

sudo yum install nginx -y

After installing Nginx, start the Nginx web server and enable it to start on boot with the following command:

sudo systemctl start nginx
sudo systemctl enable nginx

Once you are done, you can proceed to install MariaDB.

Install MariaDB

Next, you will need to install MariaDB server on you system. You can install MariaDb with the following command:

sudo yum install mariadb mariadb-server -y

Next, start MariaDB service and enable it to start on boot with the following command:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Next, you will need to secure your MariaDB installation. You can secure it by running the following command:

sudo mysql_secure_installation

Answer all the questions as shown below:

Set root password? [Y/n] n
Remove anonymous users? [Y/n] y
Disallow root login remotely? [Y/n] y
Remove test database and access to it? [Y/n] y
Reload privilege tables now? [Y/n] y

Once MariaDB is secured, login to MariaDB shell with the following command:

mysql -u root -p

Enter your root password when prompted, then create a database for Sitemagic with the following command:

MariaDB [(none)]>CREATE DATABASE sitemagic;

Query OK, 1 row affected (0.00 sec)

Next, create a username and password for Sitemagic with the following command:

MariaDB [(none)]>CREATE USER 'user'@'localhost' IDENTIFIED BY 'password';

Query OK, 1 row affected (0.00 sec)

Next, grant privileges to the Sitemagic database with the following command:

MariaDB [(none)]>GRANT ALL PRIVILEGES ON sitemagic.* TO 'user'@'localhost';

Query OK, 1 row affected (0.00 sec)

Next, you will need to run the FLUSH PRIVILEGES command so that the privileges table will be reloaded by MariaDB and we can use new credential:

MariaDB [(none)]>FLUSH PRIVILEGES;

Query OK, 1 row affected (0.00 sec)

Next, exit from the MariaDB console with the following command:

MariaDB [(none)]>\q

Install PHP and PHP-FPM

Next, you will need to install PHP, PHP-FPM and other required PHP modules on your system.

You can install all of them by running the following command:

sudo yum install php php-fpm php-cli php-curl php-gd php-mbstring php-mysql php-xml -y

Next, you will need to make some changes in /etc/php-fpm.d/www.conf file:

sudo nano /etc/php-fpm.d/www.conf

Change the following lines:

user = nginx
group = nginx

Save and close the file, then restart nginx and php-fpm service with the following command:

sudo systemctl start php-fpm
sudo systemctl start nginx

Install Sitemagic

First, download the latest version of the Sitemagic from their official website. Once the download is completed, unzip the downloaded file to the web root directory with the following command:

sudo mkdir /var/www/html/sitemagic
sudo unzip SitemagicCMS423.zip -d /var/wwww/html/sitemagic

Next, change the ownership of the sitemagic directory with the following command:

sudo chown -R nginx:nginx /var/www/html/sitemagic/

Next, create a new Nginx virtual host block for Sitemagic with the following command:

sudo nano /etc/nginx/conf.d/sitemagic.conf

Add the following lines:

server {
    server_name www.yourdomain.com;
    listen 80;
    root /var/www/html/sitemagic;
    access_log /var/log/nginx/sitemagic-access.log;
    error_log /var/log/nginx/sitemagic-error.log;
    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_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    }

    location ~ /\.ht {
        deny all;
    }

}

Save and close the file, then restart Nginx service to make this changes:

sudo systemctl restart nginx

Access Sitemagic

Sitemagic is runs on port 80, so you will need to allow port 80 through firewalld.

You can do this by running the following command:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Now, open your web browser and type the URL http://yourdomain.com, you will be redirected to the Sitemagic welcome page as shown below:

HP_NO_IMG/data/uploads/users/f36d03b4-5bf0-4986-8e72-2e14d73d9b4d/2092342552.png” alt=”” />

Now, click on login button, you should see the Sitemagic login page as below:

HP_NO_IMG/data/uploads/users/f36d03b4-5bf0-4986-8e72-2e14d73d9b4d/2031247642.png” alt=”” />

Here, provide admin as username and admin as password, then click on the login button. You should see the Sitemagic Dashboard in following image:

HP_NO_IMG/data/uploads/users/f36d03b4-5bf0-4986-8e72-2e14d73d9b4d/304027038.png” alt=”” />

Congratulations! You have successfully installed Sitemagic on your CentOS 7 server.

Conclusion

I hope you can now easily install and configure Sitemagic CMS on your server. For additional help or useful information check the official Sitemagic CMS web site.

Want your very own server? Get our 1GB memory, Xeon V4, 25GB SSD VPS for £10.00 / month.
Get a Cloud Server

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]