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:
- Google Analytics support and SEO friendly URLs.
- Support multiple languages.
- Easily translate Sitemagic CMS into your own language.
- Easily embed content or functionality from other websites.
- 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.