RainLoop is a simple, modern and fast web-based email client. RainLoop source code is hosted on GitHub. This guide will show you how to install RainLoop on a fresh Fedora 28 Vultr instance.
Requirements
- Nginx
- PHP version 5.4 and above, as well as the following extensions:
cURL
iconv
json
libxml
dom
openssl
DateTime
PCRE
SPL
- Optional PHP extension:
PDO
Check the Fedora version.
cat /etc/fedora-release
# Fedora release 28 (Twenty Eight)
Create a new non-root
user account with sudo
access and switch to it.
useradd -c "John Doe" johndoe && passwd johndoe
usermod -aG wheel johndoe
su - johndoe
NOTE: Replace johndoe
with your username.
Set up the timezone.
timedatectl list-timezones
sudo timedatectl set-timezone 'Region/City'
Ensure that your system is up to date.
sudo dnf check-upgrade || sudo dnf upgrade -y
Install necessary packages.
sudo dnf install -y curl wget vim unzip bash-completion
For simplicity, disable SELinux and Firewall.
sudo setenforce 0 ; sudo systemctl stop firewalld ; sudo systemctl disable firewalld
Install PHP, necessary PHP extensions, MariaDB and Nginx
Download and install PHP and the required PHP extensions.
sudo dnf install -y php-cli php-fpm php-curl php-json php-mbstring php-mysqlnd php-pgsql php-sqlite3 php-common php-xml
Check the version.
php -v
Start and enable PHP-FPM.
sudo systemctl start php-fpm.service
sudo systemctl enable php-fpm.service
Install MariaDB.
sudo dnf install -y mariadb-server
Check the version.
mysql --version
Start and enable MariaDB.
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Run the mysql_secure_installation
script to improve the security of your MariaDB installation.
sudo mysql_secure_installation
Log in to MariaDB as the root user.
mysql -u root -p
# Enter password:
Create a new MariaDB database and user, and remember the credentials.
CREATE DATABASE dbname;
GRANT ALL ON dbname.* TO 'username' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
EXIT
Install Nginx.
sudo dnf install -y nginx
Check the version.
nginx -v
Start and enable Nginx.
sudo systemctl start nginx.service
sudo systemctl enable nginx.service
Configure Nginx for RainLoop. Run sudo vim /etc/nginx/conf.d/rainloop.conf
and add the following configuration.
server {
listen 80;
server_name example.com;
root /var/www/rainloop;
index index.php;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location ~ \.php$ {
fastcgi_index index.php;
fastcgi_split_path_info ^(.+\.php)(.*)$;
fastcgi_keep_conn on;
include fastcgi_params;
fastcgi_pass unix:/run/php-fpm/www.sock;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}
location ~ /\.ht {
deny all;
}
location ^~ /data {
deny all;
}
}
Test the configuration.
sudo nginx -t
Reload Nginx.
sudo systemctl reload nginx.service
Install RainLoop
Create a document root.
sudo mkdir -p /var/www/rainloop
Change ownership of the /var/www/rainloop
directory to johndoe
.
sudo chown -R johndoe:johndoe /var/www/rainloop
Download the latest release of RainLoop and unzip it.
cd /var/www/rainloop
wget http://www.rainloop.net/repository/webmail/rainloop-latest.zip
unzip rainloop-latest.zip -d /var/www/rainloop
rm rainloop-latest.zip
Change ownership of the /var/www/rainloop
directory to nginx
.
sudo chown -R nginx:nginx /var/www/rainloop
Run sudo vim /etc/php-fpm.d/www.conf
and set the user and group to nginx
. Initially, it will be set to apache
.
sudo vim /etc/php-fpm.d/www.conf
# user = nginx
# group = nginx
Restart the PHP-FPM service.
sudo systemctl restart php-fpm.service
Open http://example.com/?admin
in your favorite browser and login to configure RainLoop webmail. The default login name is admin
and the password is 12345
. After the first login, you should change the default login credentials.