Guide to Setup Virtualmin with NGINX and PHP-FPM

Posted on July 03, 2013

1. Install Webmin

create the /etc/yum.repos.d/webmin.repo file containing

fetch and install my GPG key with which the packages are signed, with the commands:

Install webmin with command:

2. Install Virtualmin

Create IP with hostname by adding the following line to /etc/hosts:

Verify hostname:

Install virtualmin:

3. Remove Apache and install Nginx

Shut down Apache with the command

4. Configure Virtualmin to use NGINX

  • Login to Virtualmin as root, and go to WebminServersNginx Webserver and make sure that Nginx and its configuration files are found.
  • If not, click on the Module Config link and set the config and command paths correctly.
  • Return to Virtualmin, and go to System SettingsFeatures and Plugins.
  • Un-check the “Apache website” , “SSL website” and “DAV Login”, “Mailman”, “Protected web directories”, “AWstats reporting” and “Subversion repositories” features.
  • Check the “Nginx website” and “Nginx SSL website” features, then click “Save”.
  • If Virtualmin reports that any other features cannot be used without Apache, go back and de-select them too.
  • Go to the System Information page and click Refresh system information in the top right.
  • Verify that Nginx is shown as running in the “Status” section.

5. Using NginX

  • Once Nginx support has been configured, you should be able to create virtual servers just as you would with Apache. However, on the Create Virtual Server page you will need to select Enable Nginx website? in theEnabled features section, instead of Enable Apache.
  • When creating a domain from the command-line API, you will need to use the flag instead of . For SSL websites, you will need to use –virtualmin-nginx-ssl instead of –ssl .
  • Similarly, when creating a domain via the remote API, you will need to use the Parameter instead of

6. Install PHP-FPM

Install RHEL EPEL repository:

Install spawn-fcgi if needed

Configure spawn-fcgi

Install php-fpm:


Leave a Reply

Your email address will not be published.

Contact Us

Have a question? Send us a message. We'll get back to you soon.