Log in to your public server via SSH using the following commands on your preferred terminal:<\/p>\r\n
ssh [username]@[server_ip_address]<\/pre>\r\nBe sure to replace “[username] “with the account name of a root-enabled user found on the server (or the root user itself), and replace “[server_ip_address]” with the IP address of your server.<\/p>\r\n
Before proceeding, it is best to update the packages on your CentOS 7 system to their latest versions if they are available:<\/p>\r\n
yum update -y<\/pre>\r\nIt is also recommended to install EPEL and its basic dependencies for CentOS 7 to avoid hiccups caused by missing libraries in the future:<\/p>\r\n
yum install https:\/\/dl.fedoraproject.org\/pub\/epel\/epel-release-latest-7.noarch.rpm<\/pre>\r\nyum groupinstall -y \"Development Tools\"<\/pre>\r\n<\/span>Installing and Configuring LEMP Stack<\/span><\/h2>\r\n1. Installing Nginx<\/h3>\r\n
Nginx is one of the most modern web servers available. To install it, enter the following command:<\/p>\r\n
yum install nginx<\/pre>\r\nAfter installation, we can enable our Nginx service to start at boot:<\/p>\r\n
systemctl enable nginx<\/pre>\r\nVerify that the Nginx service is running using:<\/p>\r\n
systemctl start\u00a0nginx\r\nsystemctl status nginx<\/pre>\r\nYou should see the following output:<\/p>\r\n
\u25cf nginx.service - The nginx HTTP and reverse proxy server\r\n Loaded: loaded (\/usr\/lib\/systemd\/system\/nginx.service; enabled; vendor preset: disabled)\r\n Active: active (running) since Wed 2019-03-27 22:49:42 CDT; 1s ago<\/pre>\r\n2. Installing PHP v7.2<\/h3>\r\n
RainLoop webmail is powered by PHP. It is recommended to install the latest stable version of PHP, which is PHP v7.2 at the time of publishing.<\/p>\r\n
To proceed, use the following commands to install PHP:<\/p>\r\n
yum install http:\/\/rpms.remirepo.net\/enterprise\/remi-release-7.rpm\r\nyum-config-manager --enable remi-php72<\/pre>\r\nContinue by installing all PHP extensions and libraries required by RainLoop Webmail:<\/p>\r\n
yum install php72 php72-php-fpm php72-php-cli php72-php-mysqlnd php72-php-curl php72-php-opcache php72-php-xml php72-php-xmlrpc php72-php-gd php72-php-mbstring php72-php-json php72-php-common<\/pre>\r\nTo verify that you are using PHP 7.2, type the following command:<\/p>\r\n
php72\u00a0-v<\/pre>\r\nYou should see the following text as the output:<\/p>\r\n
PHP 7.2.16 (cli) (built: Mar 5 2019 13:10:50) ( 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.16, Copyright (c) 1999-2018, by Zend Technologies\r\n<\/pre>\r\nTo use “php” instead of the “php72” command when calling PHP, we will need to create a symbolic link:<\/p>\r\n
ln -s \/usr\/bin\/php72 \/usr\/bin\/php<\/pre>\r\nVerify the changes using:<\/p>\r\n
php\u00a0-v<\/pre>\r\nYou should see the same message as before, but this time by using “php” as the command.<\/p>\r\n
Finally, we will need to start and enable the PHP-FPM service.<\/p>\r\n
systemctl start php72-php-fpm\r\n\r\nsystemctl enable php72-php-fpm<\/pre>\r\nVerify that our PHP-FPM service is running:<\/p>\r\n
systemctl status php72-php-fpm<\/pre>\r\n3. Installing MariaDB Server (optional)<\/h3>\r\n
Note that RainLoop can work without using a database server. If you need to have contacts set up for email accounts, it is required to install a database. For this, we recommend MariaDB as the database server.<\/p>\r\n
To proceed with the installation, use this simple one-line command:<\/p>\r\n
yum install mariadb-server<\/pre>\r\nAfter a successful installation, it is best to improve the security of our MariaDB server. Use the following built-in command:<\/p>\r\n
mysql_secure_installation<\/pre>\r\nIt will first ask to replace the root password. It will then ask some questions – you can answer the prompts with “Y” for YES. We recommend answering with Yes to all of these, as they all will help improve the security of your database server:<\/p>\r\n
Remove anonymous users? (Press y|Y for Yes, any other key for No) : Y\r\nDisallow root login remotely? (Press y|Y for Yes, any other key for No) : Y\r\nRemove test database and access to it? (Press y|Y for Yes, any other key for No) : Y\r\nReload privilege tables now? (Press y|Y for Yes, any other key for No) : Y<\/pre>\r\nTo verify the version of MySQL currently installed, type the following command:<\/p>\r\n
mysql -V<\/pre>\r\nYou should see the following text:<\/p>\r\n
mysql Ver 15.1 Distrib 5.5.60-MariaDB, for Linux (x86_64) using readline 5.1<\/pre>\r\n3. Creating the RainLoop Webmail Database for Contacts<\/h3>\r\n
Log in to the database server CLI by using this command. Note that it will ask for a password – it is the one you set up previously while running the secure installation command.<\/p>\r\n
mysql -u root -p<\/pre>\r\nWe can now proceed in creating the database and database user. We will also need to assign the new database user to the database with full privileges.<\/p>\r\n
Remember to replace “[password]” with a strong password.<\/p>\r\n
CREATE DATABASE rainloop_db;\r\nCREATE USER 'rainloop_user'@'localhost' IDENTIFIED BY '[password]';\r\nGRANT ALL PRIVILEGES ON rainloop_db.* TO 'rainloop_user'@'localhost' IDENTIFIED BY '[password]' WITH GRANT OPTION;\r\nFLUSH PRIVILEGES;\r\nEXIT;<\/pre>\r\n