Faruque Ahmed : MCP, MCSA, MCSE, MCTS, MCIT, CCNA, OCA, OCP, GCP
Install PHP 7.4 and more modules.
$ sudo apt install apache2 mysql-server php7.4 libapache2-mod-php7.4 php7.4-json php7.4-curl php7.4-mysql php7.4-xml php7.4-zip php7.4-imap wget unzip -y
systemctl start apache2
systemctl enable apache2
# vi /etc/apache2/sites-available/rainloop.conf
----------------------------OR--------------------------
<VirtualHost *:80> ServerAdmin admin@example.com ServerName example.com ServerAlias www.example.com DocumentRoot /var/www/rainloop/-----------------------------------
Disable Apache default configuration file.
# a2dissite 000-default.conf
Save and close the file, then enable the new site and the Apache rewrite module:
systemctl restart apache2
http://192.0.2.10/?admin
You can now access Rainloop by navigating to http://yourdomain.com or http://your_server_ip in your web browser. To log in to the Rainloop admin panel, navigate to http://yourdomain.com/?admin and log in with the default credentials:
Username: admin
Password: 12345
Create database
You need to create a database to enable contacts in Rainloop. Lets create a database first.
# mysql -u root -p
mysql> create database rainloop;
mysql> exit
------------------------------------------------------------------------
Before we begin with the installation, you will need to connect to your server via SSH as the root user or as any other user that has sudo privileges.
To connect to your server as the root user, use the following command:
ssh root@IP_ADDRESS -p PORT_NUMBER
Make sure to replace IP_ADDRESS and PORT_NUMBER with your actual server IP address and SSH port number.
Once logged in, make sure that your server is up-to-date by running the following commands:
sudo apt update
sudo apt upgrade
You could even restart your VPS just to ensure that all packages that are being used are the ones that we just updated.
There are two RainLoop Webmail editions available for download: Community Edition (under the AGPL v3 license) and Standard Edition (under the RainLoop software license).
For the purposes of this tutorial, we will install the free and open-source community edition.
To download the latest RainLoop Webmail community version, run the following command:
wget http://www.rainloop.net/repository/webmail/rainloop-community-latest.zip
Next, let’s create a new directory for our RainLoop webmail installation. In our example, we will use /var/www/rainloop, but you can also choose a different location.
To create the rainloop directory, run the following command:
sudo mkdir /var/www/rainloop
To extract the files into this new directory, run the following command:
unzip rainloop-community-latest.zip -d /var/www/rainloop
Once the installation is completed, you will need to set the correct file and directory permissions.
To set the proper read/write permissions, run the following commands:
cd /var/www/rainloopfind . -type d -exec chmod 755 {} \;find . -type f -exec chmod 644 {} \;The owner of the files needs to be the user of the web server running on your system. In our example, we are using the Apache web server and Apache runs under the “www-data” user on Ubuntu. To change the owner of the files, you can then run the following commands:
cd /var/www/rainloopchown -R www-data:www-data .The same user should also apply in case you’re using Nginx.
In this step, we will show you how to create a virtual host file in Apache or Nginx – the procedure depends on which web server you have running on your system. This is so that you can access your RainLoop installation from your browser.
Create the virtual host file by executing the following command:
nano /etc/apache2/sites-available/rainloop.conf
Then enter the following information:
<VirtualHost *:80> ServerName webmail.mydomain.com DocumentRoot "/var/www/rainloop/"In our example, we decided to use a subdomain called webmail.mydomain.com for accessing our RainLoop. Make sure to replace mydomain.com with your actual domain name.
To enable the new RainLoop virtual host, run the following command:
a2ensite rainloop.conf
You should see the following output:
Enabling site rainloop.
To activate the new configuration, you need to run:
systemctl reload apache2
Reload your Apache in order to activate the new configuration:
systemctl reload apache2
That’s it – your Apache configuration is complete.
Create the virtual host file by executing the following command:
nano /etc/nginx/sites-available/rainloop.conf
Insert the following contents in that file:
--------------------------------
server { listen 80;In our example, we decided to use a subdomain called webmail.mydomain.com for accessing our RainLoop instance. Make sure to replace mydomain.com with your actual domain name.
To enable the server configuration that we just created, run the following command:
ln -s /etc/nginx/sites-available/rainloop.conf /etc/nginx/sites-enabled/rainloop.conf
To check for any Nginx configuration errors, run the following command:
nginx -t
If there are no errors, you should get the following output:
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful
You can now reload Nginx in order to activate the new configuration:
systemctl reload nginx
To access your RainLoop Webmail admin panel, open your browser and enter http://webmail.mydomain.com/?admin (replace this with the actual domain name you used in your web server configuration).
The default admin login credentials are:
Username: admin
Password: 12345
Before we can use MySQL with Rainloop Webmail, we need to create a database and a user with the necessary privileges. Follow these steps to configure MySQL:
Log in to the MySQL shell by running the following command:
sudo mysql -u root -p
Enter your root password when prompted.
Create a database for Rainloop Webmail by running the following command:
CREATE DATABASE rainloop;
Create an SQL user to access the database. Replace YourPassword23! with a strong password of your choice.
CREATE USER 'rainuser'@'localhost' IDENTIFIED BY 'YourPassword23!';
Grant the rainuser access to the rainloop database by running the following command:
GRANT ALL ON rainloop.* TO 'rainuser'@'localhost';
Reload the privilege table by running the following command:
FLUSH PRIVILEGES;
Exit the MySQL shell by running the following command:
exit