From: http://www.isp-control.net/documentation/doku.php?id=start:installation:centos
1.安装前准备
1.1确保Centos是最新的
以超级用户登路,先关闭fastestmirror
[root@server ~]# vi /etc/yum/pluginconf.d/fastestmirror.conf
设置 “enable=0”
[root@server ~]# cd /etc/yum.repos.d/
[root@server yum.repos.d]# wget http://mirrors.163.com/.help/CentOS-Base-163.repo
[root@server yum.repos.d]# yum makecache
[root@server yum.repos.d]# yum update
1.2 添加额外的软件源
Epel源(Extra Packages for Enterprise Linux)
[root@server yum.repos.d]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/i386/epel-release-5-3.noarch.rpm
[root@server yum.repos.d]# yum install foo
对于x86_64 位系统可以执行以下命令:
[root@server yum.repos.d]# rpm -Uvh http://download.fedora.redhat.com/pub/epel/5/x86_64/epel-release-5-3.noarch.rpm
[root@server yum.repos.d]# yum install foo
Les RPM de Remi源
[root@server yum.repos.d]# cd /etc/yum.repos.d
[root@server yum.repos.d]# wget http://rpms.famillecollet.com/remi-enterprise.repo
这个源里包含一些不需要的软件包,通过以下命令去掉它们
[root@server yum.repos.d]# vi /etc/yum.repos.d/remi-enterprise.repo
在[remi]段结尾,[remi-test]段之上添加一句
includepkgs=mysql* php* sqlite*
RPMForge 源
[root@server yum.repos.d]# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
x86_64系统可用下面命令
[root@server yum.repos.d]# rpm -Uhv http://apt.sw.be/redhat/el5/en/x86_64/rpmforge/RPMS//rpmforge-release-0.3.6-1.el5.rf.x86_64.rpm
[root@server yum.repos.d]# yum install foo
我们并不需要所有的RPMForge软件包,因为它会替换许多系统文件,故通过
[root@server yum.repos.d]# vi /etc/yum.repos.d/rpmforge.repo
在末尾加一句
includepkgs=postgrey
1.3 下载非库软件
先建立一个目录
[root@server yum.repos.d]# mkdir /root/tmp
[root@server yum.repos.d]# cd /root/tmp
Courier-IMAP
i386 (32-bit): [root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/i386/courier-imap-4.6.0-1.el5.mf.i386.rpm
[root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/i386/courier-authlib-0.62.4-1.el5.mf.i386.rpm
[root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/i386/courier-authlib-userdb-0.62.4-1.el5.mf.i386.rpm
x86_64 (64-bit): [root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/x86_64/courier-imap-4.6.0-1.el5.mf.x86_64.rpm
[root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/x86_64/courier-authlib-0.62.4-1.el5.mf.x86_64.rpm
[root@server tmp]# wget http://www.thatfleminggent.com/packages/centos/5/x86_64/courier-authlib-userdb-0.62.4-1.el5.mf.x86_64.rpm
policyd-weight
[root@server tmp]# wget http://downloads.sourceforge.net/project/policyd-weight/policyd-weight/0.1.15%20beta-3/policyd-weight-0.1.15dev3-1.noarch.rpm?use_mirror=ncu
1.4 禁用SELinux
[root@server tmp]# setenforce 0
1.5 下载并解压ispCp
[root@server tmp]# wget http://downloads.sourceforge.net/project/ispcp/ispCP%20Omega/ispCP%20Omega%201.0.3-1/ispcp-omega-1.0.3-1.tar.bz2?use_mirror=ncu
[root@server tmp]# tar jxvf ispcp-omega-1.0.3-1.tar.bz2
[root@server tmp]# cd ispcp-omega-1.0.3
安装ispCP-omega-1.0.3
[root@server ispcp-omega-1.0.3]# yum install `cat ./docs/CentOS/centos-packages` (x86_64位要排除32位的软件包vi /etc/yum.conf 在末尾加一句 exclude=*.i386 *.i586 *.i686 )
之后还必须要装Perl包
[root@server ispcp-omega-1.0.3]# perl -MCPAN -e 'install Term::ReadPassword' (提示是否要手动配置时输入no)
安装之前下载的Courier-IMAP、policyd-weight RPM包
[root@server ispcp-omega-1.0.3]# cd ..
[root@server tmp]# rpm -Uvh courier-*
[root@server tmp]# rpm -Uvh policyd-weight-*
1.6 移除不需要的软件包
[root@server tmp]# yum remove sendmail
1.7 配置服务
[root@server tmp]# groupadd -g 3000 courier
[root@server tmp]# useradd -u 3000 -c 'Courier Mail Server' -d /dev/null -g courier -d /bin/false courier
开启mySQL服务
[root@server tmp]# service mysqld start
配置mySQL,并且设置mySQL root用户的密码,注意这里配置了的话之后会用到
[root@server tmp]# mysql_secure_installation
清理Apache配置环境并且备份
[root@server tmp]# mv /etc/httpd/conf.d /etc/httpd/conf.d-disabled
1.8 BIND DNS配置
[root@server tmp]# mv /var/named/data /var/named/data-disabled
[root@server tmp]# ln -s /var/named/chroot/var/named/data /var/named/data
[root@server tmp]# echo 'include "/etc/named-ispcp.conf";' >> /var/named/chroot/etc/named.conf
2. 安装
2.1 确认设置
[root@server tmp]# cat /root/tmp/ispcp-omega-1.0.3/configs/centos/ispcp.conf
2.2 建立软件和安装到临时区域
[root@server tmp]# cd ispcp-omega-1.0.3
[root@server ispcp-omega-1.0.3]# make -f Makefile.centos
2.3 安装icpCP ω
[root@server ispcp-omega-1.0.3]# cp -RLf /tmp/ispcp/* /
[root@server ispcp-omega-1.0.3]# cd /var/www/ispcp/engine/setup
[root@server setup]# perl ispcp-setup
3. 安装后配置
3.1 Postfix and SASL Authentication
建立SASL 数据库
[root@server setup]# touch /etc/sasldb2
[root@server setup]# mkdir -p /var/spool/postfix/etc
[root@server setup]# cp /etc/sasldb2 /var/spool/postfix/etc
[root@server setup]# vi /usr/lib/sasl2/smtpd.conf
把下面文本写入smtpd.conf
pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5
3.2 配置 Apache HTTPd
[root@server setup]# echo 'include vhosts/*.conf' >> /etc/httpd/conf/httpd.conf
3.3 配置 Postgrey
[root@server setup]#vi /etc/init.d/postgrey
把这一行 OPTIONS="--unix=$SOCKET"
改为 OPTIONS="--unix=$SOCKET --inet=60000"
3.4 设置服务为自启动
chkconfig --level 345 httpd on
chkconfig --level 345 mysqld on
chkconfig --level 345 ispcp_network on
chkconfig --level 345 ispcp_daemon on
chkconfig --level 345 amavisd on
chkconfig --level 345 named on
chkconfig --level 345 proftpd on
chkconfig --level 345 postgrey on
chkconfig --level 345 spamassassin on
如果想不重启就启动服务输入以下命令
service httpd
startservice mysqld start
service ispcp_network start
service ispcp_daemon start
service amavisd start
service named start
service proftpd start
service postgrey start
service spamassassin start
3.5 清理权限
[root@server setup]# chmod 775 /var/www/ispcp/gui/phptmp
3.6 删除icpCPω临时环境
[root@server setup]# rm -R /tmp/ispcp
now enjoy it!