分类: 系统运维
2013-04-07 08:51:31
在你安装VHCS2前请确认你注意到以下问题:
(1)请确认您使用的是CentOS 5.3
(2)你的服务器必须配置有完全合法的域名,或者这个域名可以被网络上的其他计算机识别。
(3)服务器的安装,请见教程:
(4)服务器的IP、子网掩码等设置,以(3)中的教程设置为范例,您可以自行修改成你的设置。CentOS 5.2/5.3的安装可以参考本站的
注意:服务器安装完成后,必须关闭防火墙和SELinux,设置后必须重启一次。本教程仅做测试研究之用,由于VHCS2对CentOS5的兼容性不是太好,不建议用做工业用途。
一、调整/etc/hosts
编辑/etc/hosts
host:~# vi /etc/hosts |
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 192.168.0.200 server.ispcpcn.com server ::1 localhost6.localdomain6 localhost6 |
host:~# mkdir downloads host:~# cd downloads host:~# wget host:~# tar -xjvf vhcs-2.4.8.tar.bz2 |
host:~# wget host:~# rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm host:~# rm -f rpmforge-release-0.3.6-1.el5.rf.i386.rpm host:~# yum update |
host:~# cd $HOME/downloads/vhcs* host:~# vi ./docs/centos-packages |
awstats bind bind-chroot bind-libs bind-utils bzip2 caching-nameserver chkrootkit clamav clamd clamav-db courier-authlib courier-authlib-userdb courier-imap cyrus-sasl cyrus-sasl-gssapi cyrus-sasl-plain cyrus-sasl-md5 cyrus-sasl-ntlm expect gcc httpd iptables libdbi-dbd-mysql libmcrypt libtool-ltdl redhat-lsb mod_perl mod_ssl mod_auth_mysql mysql mysql-server net-snmp-perl patch perl-Archive-Tar perl-Archive-Zip perl-BerkeleyDB perl-Bit-Vector perl-Carp-Clan perl-Compress-Zlib perl-Convert-TNEF perl-Convert-UUlib perl-Crypt-Blowfish perl-Crypt-CBC perl-Crypt-DH perl-Crypt-PasswdMD5 perl-Date-Calc perl-DateManip perl-DBD-MySQL perl-Digest-HMAC perl-HTML-Parser perl-HTML-Tagset perl-MIME-tools perl-IO-stringy perl-libwww-perl perl-MailTools perl-Net-CIDR-Lite perl-Net-DNS perl-Net-IP perl-Net-LibIDN perl-Net-Netmask perl-Net-Server perl-suidperl perl-TermReadKey perl-TimeDate perl-URI perl-Unix-Syslog perl-MailTools php php-bcmath php-dba php-gd php-ldap php-mbstring php-mcrypt php-mysql php-odbc php-pear php-snmp php-xml postfix proftpd proftpd-mysql rkhunter spamassassin system-config-bind tar unixODBC unzip wget |
host:~# cd $HOME/downloads/vhcs* host:~# yum install `cat ./docs/centos-packages` |
host:~# cpan |
Are you ready for manual configuration? [yes] no <--这里输入no然后回车确认 |
cpan> install MIME::Entity |
cpan> install Term::ReadPassword |
cpan> quit |
host:~# yum remove sendmail host:~# yum install redhat-lsb |
host:~# wget host:~# wget host:~# wget host:~# rpm -ivh courier-authlib-*.rpm courier-authlib-userdb-*.rpm courier-imap-*.rpm |
host:~# groupadd courier -g 3000 host:~# useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier |
host:~# service mysqld start |
host:~# mysql_secure_installation |
host:~# mkdir /etc/proftpd |
host:~# vi /etc/proftpd/proftpd.conf |
host:~# vi /etc/named.conf |
host:~# mkdir /var/mail/virtual |
host:~# cd $HOME/downloads/vhcs* host:~# make -f Makefile.centos5 install |
host:~# cp -RLf /tmp/vhcs-2.4.8/* / |
host:~# cd /var/www/vhcs2/engine/setup/ host:~# ./vhcs2-setup |
host:~# vi /etc/hosts |
# Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 localhost.localdomain localhost 192.168.0.200 server.ispcpcn.com server ::1 localhost6.localdomain6 localhost6 |
host:~# rm -f /etc/proftpd.conf |
host:~# vi /etc/proftpd.conf |
LoadModule mod_sql.c LoadModule mod_sql_mysql.c LoadModule mod_quotatab.c LoadModule mod_quotatab_file.c LoadModule mod_quotatab_sql.c UseIPv6 off ServerName "host.hqtcn.me" ServerType standalone DeferWelcome off MultilineRFC2228 on DefaultServer on ShowSymlinks on AllowOverwrite on UseReverseDNS off IdentLookups off AllowStoreRestart on AllowForeignAddress on LogFormat traff "%b %u" TimeoutLogin 120 TimeoutNoTransfer 600 TimeoutStalled 600 TimeoutIdle 1200 DisplayLogin welcome.msg DisplayChdir .message ListOptions "-l" DenyFilter \*.*/ DefaultRoot ~ Port 21 MaxInstances 30 User nobody Group nobody Umask 022 022 AllowOverwrite on HideNoAccess on IgnoreHidden on RootLogin off TransferLog /var/log/proftpd/xferlog ExtendedLog /var/log/proftpd/ftp_traff.log read,write traff PathDenyFilter "\.quota$" QuotaEngine on QuotaShowQuotas on QuotaDisplayUnits Mb SQLNamedQuery get-quota-limit SELECT "name, quota_type, per_session, limit_type, bytes_in_avail, bytes_out_avail, bytes_xfer_avail, files_in_avail, files_out_avail, files_xfer_avail FROM quotalimits WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery get-quota-tally SELECT "name, quota_type, bytes_in_used, bytes_out_used, bytes_xfer_used, files_in_used, files_out_used, files_xfer_used FROM quotatallies WHERE name = '%{0}' AND quota_type = '%{1}'" SQLNamedQuery update-quota-tally UPDATE "bytes_in_used = bytes_in_used + %{0}, bytes_out_used = bytes_out_used + %{1}, bytes_xfer_used = bytes_xfer_used + %{2}, files_in_used = files_in_used + %{3}, files_out_used = files_out_used + %{4}, files_xfer_used = files_xfer_used + %{5} WHERE name = '%{6}' AND quota_type = '%{7}'" quotatallies SQLNamedQuery insert-quota-tally INSERT "%{0}, %{1}, %{2}, %{3}, %{4}, %{5}, %{6}, %{7}" quotatallies QuotaLock /var/run/proftpd/tally.lock Ratios on DelayEngine on ControlsEngine on ControlsMaxClients 2 ControlsLog /var/log/proftpd/controls.log ControlsInterval 5 ControlsSocket /var/run/proftpd/proftpd.sock
|
host:~# cd /etc/ host:~# rm -f proftpd.conf host:~# wget |
host:~# vi /etc/proftpd.conf |
[......] |
host:~# chkconfig --add vhcs2_daemon host:~# chkconfig --levels 345 vhcs2_daemon on host:~# chkconfig --levels 235 httpd on host:~# chkconfig --levels 235 mysqld on host:~# chkconfig --levels 235 saslauthd on host:~# chkconfig --levels 235 proftpd on host:~# chkconfig --levels 235 named on |
host:~# shutdown -r now |