{"id":18109,"date":"2016-04-10T14:52:01","date_gmt":"2016-04-10T19:52:01","guid":{"rendered":"https:\/\/www.rosehosting.com\/blog\/?p=18109"},"modified":"2022-12-13T04:27:54","modified_gmt":"2022-12-13T10:27:54","slug":"how-to-install-sitemagic-cms-with-nginx-on-centos-7","status":"publish","type":"post","link":"https:\/\/www.rosehosting.com\/blog\/how-to-install-sitemagic-cms-with-nginx-on-centos-7\/","title":{"rendered":"How to Install Sitemagic CMS on CentOS 7 – With Nginx"},"content":{"rendered":"
<\/p>\n
In this tutorial we will show you how to install Sitemagic CMS with Nginx on a CentOS 7 VPS<\/strong>.\u00a0Sitemagic is an open-source CMS application written in PHP. It allows web developers to create professional and great looking websites in no time. This tutorial was tested and written for a CentOS 7 VPS<\/a>, but it should work on any RPM based Linux distribution.<\/p>\n <\/p>\n In order to install Sitemagic on your server, you need to make sure it meets the following requirements:<\/p>\n So, let’s start with the installation. Make sure that all OS packages are up to date by running the following commands:<\/p>\n Stop and remove Apache if it is installed and running on your server:<\/p>\n Install required packages:<\/p>\n Edit the \/etc\/php-fpm.d\/www.conf configuration file and change:<\/p>\n to:<\/p>\n Run the following command:<\/p>\n Start the PHP-FPM, Nginx and MariaDB services and enable them to start on boot:<\/p>\n Download the latest stable version of Sitemagic at http:\/\/sitemagic.org\/Download.html 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.<\/p>\n Create a new Nginx configuration file for your website:<\/p>\n Add the following content:<\/p>\n Replace all instances of ‘yourdomain.com’ 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:<\/p>\n Test the Nginx configuration:<\/p>\n It the test is successful, restart the Nginx service:<\/p>\n 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.<\/p>\n Open http:\/\/yourdomain.com 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’.<\/p>\n <\/p>\n That is it. The Sitemagic CMS installation is complete.<\/p>\n Of course you don\u2019t have to Install Sitemagic CMS on CentOS 7,\u00a0 if you use one of our CMS VPS Hosting<\/a> services, in which case you can simply ask our expert Linux admins to install Sitemagic CMS with Nginx<\/strong> for you. They are available 24×7 and will take care of your request immediately.<\/p>\n PS.<\/strong><\/span> If you liked this post, on\u00a0How to Install Sitemagic CMS on CentOS 7,\u00a0 please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.<\/p>\n","protected":false},"excerpt":{"rendered":" In this tutorial we will show you how to install Sitemagic CMS with Nginx on a CentOS 7 VPS.\u00a0Sitemagic is … <\/p>\n\n
yum clean all\r\nyum update<\/pre>\n
systemctl stop httpd\r\nsystemctl disable httpd\r\nyum remove httpd<\/pre>\n
yum install nginx mariadb mariadb-server php php-fpm php-cli php-curl php-gd php-mbstring php-mysql php-xml<\/pre>\n
user = apache\r\ngroup = apache<\/pre>\n
user = nginx\r\ngroup = nginx<\/pre>\n
chown nginx: -R \/var\/lib\/php\/session<\/pre>\n
systemctl start php-fpm\r\nsystemctl start nginx\r\nsystemctl start mariadb<\/pre>\n
systemctl enable php-fpm\r\nsystemctl enable nginx\r\nsystemctl enable mariadb<\/pre>\n
cd \/opt\/\r\nunzip -d \/var\/www\/html\/ SitemagicCMS412.zip\r\nmv \/var\/www\/html\/Sitemagic\/ \/var\/www\/html\/sitemagic\/\r\n<\/pre>\n
vi \/etc\/nginx\/conf.d\/yourdomain.com.conf<\/pre>\n
server {\r\n server_name www.yourdomain.com yourdomain.com;\r\n listen 80;\r\n root \/var\/www\/html\/sitemagic;\r\n access_log \/var\/log\/nginx\/yourdomain.com-access.log;\r\n error_log \/var\/log\/nginx\/yourdomain.com-error.log;\r\n index index.php;\r\n \r\n location \/ {\r\n try_files $uri $uri\/ \/index.php?$args;\r\n }\r\n\r\n location ~* \\.(jpg|jpeg|gif|css|png|js|ico|html)$ {\r\n access_log off;\r\n expires max;\r\n }\r\n\r\n location ~ \\.php$ {\r\n try_files $uri = 404;\r\n fastcgi_split_path_info ^(.+\\.php)(\/.+)$;\r\n fastcgi_pass 127.0.0.1:9000;\r\n fastcgi_index index.php;\r\n include \/etc\/nginx\/fastcgi_params;\r\n fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;\r\n }\r\n\r\n location ~ \/\\.ht {\r\n deny all;\r\n }\r\n\r\n}<\/pre>\n
chown -R nginx:nginx \/var\/www\/html\/sitemagic\/<\/pre>\n
nginx -t<\/pre>\n
systemctl restart nginx<\/pre>\n