HowtoForge

Virtual Hosting Howto With Virtualmin On CentOS 5.1 - Page 2

Services To Disable

To enhance security and free system resources on the system we need to disable any services that are not required. You can run this script to do this for you.

 

Basics

We need to fix a few issues to prepare the system for configuration.

yum upgrade
alternatives --config mta
There are 2 programs which provide 'mta'.
Selection Command
-----------------------------------------------
1 /usr/sbin/sendmail.postfix
*+ 2 /usr/sbin/sendmail.sendmail
Enter to keep the current selection[+], or type selection number: 1
yum install caching-nameserver
yum install gcc cpp gcc-c++ automake automake14 automake15 automake16 automake17 openssl-devel subversion ncurses-devel -y

 

Configure Network Alias

cp /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth0:1

Modify the file /etc/sysconfig/network-scripts/ifcfg-eth0:1 to look like this:

DEVICE=eth0:1
BOOTPROTO=static
BROADCAST=192.168.1.255
IPADDR=192.168.1.6
NETMASK=255.255.255.0
NETWORK=192.168.1.0
ONBOOT=yes

 

Install Webmin / Virtualmin

wget http://www.webmin.com/jcameron-key.asc
rpm --import jcameron-key.asc
wget http://prdownloads.sourceforge.net/webadmin/webmin-1.390-1.noarch.rpm
rpm --checksig webmin-1.390-1.noarch.rpm
rpm -Uvh webmin-1.390-1.noarch.rpm

 

Initial Webmin Config

We need to secure webmin by editing /etc/webmin/miniserv.conf and make the following changes:

ssl=1
port=443
bind=192.168.1.6
#listen=10000
blockhost_failures=3
blockhost_time=120
blockuser_failures=3
blockuser_time=120
realm=cpanel
utmp=1

Install the webmin Tiger theme:

Install php-pear module:

Install virtualmin:

Remove unwanted modules Go to webmin ? webmin configuration ? delete and select the following:

Restart webmin:

service webmin restart

 

Configure Rpmforge Repo

rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm

NOTE: If you are using a different architecture check on https://rpmrepo.org/RPMforge/Using for the correct rpm

enabled = 0

 

Install Extra Required Packages

yum --enablerepo=rpmforge install clamav clamav-db clamav-milter clamd -y
wget http://www.topdog-software.com/files/clamav-milter.patch
patch /etc/init.d/clamav-milter < clamav-milter.patch
chkconfig --del clamd
freshclam
wget http://www.sanesecurity.co.uk/clamav/update_sanesecurity.txt -O /usr/local/bin/update_sanesecurity.sh
chmod +x /usr/local/bin/update_sanesecurity.sh
ln -s /usr/local/bin/update_sanesecurity.sh /etc/cron.hourly/
/usr/local/bin/update_sanesecurity.sh
yum --enablerepo=rpmforge install php-eaccelerator
yum --enablerepo=rpmforge upgrade spamassassin
yum --enablerepo=rpmforge install spamass-milter
perl -MCPAN -e 'install Mail::SPF'
perl -MCPAN -e 'install Mail::SPF::Query'
perl -MCPAN -e 'install Net::Ident'
perl -MCPAN -e 'install IP::Country::Fast'
perl -MCPAN -e 'install Mail::DomainKeys'
perl -MCPAN -e 'install Mail::DKIM'
yum --enablerepo=rpmforge install netpbm-progs ocrad gocr gifsicle giflib-utils giflib -y
svn co https://svn.own-hero.net/fuzzyocr/trunk/devel/
cd devel/
perl -MCPAN -e 'install String::Approx'
perl -MCPAN -e 'install Time::HiRes'
perl -MCPAN -e 'install Log::Agent'

cp -rv {FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/} /etc/mail/spamassassin
chcon -R system_u:object_r:etc_mail_t /etc/mail/spamassassin/{FuzzyOcr.cf,FuzzyOcr.scansets,FuzzyOcr.preps,FuzzyOcr.pm,FuzzyOcr.words,FuzzyOcr/}
wget http://www.gbnetwork.co.uk/mailscanner/FuzzyOcr.words -O /etc/mail/spamassassin/FuzzyOcr.words
yum --enablerepo=rpmforge install razor-agents -y
yum install php-imap
rpm -Uvh http://www.topdog-software.com/oss/roundcube/roundcube-0.1-rc2.noarch.rpm
wget http://imapproxy.org/downloads/up-imapproxy-1.2.6.tar.gz
rpmbuild -tb up-imapproxy-1.2.6.tar.gz
rpm -Uvh /usr/src/redhat/RPMS/i386/up-imapproxy-1.2.6-1.i386.rpm
chkconfig --level 345 httpd on
chkconfig --level 345 postfix on
chkconfig --level 345 spamassassin on
chkconfig --level 345 spamass-milter on
chkconfig --level 345 clamav-milter on
chkconfig --level 345 mysqld on
chkconfig --level 345 named on
chkconfig --level 345 vsftpd on
chkconfig --level 345 dovecot on
chkconfig --level 345 imapproxy on
Virtual Hosting Howto With Virtualmin On CentOS 5.1 - Page 2