Once you know these few steps, setting up a LAMP (Linux/Apache/MySQL/Perl-PHP) server on a Linode (please use that link, as it includes my referral code) is insanely simple:
First, starting with a freshly provisioned CentOS install, ssh into the root account. First, update the base system –
# yum update
I find it convenient to also install the console version of emacs:
# yum install emacs-nox
Next, edit /etc/sysconfig/network and change the hostname. That file is read at boot, so you might also want to set the hostname for the current session:
# hostname www.example.com
Download the install.sh script from http://www.virtualmin.com/download.html into /usr/src … and then execute it:
# cd /usr/src
# wget http://software.virtualmin.com/gpl/scripts/install.sh
# sh install.sh
Then login, as root, to your new virtualmin configuration at your linode’s address: https://li99-999.members.linode.com:10000 where the 99-999 is replace with your linode’s address (see the linode control panel).
Clamd update problem
NOTE: After installing Virtualmin updates, I got an error:
ERROR: Command rejected by clamd (wrong clamd version?)
which I resolved with:
# /etc/rc.d/init.d/clamd-virtualmin restart
Default settings when you configure
System Settings / Server Templates
Default Settings
- Mail for Domain / Mail alias mode for alias domains: Copy aliases from target
- BIND DNS Domain / Hostname to your preferred world-visible hostname; SPF DNS disabled (until you configure each domain manually)
Update 2009-05-08
Killed clamd as it is a huge memory pig and leads to Out Of Memory webserver freezes!
Postfix was accepting email for anything@aliased-domain.com … to solve this, open the aliased sub domain in Virtualmin, and under:
Server Configuration
Email Settings
change:
Virtual server email-related settings
Mail aliases mode
from Catchall forwarding to Copy aliases from target. You probably want to change this on the System Settings / Server Templates / Default Settings for Sub-Servers page as well. If you have already created several domains, you can adjust this all at once:
# virtualmin modify-mail --alias-copy --all-domains
NOTE: Is there a bug in Virtualmin 3.68.gpl? I had to manually:
# cd /etc/postfix
# postmap virtual
# postfix reload
to force that to refresh.
Viewing Postfix Mail Queue
On main Virtualmin menu: System Information. Open up Status. Click on Postfix Mail Server.
Problems with installing: awstats
Ran into this error message after install, when clicking the “Check Your System” button –
The AWstats command /usr/share/awstats/wwwroot/cgi-bin/awstats.pl was not found on your system.
Complicated by the fact that “yum install awstats” said it was already installed. But where? “rpm -ql awstats” gives the answer… and then I just copied it as follows:
# mkdir -p /usr/share/awstats/wwwroot/cgi-bin
# cp -a /var/www/awstats/awstats.pl /usr/share/awstats/wwwroot/cgi-bin
Out of Memory? — Taming Apache
With the default settings, Apache can veer out of control and eat all available memory. In /etc/httpd/conf/httpd.conf, change as follows in the section shown:
# prefork MPM
# StartServers: number of server processes to start
# MinSpareServers: minimum number of server processes which are kept spare
# MaxSpareServers: maximum number of server processes which are kept spare
# ServerLimit: maximum value for MaxClients for the lifetime of the server
# MaxClients: maximum number of server processes allowed to start
# MaxRequestsPerChild: maximum number of requests a server process serves
# was: MaxSpareServers 20 ServerLimit 256 MaxClients 256 MaxRequestsPerChild 400
0
<IfModule prefork.c>
StartServers 8
MinSpareServers 5
MaxSpareServers 10
ServerLimit 64
MaxClients 64
MaxRequestsPerChild 400
</IfModule>