Chinaunix首页 | 论坛 | 博客
  • 博客访问: 224079
  • 博文数量: 86
  • 博客积分: 5030
  • 博客等级: 大校
  • 技术积分: 810
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-30 16:36
文章分类

全部博文(86)

文章存档

2010年(86)

我的朋友

分类: LINUX

2010-04-15 16:08:38

在redhat,fedora3,fedora4和centOS4.x上安装vhcs2的步骤:

1.装redhat系统时,对于新手来说,建议在装系统时选择everything,把所有的rpm包都装上。并且不要用启用SElinux
如果你是老鸟,那就另当别论了~ ~。

2.我建议用redhat的apt来安装,这样对于以后装其他的都容易点。

3.运行:apt-get install   php-pear php-imap php-gd ncftp \
                          bind libmcrypt libmcrypt-devel \
                          libmcrypt libmcrypt-devel \
                          libxslt-devel libjpeg-devel libpng-devel \
                          freetype-devel libc-client-devel php-imap \
                          php-snmp net-snmp-devel

4.修改/etc/fstab系统支持quota
例如:把LABEL=/    /    ext3     defaults     1 1修改成:
         LABEL=/    /    ext3     defaults,usrquota      1 1
# touch /aquota.user
# chmod 600 /aquota.user
# mount -o remount /
# quotacheck -avugm


5.安装ftp服务proftpd:

wget [url]ftp://ftp.ibiblio.org/pub/mirror[/url] ... oftpd-1.2.10.tar.gz
tar zxvf proftpd-1.2.10.tar.gz
mv proftpd-1.2.10 proftpd
cd /usr/local/proftpd
./configure \
--sysconfdir=/etc \
--localstatedir=/var \
--prefix=/usr \
--with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql \
--with-includes=/usr/include/mysql \
--with-libraries=/usr/lib/mysql
make
make install

6.redhat安装vhcs2时,一般都必须安装perl的一些模块:

# perl -MCPAN -e shell
After configuring CPAN ( multiple prompts ), install the following modules:
cpan> install MIME::Entity MIME:arser MIME::Base64 Crypt::CBC Crypt::Blowfish Term::ReadPassword

7.安装openssl-perl:
apt-get install openssl-perl*     #不安装的话,将会在安装courier时出现错误。


8.如果要自己重新编译安装php的话,使用下面命令:
cd /usr/local/
wget [url][/url]
tar xjvf php-4.3.10.tar.bz2
mv php-4.3.10 php
cd php
./configure \
--with-mysel --with-pgsql --with-mcrypt=/usr/lib \
--build=i386-redhat-linux --target=i386-redhat-linux-gnu \
--with-jpeg --with-openssl --with-png \
--with-pear --with-calendar --with-xml \
--with-ftp --with-freetype --with-bz2 --with-iconv \
--sysconfdir=/etc --mandir=/usr/share/man \
--enable-sockets --enable-calendar --enable-bcmath \
--enable-ctype --enable-exif --enable-filepro \
--enable-ftp --enable-memory-limit \
--enable-sigchild --enable-magic-quotes \
--enable-yp --enable-track-vars \
--with-apxs2=/usr/sbin/apxs
make  
make instal

也可以使用系统自己安装配置的php。


9.安装cyrus-sasl:

# cd /usr/local/
# wget [url]ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.20.tar.gz[/url]
# tar xvfz cyrus-sasl-2.1.20.tar.gz
# mv cyrus-sasl-2.1.20 cyrus-sasl
# cd cyrus-sasl
#./configure
# make                 
# make install
# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
# perl -pi.bak -e "s/saslauthd/auxprop/g" /usr/local/lib/sasl2/smtpd.conf

10.安装postfix服务:

# wget [url][/url] ... ostfix-2.2.1.tar.gz
# tar xvfz postfix-2.2.1.tar.gz
# mv postfix-2.2.1 /usr/local/postfix
# cd /usr/local/postfix
# make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/include/sasl" \
# AUXLIBS="-L/usr/local/lib -lsasl2"
# make
# make install

10.安装Courier-pop3d,imapd和authd:
# cd /usr/local/
# wget [url][/url] ... uthlib-0.55.tar.bz2
# tar xjvf courier-authlib-0.55.tar.bz2
# mv courier-authlib-0.55 courier-authlib
# cd /usr/local/courier-authlib
# ./configure --with-redhat --disable-root-check \
--with-mailuser=courier --with-mailgroup=courier
# make
# make install
# make install-configure
# groupadd courier

11.安装courier:

# useradd -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier
# cd /usr/local
# wget [url][/url] ... rier-0.49.0.tar.bz2
# tar xjvf courier-0.49.0.tar.bz2
# mv courier-0.49.0 courier
# cd /usr/local/courier
# ./configure --with-redhat --disable-root-check \
--with-mailuser=courier --with-mailgroup=courier \
--with-db=gdbm
# make
# make install
# make install-configure

12.做一些脚本的连接工作:

# echo 'su -c "/usr/lib/courier/share/sqwebmail/cleancache.pl" bin' >> /etc/cron.hourly/courier.cron
# touch /usr/local/etc/authlib/userdb
# chown daemon /usr/local/etc/authlib/userdb
# chgrp daemon /usr/local/etc/authlib/userdb
# chhmod 600 /usr/local/etc/authlib/userdb
# ln -s /usr/lib/courier/sbin/webmaild /etc/init.d
# echo '/usr/local/sbin/authdaemond start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/courier start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/pop3d start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/imapd start' >> /etc/rc.local

# ln -s /usr/libexec/postfix /usr/lib/postfix
# ln -s /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so /lib/
# cp -p /usr/local/courier/rfc822/rfc822.h /usr/local/include/

# service named start     #把bind启动起来
# ln -s /etc/httpd /etc/apache2
# adduser www-data    新建网站用户


13.修改$home/engine/vhcs2.conf文件:

SERVER_HOSTNAME =
BASE_SERVER_IP =
DATABASE_PASSWORD =
BIND_CONF_FILE = /usr/sbin/apachectl
BIND_DB_DIR = /var/named/
BIND_DB_DIR = /var/named/
APACHE_CMD = /etc/rc.d/init.d/httpd
APACHE_NAME = httpd
APACHE_LOG_DIR = /var/log/httpd
APACHE_USERS_LOG_DIR = /var/log/httpd/users
APACHE_BACKUP_LOG_DIR = /var/log/httpd/backup
APACHE_CONF_FILE = /etc/httpd/sites-available/vhcs2.conf
APACHE_USER = apache
APACHE_GROUP = apache
MTA_SASLDB_FILE = /etc/sasldb2
MTA_SASLDB_PASSWD2 = /usr/sbin/saslpasswd2
CMD_MAKEUSERDB = /usr/local/sbin/makeuserdb
CMD_NAMED = /etc/init.d/named
CMD_HTTPD = /etc/init.d/httpd
MAIL_TRAFF_LOG = maillog


14.tar xvjf vhcs2.4.tar.bz2 cd ./vhcs-2.4 make install


15.因为刚才将所有的文件生成到 /tmp/vhcs2下面了
cp -R /tmp/vhcs2/etc/* /etc/
cp -R /tmp/vhcs2/var/* /var/
cp -R /tmp/vhcs2/usr/* /usr/

改变MySQL的数据库管理员密码
mysqladmin -u root -p password "new password here"然后运行配置脚本
/var/www/vhcs2/engine/setup/vhcs2-setup会问你几个问题,如密码,IP等


16.编辑apache2的配置文件,将vhcs2.conf的配置包含进去
pico /etc/apache2/httpd.conf加到最后一行

Include /etc/apache2/sites-available/vhcs2.conf重新启动apache

/etc/init.d/apache2 restart9.将vhcs的服务加到启动脚本
update-rc.d vhcs2_daemon defaults update-rc.d vhcs2_network defaults

17.运行下面的命令:

echo 'include /etc/httpd/sites-available/vhcs2.conf' >> /etc/httpd/conf/httpd.conf
cd /etc/vhcs2/bind/parts/
cp -p cfg_entry.tpl cfg_entry.tpl.bak
perl -pi.bak -e "s/\{DB_DIR\}\/\{DMN_NAME\}\.db/\{DMN_NAME\}\.db/g" cfg_entry.tpl
perl -pi.bak -e "s/0700/0755/g" /var/www/vhcs2/engine/vhcs2-*

18.需要建立下面的脚本:/etc/init.d/vhcs2内容如下:

<------------------- CUT HERE---------------------->
#!/bin/bash
# description: Start or stop the vhcs2 daemon
#
### BEGIN INIT INFO
# Provides: vhcs2
# Required-Start: $network $syslog
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Start or stop the vhcs2 daemon
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

name='vhcs2'
lockfile=/var/lock/subsys/vhcs2
conffile=/etc/vhcs2/vhcs2.conf
pidfile=/var/run/vhcs2.pid
daemon=/var/www/vhcs2/daemon/vhcs2_daemon
name=vhcs2_daemon
RETVAL=0
start() {
         echo -n $"Starting $prog: "
         daemon "$daemon -p $pidfile"
         RETVAL=$?
         if ?"$RETVAL" = "0"; then
                 touch $lockfile
         fi
         echo
}
stop() {
         echo -n $"Stopping $prog: "
         killproc $daemon -TERM
         RETVAL=$?
         if ?"$RETVAL" = "0"; then
                 rm -f $lockfile
         fi
         echo
}

case "$1" in
'start')
         start
         ;;
'stop')
         stop
         ;;
'status')
         status $daemon
         ;;
'restart')
         stop
         start
         ;;
*)
         echo "Usage: $0 { start | stop | restart }"
         RETVAL=1
         ;;
esac

exit $RETVAL
<------------------- CUT HERE---------------------->


其实在redhat9,fedora3,fedora4和centOS4.x上安装都是很相似的,都可以按照上面的方法来做。

本人已经成功的在redhat9,fedora3,fedora4和centOS4.x成功的配置vhcs2这个开源的系统。

阅读(1028) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~