How to Install Mailwizz 1.5.1 on Ubuntu 16.04/64 bits with VestaCP + PHP 7 + PCNTL Enabled

PART 1/2

Step 1 #

# Rent a 4 GB Ram Quad Core VPS server with at least 20 GB SSD space and install Ubuntu 16.04 64 Bits on it. You can rent the VPS with some provider that gives you SSH root access.

I can recommend dedimax.com and time4vps.eu

If you don't know how to setup a VPS with Time4vps you can use my previous step by step tutorial at: https://forum.mailwizz.com/threads/mailwizz-1-3-7-8-step-by-step-tutorial.2829/

Step # 2

# Use linux terminal or Windows putty to connect to your VPS server (replace yourdomain.com with your own domain)

ssh root@your_vps_server_ip_address

# if your SSH server does not respond onthe default port ( 22) you can use -p to indicate the SSH port to connect with:

ssh root@your_vps_server_ip_address -p 22222

Step # 3

# Update the repositories

sudo apt-get update

Step # 4

# Upgrade your OS

sudo apt-get upgrade -y && sudo apt-get dist-upgrade -y

Step # 5

# Install the english locales

sudo locale-gen "en_US.UTF-8" && sudo dpkg-reconfigure locales

Step # 6

# Install some utilities like curl, nano and zip

sudo apt-get install curl nano zip php-zip -y

Step # 7

# Install the great VESTACP control panel into your VPS server

# Download VestaCP 0.9.8 release 19 script with:

curl -O http://vestacp.com/pub/vst-install.sh

Step # 8

# Run the VestaCP installer (You must replace the example data with your own data as shown below:

--hostname mail.yourdomain.com
--email your_own_mailbox@gmail.com
--password your_own_password

# This is the command to install Vestacp into your VPS:

bash vst-install.sh --nginx yes --apache yes --phpfpm no --named yes --remi yes --vsftpd yes --proftpd no --iptables yes --fail2ban yes --quota no --exim yes --dovecot yes --spamassassin no --clamav no --softaculous no --mysql yes --postgresql no --hostname mail.yourdomain.com --email your_own_mailbox@gmail.com --password your_own_password --force

# Don't forget to use the --force option at the end of the install command !!!

Step # 9

# Enable PCNTL under PHP 7.0.22 (it is the vestacp's default php version installed)

# change to temp directory
cd /tmp

# install the developer tools to compile php
apt-get install php7.0-dev -y

# download the sources
wget http://php.net/distributions/php-7.0.22.tar.gz

# uncompress the source file
tar zxvf php-7.0.22.tar.gz

# change to the PCNTL directory
cd php-7.0.22/ext/pcntl

# then run this command
phpize

# the run this command
./configure

# the run this command
make

# change to the modules directory
cd modules

# copy the pcntl module to libraries directory
cp pcntl.so /usr/lib/php/20151012

# edit file /etc/php/7.0/mods-available/pcntl.ini
nano /etc/php/7.0/mods-available/pcntl.ini

# Add the following line to the blank file:
extension=pcntl.so

# Save and close the file using CTRL + X , Y, Enter

# change directory
cd /etc/php/7.0/apache2/conf.d

# create symbolic link for the new pcntl ini file
ln -s /etc/php/7.0/mods-available/pcntl.ini 20-pcntl.ini

# edit the default vestacp php.ini file
nano /etc/php/7.0/apache2/php.ini

# Use CTRL + W to search for "disable_functions" and comment the line using ; at the beginning of the line:

;disable_functions

# Save and close the file using CTRL + X , Y, Enter

# Restart Apache2 server with:

sudo service apache2 restart

# Now you could check that PCNTL is active and working from the following page after install Mailwizz onyour vps server visiting this page:

https://mail.yourdomain.com/backend/index.php/misc/phpinfo

Step # 10

# Restart the vps

sudo shutdown -r now

Step # 11:

# Inside your domain's registrar control panel you must point the two nameservers of your domain to your VPS IP address, like:

ns1.yourdomain.com xxx.xxx.xxx.xxx
ns2.yourdomain.com xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx is your VPS IP address


Step # 12

# Login to your Vesta control panel using https://your_server_ip:8083 using admin username and your own password

Step # 13

# Disable IPv6 for Dovecot from:

Go to Server tab and open Dovecot configuration

Change line 2 to this:

listen = *

Save and restart the dovecot service

Step # 14

# Change the DNS Servers on Vestacp's Default package to:

ns1.yourdomain.com
ns2.yourdomain.com

Save the changes

Step # 15

# Add yourdomain.com to your admin account using the plus sign (+) on WEB menu

Step # 16

# Remember to add the following two A records to your domain DNS zone using:

ns1.yourdomain.com xxx.xxx.xxx.xxx
ns2.yourdomain.com xxx.xxx.xxx.xxx

