分类: LINUX
2010-04-15 16:17:28
在你安装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 |
三、使用root帐号登录系统,升级系统,建立一个专用文件夹,下载VHCS2最新版压缩包并解压。
host:~# mkdir downloads
host:~# cd downloads host:~# wget host:~# tar -xjvf vhcs-2.4.8.tar.bz2 |
在VHCS2中,某些模块在官方的更新源中是没有的,就需要引用一些其他的源来安装。安装这个模块,就可以方便得使用yum install来安装一些官方没有的功能模块。
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 |
(1)==》Auto-install the 1 mandatory module(s) from CPAN? [y] <--输入y回车
(2)Shall I follow them and prepend them to the queue of modules we are processing right now? [yes] <--输入yes回车
安装Term::ReadPassword:
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 |
更新最新PHP和MYSQL的方法见:
十一、为courier建立用户和用户组,当我们建立用户组的时候可能会提示已经建立了,如果有这个提示,可以忽略,跳过。
host:~# groupadd courier -g 3000
host:~# useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier |
(1)启动mysql服务器:
host:~# service mysqld start |
host:~# mysql_secure_installation |
在这里输入root用户的密码,如果您没设置密码,请直接回车。
(2)Change the root password? [Y/n]
是否更改root的密码,如果更改,就输入“y”,如果不更改,就输入“n”,更改root密码需要连续两次输入密码。
(3)Remove anonymous users? [Y/n]
是否删除mysql的匿名用户,删除选择“y”,不删除选择“n”,为了安全,建议删除匿名帐号。
(4)Disallow root login remotely? [Y/n]
是否允许root帐号远程登录,允许输入“y”,不允许输入“n”,建议不允许root远程登录。
(5)Remove test database and access to it? [Y/n]
是否删除测试数据库及对测试数据库的访问许可。建议输入“y”删除测试数据库。
(6)Reload privilege tables now? [Y/n]
重置数据表的权限,建议输入“y”执行本步。
十三、建立三个文件和文件夹,解决VHCS2对CentOS兼容性差的问题!
(1)建立/etc/proftpd文件夹:
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/* / |
十六、切换进入VHCS2安装目录,安装VHCS2,并根据提示问题进行输入和确认:
host:~# cd /var/www/vhcs2/engine/setup/
host:~# ./vhcs2-setup |
(2)Please enter system network address (Enter for defaults) [192.168.0.200]: -->直接回车
(3)Please enter SQL server host (Enter for defaults) [localhost]: -->直接回车
(4)Please enter system SQL database (Enter for defaults) [vhcs2]: -->直接回车
(5)Please enter system SQL user (Enter for defaults) [root]: -->直接回车
(6)Please enter system SQL password (Enter for defaults) [none]: -->输入MySQL的root用户的密码
(7)Please repeat system SQL password: -->重复输入密码,进行确认
(8)Please enter VHCS ftp SQL user (Enter for defaults) [vftp]: -->FTP的数据库连接用户,保持默认直接回车
(9)Please enter VHCS ftp SQL user password (Enter for defaults) [none]:输入FTP的数据库连接密码
(10)Please repeat VHCS ftp SQL user password: -->重复输入FTP的数据库连接密码
(11)Please enter administration login name (Enter for defaults) [admin]: -->输入VHCS管理员的用户名
(12)Please enter administrator password: -->输入VHCS管理员的密码
(13)Please repeat administrator password: -->重复输入VHCS管理员的密码,进行确认
(14)Please enter administrator email address: -->输入管理员的电子邮件地址
然后开始正式安装了,耐心等候,等待安装结束。
十七、重新编辑/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 |
VHCS2对proftpd的配置是错误的,这里需要纠正过来。
删除原来的proftpd.conf配置文件:
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 QuotaLimitTable sql:/get-quota-limit QuotaTallyTable sql:/get-quota-tally/update-quota-tally/insert-quota-tally Ratios on DelayEngine on ControlsEngine on ControlsMaxClients 2 ControlsLog /var/log/proftpd/controls.log ControlsInterval 5 ControlsSocket /var/run/proftpd/proftpd.sock AdminControlsEngine on AuthPAMConfig proftpd AuthOrder mod_sql.c SQLBackend mysql SQLAuthTypes Crypt SQLAuthenticate on SQLConnectInfo vhcs2@localhost vftp 111111111 SQLUserInfo ftp_users userid passwd uid gid homedir shell SQLGroupInfo ftp_group groupname gid members SQLMinUserUID 2000 SQLMinUserGID 2000 |
host:~# cd /etc/
host:~# rm -f proftpd.conf host:~# wget |
host:~# vi /etc/proftpd.conf |
[......] ServerName "host.hqtcn.me" <--这里把host.hqtcn.me替换成您的主机名 [......] SQLConnectInfo vhcs2@localhost vftp 111111 <-- 这里vhcs2是您的VHCS2数据库名,如果您默认不是vhcs2,修改成您的,vftp是您的ftp连接数据库的用户名,改成您的设置,后面的111111是您的vftp连接数据库的密码。 [......] |
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 |
界面的汉化请参看 中的第十二步。
至此,你可以从使用管理员密码使用了!!!