Setting Up A New VPS on Vultr With Webmin

This is a collection of notes I’ve found around the web to help me set up subsequent VPS’s on Vultr (or anywhere that I will use Webmin instead of cPanel).

Install the VPS. Update to latest version of software with apt-get update / apt-get upgrade (or yum upgrade if on CentOS)

Set hostname to the fully qualified server name other virtual min will get upset. Update local /etc/hosts to add IP address, or update DNS accordingly

Fetch the Virtualmin install script ( instructions at https://www.virtualmin.com/download.html#gpl ) or the install script itself for Linux and FreeBSD.

Run ‘sh ./install.sh’

Get ConfigServer Firewall and the Webmin module installed. Instructions at http://download.configserver.com/csf/install.txt

Install XCache module if running PHP… apt-get install php5-xcache

Install MPM-ITK Apache2 module and add the following code via Virtualmin -> Servers -> Virtualmin Virtual Servers (GPL) -> Server Templates -> Apache Website

<IfModule mpm_itk_module>
AssignUserId ${USER} ${USER}
</IfModule>
<FilesMatch ".+.ph(p[345]?|t|tml)$">
    SetHandler application/x-httpd-php
</FilesMatch>
<FilesMatch ".+.phps$">
    SetHandler application/x-httpd-php-source
    # Deny access to raw php sources by default
    # To re-enable it's recommended to enable access to the files
    # only in specific virtual host or directory
    Order Deny,Allow
    Deny from all
</FilesMatch>
The above will help prevent one website from infecting another if one gets hacked (if all websites run as nobody they’ll all have write access to each other).

Run the W3TC compatibility check and install modules as necessary to best support W3TC for wordpress sites.