where xxx.xxx.xxx.xxx must be the IP address of your VPS server

Step # 17

# Now you can upload mailwizz 1.5.1 to your web root folder

# Go to your web root directory

cd /home/admin/web/yourdomain.com/public_html

# At this point you should use Filezilla or WinSCP to upload your mailwizz 1.5.1 installer inside the root folder of your web server (mailwizz-1.5.1.zip file that you downloaded from Mailwizz customer area or from CodeCanyon)

# My web server root folder for this vestacp user (admin) and for this vestacp domain (yourdomain.com) is:

/home/admin/web/yourdomain.com/public_html

# You can use "ls -lha" command to see the file is present inside the actual directory

ls -lha

# you must get at least three files inside the directory:

- index.php
- robots.txt
- mailwizz-1.5.1.zip

# You must remove the other files using rm

rm index.php
rm robots.txt

# Now you must unzip the mailwizz zip file using:

unzip mailwizz-1.5.1.zip

# Now you can enter to the latest mailwizz directory (to do a full / clean install)

cd mailwizz-1.5.1/latest

# And move all files (files and directories) from inside latest folder to the root folder

mv * /home/admin/web/yourdomain.com/public_html/

# Now we must change to the root folder

cd /home/admin/web/yourdomain.com/public_html/

# And must change ownership of all files to the admin user:

chown -R admin:admin *

# Let's check again with ls -lha

ls -lha

# Now the file permissions are right before to install Mailwizz

Step # 18

# Now you must create the MySQL database to install Mailwizz on it
For this you need to use DATABASE menu inside VESTACP control panel

Go to your https://your_vps_server_ip:8083/add/db/ URL to add a database

# Create the DB and write down the following data for later use:

DB name: admin_mailwizz
DB User: admin_mailwizz
DB Pass: your_own_generated_password
DB Type: MYSQL
DB HOST: localhost
DB CHARSET: utf8
DB Port: 3306

# Remember to click the save button and send DB credentials to your mail box.

Step # 19:

# Go to http://www.yourdomain.com/install/

to begin with Mailwizz Install Wizard and follow the steps

Mailwizz Install STEPS:

Part 1. Welcome

Enter your Name, mail and MW license here

Part 2. Requirements Check

# You must get the message:

Congratulations! Your server configuration satisfies all requirements by MailWizz EMA

before to continue to the next step

Part 3. File System Checks

# You must get the message:

Congratulations! The file system satisfies all requirements by MailWizz EMA.

before to continue to the next step

Part 4. Database Import (Connection)

Use the DB data you wrote on previous step here

Part 5. Admin account

Enter your name, last name, email, password, time zone, and also you can create first customer with same data if you want

Part 6. Set Cronjobs

# Use the "crontab -e" command to open the crontab editor
# If requested select NANO option number as your default cron editor

crontab -e

# Add the crontabs to the end of file (remember to replace yourdomain.com with your correct domain)

# Campaigns sender, runs each minute.
* * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php send-campaigns >/dev/null 2>&1

# Transactional email sender, runs once at 2 minutes.
*/2 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php send-transactional-emails >/dev/null 2>&1

# Bounce handler, runs once at 10 minutes.
*/10 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php bounce-handler >/dev/null 2>&1

# Feedback loop handler, runs once at 20 minutes.
*/20 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php feedback-loop-handler >/dev/null 2>&1

# Delivery/Bounce processor, runs once at 3 minutes.
*/3 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php process-delivery-and-bounce-log >/dev/null 2>&1

# Various tasks, runs each hour.
0 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php hourly >/dev/null 2>&1

# Daily cleaner, runs once a day.
0 0 * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php daily >/dev/null 2>&1

# Save and close the file using CTRL + X , Y, Enter

# Now you must delete the Mailwizz install folder from your web root folder

rm -rf /home/admin/web/yourdomain.com/public_html/install

STEP # 20

# Login to your Mailwizz BACKEND Area accesing the following URL:

http://www.yourdomain.com/backend/

# Remeber to use your email and password you choose on previous step # 19 point 5.

Next part I will cover the Mailwizz configuration to be able to add the five system mailboxes and also one delivery server to send campaigns.

ENJOY IT !!
 
Last edited:
# Additional CRONTABS

# Using console or Linux terminal you can use the "crontab -e" command to open the crontab editor. If requested, select NANO option as your default cron editor

crontab -e

# Add these additional crontabs to the end of file to process CLI and URL Imports (remember to replace yourdomain.com with your correct domain)

*/5 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php list-import folder >/dev/null 2>&1

0 0 * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php list-import url >/dev/null 2>&1

*/5 * * * * /usr/bin/php -q /home/admin/web/yourdomain.com/public_html/apps/console/console.php suppression-list-import folder >/dev/null 2>&1
 
Back
Top