How to Install Virtualmin with Nginx and PHP-FPM on an Ubuntu 16.04 VPS

/ Category: Tutorials / Comments: 1

https://www.linuxcloudvps.com/blog/wp-content/uploads/2017/08/How-to-Install-Virtualmin-with-Nginx-and-PHP-FPM-on-an-Ubuntu-16-04-VPS
Spread the love

In this tutorial we are going to provide you with step-by-step instructions on how to install Virtualmin with Nginx and PHP-FPM on an Ubuntu 16.04 VPS. Virtualmin is a website control panel based on Webmin, which gives the ability to create and manage multiple domains, databases, user accounts and is available in both open source and commercial versions.

Before we start with the Virtualmin installation procedure, it is best to make sure your OS package list and the OS packages are up to date by running the following commands:

sudo apt-get update
sudo apt-get upgrade

A minimal OS install is the best possible place to start, so stop and remove Apache service:

sudo service apache2 stop
sudo apt-get remove apache2
sudo apt-get autoremove

Install Virtualmin

Let’s start with the Virtualmin installation procedure. Download the Virtualmin install script to a directory on your cloud server, and run the install script with the ‘–bundle LEMP’ option in order to install Nginx and PHP-FPM. Please note, if your server has less than 1 GB of RAM, consider using the –minimal install option.

cd /opt
wget http://software.virtualmin.com/gpl/scripts/install.sh

sudo /bin/sh install.sh –bundle LEMP

The install script will install all necessary packages. Our selected package bundle is LEMP and the size of install is full, so it will require up to 650 MB of disk space. It could take some time for the script to complete the installation of Virtualmin.

Once the installation is complete, navigate your web browser to https://your_server_IP:10000 or https://your-domain.com:10000 and open the Virtualmin control panel login page. You can log in using ‘root’ as username and root password, then finish the post installation setup wizard.

To change the Webmin/Virtualmin root password use the following command:

usr/share/webmin/changepass.pl /etc/webmin root NEW_PASSWORD

Where NEW_PASSWORD will be your new Webmin/Virtualmin root password.

Currently, there is no official PHP-FPM support in Virtualmin, so you need to download and install a third-party Virtualmin plugin to create Nginx and PHP-FPM powered websites for domains.

cd /opt
git clone https://github.com/Real-Gecko/virtualmin-nginx-fpm.git
tar -zcf virtualmin-nginx-fpm.tar.gz virtualmin-nginx-fpm

Open https://your_server_IP:10000 , click on the Webmin icon >> select ‘Webmin configuration’ from the Webmin menu >> Mebmin module >> Install Module >> From local file >> enter /opt/virtualmin-nginx-fpm.tar.gz >> click ‘Install Module’.

Then, click on the Virtualmin icon >> go to ‘System Settings’ >> Features and Plugins >> click configure next to ‘Nginx PHP-FPM website’ feature and set:

Full path to php-fpm command	/usr/sbin/php-fpm7.0
Command to start PHP-FPM	service php7.0-fpm start
Command to stop PHP-FPM	        service php7.0-fpm stop
Command to reload PHP-FPM	service php7.0-fpm restart
Path to pools configuration directory 	/etc/php/7.0/fpm/pool.d

Then, click on the Virtualmin icon >> go to >> System Settings >> Features and Plugins >> check ‘Nginx PHP-FPM website’ feature, and disable the ‘Apache website’ , ‘SSL website’, ‘AWstats reporting’ and ‘DAV Login’ and features.

That is it. Virtualmin with Nginx and PHP-FPM support has been successfully installed on your server.

 


Of course you don’t have to do any of this if you use one of our Linux Cloud VPS Hosting services, in which case you can simply ask our expert Linux admins to install Virtualmin with Nginx and PHP-FPM for you. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

Feedback

  Comments: 1


  1. I have installed Virtualmin and the virtualmin-nginx-fpm.tar.gz, but it doesn’t work.
    I use Ubuntu 16.04 and the lastest version of Virtualmin.

    When I try to create a new virtual server, I receive the message:
    “Failed to create virtual server : Nginx FPM cannot be enabled for a domian that has an Nginx website”

    I need to deactivate the option Enable Nginx PHP-FPM website?

    Any idea?

    Thanks, fran

Your feedback