PORT_NUMBER<\/span> with your actual server IP address and SSH port number. If you want to log in with a user other than root, just replace the word root with the account name that you want to use.<\/p>\nOnce logged in, make sure that your server is up-to-date by running the following commands:<\/p>\n
sudo yum update\r\n<\/pre>\nYou will also need to add the CentOS 7 EPEL repository:<\/p>\n
sudo yum install epel-release<\/pre>\n<\/span>Step 2: Install Nginx<\/span><\/h2>\nIf you don’t have Nginx running on your server, you can install it with the following command:<\/p>\n
sudo yum install nginx<\/pre>\nAfter the installation is completed, you can start the Nginx service with:<\/p>\n
sudo systemctl start nginx<\/pre>\nYou can also enable Nginx service to automatically start upon server reboot with:<\/p>\n
sudo systemctl enable nginx<\/pre>\nVerify that the Nginx service is running using:<\/p>\n
sudo systemctl status nginx<\/pre>\nYou should then see the following output:<\/p>\n
\u25cf nginx.service - The nginx HTTP and reverse proxy server\r\n Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; disabled; vendor preset: disabled)\r\n Active: active (running) since Mon 2019-07-15 10:21:51 CDT; 2s ago<\/pre>\n<\/span>Step 2: Install PHP<\/span><\/h2>\nCentOS 7 by default comes with PHP 5.4, so we will have to install a new PHP version from another repository. \u00a0In this case, we will install and use PHP 7.2 from the Remi repository.<\/p>\n
To enable the PHP 7.2 repository on your server, run the following commands:<\/p>\n
sudo yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm\r\nsudo yum install yum-utils\r\nsudo yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\nsudo yum-config-manager --disable remi-php54\r\nsudo yum-config-manager --enable remi-php72<\/pre>\nTo install PHP 7.2 along with the other extensions required by WonderCMS, run the following command:<\/p>\n
sudo yum install php php-fpm php-mysqlnd php-curl php-opcache php-xml php-xmlrpc php-gd php-mbstring php-zip php-json<\/pre>\nTo verify if PHP 7.2 is successfully installed, run the following command:<\/p>\n
php -v<\/pre>\nYou should get the following output on your screen:<\/p>\n
PHP 7.2.20 (cli) (built: Jul 2 2019 13:37:16) ( NTS )\r\nCopyright (c) 1997-2018 The PHP Group\r\nZend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies\r\n with Zend OPcache v7.2.20, Copyright (c) 1999-2018, by Zend Technologies<\/pre>\nNow we need to modify our PHP-FPM configuration.<\/p>\n
Open the following file:<\/p>\n
nano \/etc\/php-fpm.d\/www.conf<\/pre>\nThen change the following lines from:<\/p>\n
user = apache\r\ngroup = apache\r\nlisten = 127.0.0.1:9000\r\n;listen.owner = nobody\r\n;listen.group = nobody<\/pre>\nto<\/p>\n
user = nginx\r\ngroup = nginx\r\nlisten = \u00a0\/var\/run\/php\/php-fpm.sock\r\nlisten.owner = nginx\r\nlisten.group = nginx<\/pre>\nCreate the PHP-FPM socket directory with:<\/p>\n
mkdir -p \/var\/run\/php<\/pre>\nThen, change the permission for PHP session directory:<\/p>\n
chown -R nginx:nginx \/var\/lib\/php\/session<\/pre>\nFinally, we will need to start and enable the PHP-FPM service.<\/p>\n
systemctl start php-fpm\r\n\r\nsystemctl enable php-fpm<\/pre>\nVerify that our PHP-FPM service is running:<\/p>\n
systemctl status php-fpm<\/pre>\n<\/span>Step 3: Install WonderCMS<\/span><\/h2>\nLet\u2019s download the latest stable WonderCMS version. At the moment of writing this tutorial, the latest stable version is 2.7.0. To download this version on your server, you can run the following command:<\/p>\n
wget https:\/\/github.com\/robiso\/wondercms\/releases\/download\/2.7.0\/WonderCMS-2.7.0.zip<\/pre>\nExtract the files to the \/var\/www<\/code>\u00a0location on our server with this next line:<\/p>\nsudo unzip WonderCMS-2.7.0.zip -d \/var\/www<\/pre>\nNote:<\/strong>\u00a0If you don\u2019t have the\u00a0unzip<\/code>\u00a0package installed on your server, you can install it with the following command:\u00a0sudo yum install unzip<\/code><\/p>\nRemove the downloaded file with:<\/p>\n
rm WonderCMS-2.7.0.zip<\/pre>\nThe owner of all of these files needs to be the user of the web server running on your system. In our example, we are using the Nginx web server and Nginx runs as \u2018nginx\u2019 user on CentOS 7.\u00a0 To change the owner and set the correct permissions for these files, you need to run the following command:<\/p>\n
sudo chown -R nginx:nginx \/var\/www\/wondercms<\/pre>\n