首页 > CentOS > Centos 5.5构建ispcp-omega-1.0.7 web服务器rpm版本v1.0 (by:cnfreebsd@163.com)
2011
01-11

Centos 5.5构建ispcp-omega-1.0.7 web服务器rpm版本v1.0 (by:cnfreebsd@163.com)

Centos 5.5构建ispcp-omega-1.0.7 web服务器rpm版本v1.0 (by:cnfreebsd@163.com)

2010/09/06
编译篇

Nginx配置为前端的Web服务器处理静态内容,而所有其他请求代理到Apache
为什么这样做?相对来说Apache 来处理php 等态网页更稳定。

Ispcp 是一个php的虚拟主机管理软件

费话不多说了开工

Rpm 包可以从这些网站下载。

http://rpm.pbone.net/

Centos http://mirror.centos.org/centos

http://centos.alt.ru/pub

webtatic http://repo.webtatic.com/yum/centos/5/SRPMS/

RHEL5 ftp://ftp.redhat.com/pub/redhat/linux/enterprise/5Server/en/os/SRPMS/

RHEL6 ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/

fedora http://download.fedora.redhat.com/pub/fedora/linux/releases/14/Fedora/source/SRPMS/

1. 软件包准备

Nginx

http://centos.alt.ru/pub/nginx/0.8/RHEL/SRPMS/nginx-stable-0.8.54-1.el5.src.rpm

PHP 5.3.2

http://repo.webtatic.com/yum/centos/5/SRPMS/php-5.3.2-1.src.rpm

Memcached

http://centos.alt.ru/pub/memcached/1.4.5/RHEL/SRPMS/memcached-1.4.5-1.el5.src.rpm

php-pecl-memcache

http://centos.alt.ru/pub/php-pecl-memcache/RHEL/SRPMS/php-pecl-memcache-3.0.5-1.el5.src.rpm

php-eaccelerator-0.9.6.1

http://centos.alt.ru/pub/php-eaccelerator/0.9.6.1/RHEL/SRPMS/php-eaccelerator-0.9.6.1-1.el5.src.rpm

MySQL-5.1.51()

http://mysql.ntu.edu.tw/Downloads/MySQL-5.1/

http://centos.alt.ru/pub/mysql/

Squid-3.0.STABLE25

http://centos.alt.ru/pub/squid/RHEL/SRPMS/squid-3.0.STABLE25-1.el5.src.rpm

Proftpd-1.3.3

http://centos.alt.ru/pub/proftpd/RHEL/SRPMS/proftpd-1.3.3d-1.el5.src.rpm

Bind-9.7.2-1.P3

http://centos.alt.ru/pub/bind/9.7.2-P3/SRPMS/bind-9.7.2-1.P3.el5.src.rpm

ispcp-omega-1.0.7

http://downloads.sourceforge.net/project/ispcp/ispCP%20Omega/ispCP%20Omega%201.0.7/ispcp-omega-1.0.7.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fispcp%2Ffiles%2FispCP%2520Omega%2FispCP%2520Omega%25201.0.7%2F&ts=1294282999&use_mirror=nchc

Courier-IMAP

http://www.courier-mta.org/download.php#imap

courier-0.65.2

https://sourceforge.net/projects/courier/files/courier/0.65.2/courier-0.65.2.tar.bz2/download

courier-authlib-0.63.0

https://sourceforge.net/projects/courier/files/authlib/0.63.0/courier-authlib-0.63.0.tar.bz2/download

courier-imap-4.8.1

https://sourceforge.net/projects/courier/files/imap/4.8.1/courier-imap-4.8.1.tar.bz2/download

maildrop-2.5.2

https://sourceforge.net/projects/courier/files/maildrop/2.5.2/maildrop-2.5.2.tar.bz2/download

postfix-2.7.2

http://postfix.it-austria.net/releases/official/postfix-2.7.2.tar.gz

policyd-weight-0.1.15

http://sourceforge.net/projects/policyd-weight/files/policyd-weight/0.1.15%20beta-3/policyd-weight-0.1.15dev3-1.src.rpm/download

2. 准备功夫

gcc-c++-4.1.2-46.el5_4.1

libgcc-4.1.2-46.el5_4.1

gcc-4.1.2-46.el5_4.1

make-3.81-3.el5

rpm-build-4.4.2.3-18.el5

先删除httpd,mysql,php

#yum remove httpd mysql php-*

使用yum 安装开发工具包

#yum –y install rpm-build gcc-c++ libgcc gcc make

也可以这样

#yum groupinstall "Development Tools"

这些基本的rpm 包构建环境

#wget ftp://ftp.redhat.com/pub/redhat/linux/enterprise/6Server/en/os/SRPMS/perl-5.10.1-115.el6.src.rpm

在windows 用7zip 把它解出来的文件上传到你的服务器上,这样就是方便不用升级rpm

查看一下rpm 版本

# rpm --version
RPM version 4.4.2.3

RHEL6.0 的rpm版本是4.8.0我们用的是RHEL 6.0 的包当然要先解压了,哈哈,不然你安装包会提示

warning: perl-5.10.1-115.el6.src.rpm: Header V3 RSA/SHA256 signature: NOKEY, key ID fd431d51

1:perl                   warning: user mockbuild does not exist - using root

warning: group mockbuild does not exist - using root

########################################### [100%]

error: unpacking of archive failed on file /usr/src/redhat/SOURCES/filter-requires.sh;4d2e89d8: cpio: MD5 sum mismatch

当然你可以升级rpm

# cp * /usr/src/redhat/SOURCES/
# cp perl.spec /usr/src/redhat/SPECS/
# cd /usr/src/redhat/SPECS/
# rpmbuild -bb perl.spec
error: Failed build dependencies:

rsyslog is needed by perl-5.10.1-115.i386

提示要安装 rsyslog 我们就安装一下

# yum -y install rsyslog

再重复上面的编译最后生成了我们要的perl

等编译完成我们再把perl 5.8.8升级到新编译的perl-5.10

安装中间可以用这个方法比较简单perl
我们进入编译安装目录

# cd /usr/src/redhat/RPMS/i386/
# createrepo .
# vi /etc/yum.repos.d/CentOS-Media.repo

在Baseurl= 后面添加一个
file:///usr/src/redhat/RPMS/i386/

# yum --disablerepo=\* --enablerepo=c5-media update perl perl-devel

然后就成功安装了perl-5.10.1
查看一下版本

# perl -v

This is perl, v5.10.1 (*) built for i386-linux-thread-multi

Copyright 1987-2009, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

安装完了,再把perl-CPAN-1.9402-115.i386.rpm 安装一下

# rpm -ivh /usr/src/redhat/RPMS/i386/perl-CPAN-1.9402-115.i386.rpm

3. 编译 Nginx

# rpm -ivh nginx-0.8.54-1.el5.src.rpm

相依赖的开发包有:
pcre-devel,zlib-devel,openssl-devel,perl(ExtUtils::Embed)

如果没有请先yum下来吧:

# yum install pcre-devel zlib-devel openssl-devel
# cd /usr/src/redhat/SPECS
# rpmbuild -ba nginx.spec

编译完成生成的安装成在
/usr/src/redhat/RPMS/i386

nginx-0.8.54-1.i386.rpm

4.编译Apache 2.2.17

[root@localhost SPECS]# rpmbuild -ba httpd.spec
error: Failed build dependencies:
        db4-devel is needed by httpd-2.2.17-1.i386
        expat-devel is needed by httpd-2.2.17-1.i386
        apr-devel >= 1.2.0 is needed by httpd-2.2.17-1.i386
        apr-util-devel >= 1.2.0 is needed by httpd-2.2.17-1.i386
        distcache-devel is needed by httpd-2.2.17-1.i386

缺少包我们来安装一下

# yum -y install db4-devel expat-devel apr-devel apr-util-devel distcache-devel

# cd /usr/src/redhat/RPMS/i386
# rpm –ivh httpd-tools-2.2.17-1.i386.rpm
# rpm –ivh httpd-2.2.17-1.i386.rpm
# rpm –ivh httpd-devel-2.2.17-1.i386.rpm
# rpm –ivh httpd-manual-2.2.17-1.i386.rpm
# rpm –ivh mod_ssl-2.2.17-1.i386.rpm

再安装mod_fcgid-2.3.6

# wget ftp://ftp.pbone.net/mirror/archive.fedoraproject.org/fedora/linux/updates/12/SRPMS/mod_fcgid-2.3.6-1.fc12.src.rpm

这个同样要在windows 用7zip 解压,然后上传到服务器,参考编译perl

# rpmbuild -bb mod_fcgid.spec

编译成功生成 mod_fcgid-2.3.6-1.i386.rpm

编译mod_rpaf-0.6

# wget ftp://ftp.pbone.net/mirror/cachalot.mine.nu/unmaintained/mod_rpaf-0.6-0.1.fc8.src.rpm
# rpm -ivh mod_rpaf-0.6-0.1.fc8.src.rpm
# cd /usr/src/redhat/SPECS
# rpmbuild -bb mod_rpaf.spec

编译成功生成mod_rpaf-0.6-0.1.i386.rpm

然后安装一下。

# rpm -ivh mod_fcgid-2.3.6-1.i386.rpm
# rpm -ivh mod_rpaf-0.6-0.1.i386.rpm

我们把fcgid.conf 个名,因为我们安装ispcp 的时候选的是fcgid 避免重复加载

# mv /etc/httpd/conf.d/fcgid.conf /etc/httpd/conf.d/fcgid.conf_bak

5.编译MySQL(注意:这里不想用yum 自带的MySQL 就要先编译安装)

# rpm –ivh MySQL-5.1.51-1.glibc23.src.rpm
# cd /usr/src/redhat/SPECS
# vi mysql-5.1.51.spec


%define EMBEDDED_BUILD 1
改成来不编译嵌入式
%define EMBEDDED_BUILD 0

要注意的是把
Name: MySQL
改成
Name: mysql

# rpmbuild –ba mysql-5.1.51.spec

# cd /usr/src/redhat/RPMS/i386
# rpm –ivh mysql-shared-5.1.51-1.glibc23.i386.rpm
# rpm –ivh mysql-client-5.1.51-1.glibc23.i386.rpm
# rpm –ivh mysql-server-5.1.51-1.glibc23.i386.rpm

注意:这里链接一下是为了以后的编译工作

# ln -s /usr/lib/libmysqlclient.so /usr/lib/mysql/libmysqlclient.so

编译完成安装一下就好了。

启动mysql 的时候会出个错,
Starting MySQL……..Manager of pid-file quit without upda[FAILED]e.
禁止SELinux 就可以了。

临时关闭一下SELinue

# setenforce 0

永久关闭SELinue
编辑

# vi /etc/selinux/config

把SELINUX=enforcing
改成
SELINUX=disabled

5. 编译 PHP 5.3.2-1

# rpm -ivh php-5.3.2-1.src.rpm
# cd /usr/src/redhat/SPECS/

找到php.spec

添加一个 php-mhash php-readline模块(注:你的php-xx/ext/ 下面一定要有 mhash, readline )
找到
–with-mcrypt=shared,%{_prefix} \

在后面加
–with-mhash=shared,%{_prefix} \
–with-readline=shared,%{_prefix} \

再找到
mcrypt tidy pdo_dblib mssql pspell curl wddx \
改成
mcrypt mhash readline tidy pdo_dblib mssql pspell curl wddx \

找到
%files mcrypt -f files.mcrypt
在后面添加一个mhash
%files mhash -f files.mhash
%files readline -f files.readline

当然也可以注释build-embedded 和build-zts 以及不用的模块可以减少编译时间,这里我就不贴了,相关的注释的代码太多了。

这322行 support for using the mcrypt library to PHP.
在后面加入

%package mhash
Summary: Standard PHP module provides mhash support
Group: Development/Languages
Requires: php >= %{version}, php-api = %{apiver}
BuildRequires: mhash-devel

%description mhash
Standard PHP module provides mhash support

%package readline
Summary: Standard PHP module provides readline library support
Group: Development/Languages
Requires: php >= %{version}, php-api = %{apiver}
BuildRequires: readline-devel

%description readline
Standard PHP module provides readline library support
[root@localhost SPECS]# rpmbuild -bb php.spec
error: Failed build dependencies:
        bzip2-devel is needed by php-5.3.2-1.i386
        curl-devel >= 7.9 is needed by php-5.3.2-1.i386
        gmp-devel is needed by php-5.3.2-1.i386
        httpd-devel >= 2.0.46-1 is needed by php-5.3.2-1.i386
        pam-devel is needed by php-5.3.2-1.i386
        sqlite-devel >= 3.0.0 is needed by php-5.3.2-1.i386
        readline-devel is needed by php-5.3.2-1.i386
        libc-client-devel is needed by php-5.3.2-1.i386
        mysql-devel >= 4.1.0 is needed by php-5.3.2-1.i386
        postgresql-devel is needed by php-5.3.2-1.i386
        unixODBC-devel is needed by php-5.3.2-1.i386
        libxml2-devel is needed by php-5.3.2-1.i386
        net-snmp-devel is needed by php-5.3.2-1.i386
        libxslt-devel >= 1.0.18-1 is needed by php-5.3.2-1.i386
        libxml2-devel >= 2.4.14-1 is needed by php-5.3.2-1.i386
        libXpm-devel is needed by php-5.3.2-1.i386
        libjpeg-devel is needed by php-5.3.2-1.i386
        libpng-devel is needed by php-5.3.2-1.i386
        freetype-devel is needed by php-5.3.2-1.i386
        libmcrypt-devel is needed by php-5.3.2-1.i386
        libtidy-devel is needed by php-5.3.2-1.i386
        freetds-devel is needed by php-5.3.2-1.i386
        aspell-devel >= 0.50.0 is needed by php-5.3.2-1.i386
        recode-devel is needed by php-5.3.2-1.i386
        libicu-devel >= 3.6 is needed by php-5.3.2-1.i386

一大堆依赖的包我们先把它下载下来,httpd-devel、mysql-devel就不用安装了,我们编译好了直接安装上就OK。

yum install -y bzip2-devel curl-devel gmp-devel aspell-devel libjpeg-devel libpng-devel pam-devel openssl-devel sqlite-devel zlib-devel pcre-devel krb5-devel libc-client-devel cyrus-sasl-devel openldap-devel postgresql-devel unixODBC-devel libxml2-devel net-snmp-devel libxslt-devel libxml2-devel gd-devel freetype-devel readline-devel libmcrypt-devel libtidy-devel freetds-devel recode-devel libicu-devel mhash-devel

编译完成
php-5.3.2-1.i386.rpm
php-bcmath-5.3.2-1.i386.rpm
php-cli-5.3.2-1.i386.rpm
php-common-5.3.2-1.i386.rpm
php-dba-5.3.2-1.i386.rpm
php-devel-5.3.2-1.i386.rpm
php-embedded-5.3.2-1.i386.rpm
php-gd-5.3.2-1.i386.rpm
php-imap-5.3.2-1.i386.rpm
php-intl-5.3.2-1.i386.rpm
php-ldap-5.3.2-1.i386.rpm
php-mbstring-5.3.2-1.i386.rpm
php-mcrypt-5.3.2-1.i386.rpm
php-mhash-5.3.2-1.i386.rpm
php-readline-5.3.2-1.i386.rpm
php-mssql-5.3.2-1.i386.rpm
php-mysql-5.3.2-1.i386.rpm
php-odbc-5.3.2-1.i386.rpm
php-pdo-5.3.2-1.i386.rpm
php-pgsql-5.3.2-1.i386.rpm
php-process-5.3.2-1.i386.rpm
php-pspell-5.3.2-1.i386.rpm
php-recode-5.3.2-1.i386.rpm
php-snmp-5.3.2-1.i386.rpm
php-soap-5.3.2-1.i386.rpm
php-tidy-5.3.2-1.i386.rpm
php-xml-5.3.2-1.i386.rpm
php-xmlrpc-5.3.2-1.i386.rpm

我先安装php-common php-cli php php-devel 以便我们完成以下的编译工作

6.编译Memcached-1.4.5

# rpm -ivh memcached-1.4.5-1.el5.src.rpm
# rpmbuild memcached.spec

error: Failed build dependencies:
libevent-devel is needed by memcached-1.4.5-1.i386

把相依性安装

# yum -y install libevent-devel

# rpmbuild -bb memcached.spec

编译完成
memcached-1.4.2-1.i386.rpm
memcached-devel-1.4.2-1.i386.rpm

7.编译php-pecl-memcache 2.25

# rpm -ivh php-pecl-memcache-3.0.5-1.el5.src.rpm
# rpmbuild -bb php-pecl-memcache.spec

error: Failed build dependencies:
php-pear is needed by php-pecl-memcache-2.2.5-2.i386

# yum -y install php-pear

在php5.3如果出现这样的错
+ : Assigning the return value of new by reference is deprecated in Command.php on line 154
/var/tmp/rpm-tmp.36059: line 93: syntax error near unexpected token `(‘
error: Bad exit status from /var/tmp/rpm-tmp.36059 (%install)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.36059 (%install)

先删除系统中的php-pear

# yum remove php-pear
# wget http://centos.alt.ru/pub/php-pear/RHEL/SRPMS/php-pear-1.9.1-1.el5.src.rpm
# rpm –ivh php-pear-1.9.1-1.el5.src.rpm
# rpmbuild -bb php-pear.spec

error: Failed build dependencies:
php-xml is needed by php-pear-1.9.1-1.noarch

先安装一下php-xml-5.3.2

# rpm -ivh php-xml-5.3.2-1.i386.rpm

然后再编译就成功了
生成的包在
/usr/src/redhat/RPMS/noarch

rpm -ivh php-pear-1.9.1-1.noarch.rpm

然后就可以编译成功了
编译完成生成
php-pecl-memcache-2.2.5-1.i386.rpm

8.编译php-eaccelerator-0.9.6.1

# rpm -ivh php-eaccelerator-0.9.6.1-1.el5.src.rpm

看看相依性
BuildRequires: php, php-devel
BuildRequires: autoconf, automake, libtool
编译

# rpmbuild -bb php-eaccelerator.spec

编译完成生成
php-eaccelerator-0.9.6.1-1.i386.rpm

9.编译squid 3.0

# rpmbuild -bb squid.spec

error: Failed build dependencies:
linuxdoc-tools is needed by squid-3.0.STABLE25-1.i386

# yum -y install linuxdoc-tools

编译完成生成
squid-3.0.STABLE25-1.i386.rpm

10.编译Proftpd-1.3.3

# rpmbuild -bb proftpd.spec

error: Failed build dependencies:
ncurses-devel is needed by proftpd-1.3.3d-1.i386
libacl-devel is needed by proftpd-1.3.3d-1.i386
libcap-devel is needed by proftpd-1.3.3d-1.i386

# yum -y install ncurses-devel libacl-devel libcap-devel

编译完成生成
proftpd-1.3.3d-1.i386.rpm
proftpd-ldap-1.3.3d-1.i386.rpm
proftpd-mysql-1.3.3d-1.i386.rpm
proftpd-postgresql-1.3.3d-1.i386.rpm

11. Bind 9.7.2

# rpmbuild -bb bind.spec

开始编译了慢慢等结果吧…
编译完成生成以下包
bind-9.7.2-1.P3.i386.rpm
bind-pkcs11-9.7.2-1.P3.i386.rpm
bind-sdb-9.7.2-1.P3.i386.rpm
bind-libs-9.7.2-1.P3.i386.rpm
bind-utils-9.7.2-1.P3.i386.rpm
bind-devel-9.7.2-1.P3.i386.rpm
bind-chroot-9.7.2-1.P3.i386.rpm

下面就是安装了.

12. 构建postfix-2.7.2.tar.gz rpm安装包

Postfix 源码包是不带 spec 文件的,我们怎么办呢,从2.3.2的版本复制一个要做修改才可以编译成功
到时候我会把srpm放到镜像站点上的。

# rpmbuild -bb postfix.spec

error: Failed build dependencies:
db4-devel is needed by postfix-2.7.2-1.i386

# yum -y install db4-devel

编译成功生成

13. 构建courier-authlib-0.63.0.tar.bz2 rpm 安装包

# cp courier-authlib-0.63.0.tar.bz2 /usr/src/redhat/SOURCES
# tar xf courier-authlib-0.63.0.tar.bz2 -C /usr/tmp/
# rpmbuild -bs courier-authlib.spec

如果有提示有包没有安装就yum 安装一下

# yum -y install openldap-devel redhat-rpm-config libtool-ltdl-devel

14. 构建courier-0.65.2.tar.bz2 rpm 安装包

# rpm -ivh /usr/ src/redhat/RPMS/i386/courier-authlib-0.63.0-1.i386.rpm
# rpm -ivh /usr/ src/redhat/RPMS/i386/courier-authlib-devel-0.63.0-1.i386.rpm
# cp courier-0.65.2.tar.bz2 /usr/src/redhat/SOURCES
# tar xf courier-0.65.2.tar.bz2 -C /usr/tmp/
# rpmbuild -bs courier.spec

error: Failed build dependencies:
/usr/include/fam.h is needed by courier-0.65.2-1.i386
/usr/bin/certtool is needed by courier-0.65.2-1.i386

安装一下再编译ok

# yum -y install gnutls-utils gamin-devel openssl-perl

编译中间错误提示
configure: WARNING: === Do not compile Courier as root. Compile
configure: WARNING: === Courier as a non-root user then su to
configure: WARNING: === root before running make install. You must now
configure: WARNING: === remove this entire directory and then extract the
configure: WARNING: === source code from the tarball as a non-root user
configure: WARNING: === and rerun the configure script. If you have read
configure: WARNING: === the INSTALL file you should have known this. So
configure: WARNING: === you better read INSTALL again
configure: error: aborted.
error: Bad exit status from /var/tmp/rpm-tmp.77978 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.77978 (%prep)

提示我们不要用root 编译
我们新建个用户,然后加入编译目录的权限

# useradd user1
# chown -R user1:root /usr/src/redhat

然后就可以编译了

15. 构建 courier-imap-4.8.1.tar.bz2 rpm安装包

编译请参考13. 从courier-0.65.2.tar.bz2 从构建rpm 安装包
中间也会提示不能用root 用户
configure: WARNING: === Do not compile Courier-IMAP as root. Compile
configure: WARNING: === Courier-IMAP as a non-root user then su to
configure: WARNING: === root before running make install. You must now
configure: WARNING: === remove this entire directory and then extract the
configure: WARNING: === source code from the tarball as a non-root user
configure: WARNING: === and rerun the configure script. If you have read
configure: WARNING: === the INSTALL file you should have known this. So
configure: WARNING: === you better read INSTALL again.
configure: error: aborted.
error: Bad exit status from /var/tmp/rpm-tmp.74181 (%prep)

RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.74181 (%prep)

我们再切换到 user1 用户

# su user1
$ rpmbuild -bb courier-imap.spec

编译成功
maildrop-2.5.2编译没有错,我们就略过…

16. 编译ispcp-omega-1.0.7.tar.bz2

# tar xf ispcp-omega-1.0.7.tar.bz2
# cd ispcp-omega-1.0.7/
# make -f Makefile.centos

编译完成后再复制文件到根目录

# cp -RLf /tmp/ispcp/* /

然后再进入目录安装

# cd /var/www/ispcp/engine/setup
# perl ispcp-setup

[FATAL] Module [MIME::Parser] WAS NOT FOUND !

[FATAL] Module [Crypt::Blowfish] WAS NOT FOUND !

[FATAL] Module [Net::LibIDN] WAS NOT FOUND !

[FATAL] Module [Crypt::PasswdMD5] WAS NOT FOUND !

[FATAL] Module [HTML::Entities] WAS NOT FOUND !

[FATAL] Module [MIME::Entity] WAS NOT FOUND !

[FATAL] Module [DBI] WAS NOT FOUND !

[FATAL] Module [Term::ReadPassword] WAS NOT FOUND !

[FATAL] Module [Crypt::CBC] WAS NOT FOUND !

[FATAL] Module [DBD::mysql] WAS NOT FOUND !

[FATAL] Module [File::Copy::Recursive] WAS NOT FOUND !

Modules [MIME::Parser, Crypt::Blowfish, Net::LibIDN, Crypt::PasswdMD5, HTML::Entities, MIME::Entity, DBI, Term::ReadPassword, Crypt::CBC, DBD::mysql, File::Copy::Recursive] WAS NOT FOUND in your system...

以上是提示有些模块没有安装,我们安装一下就好Perl 的CPAN 是很强大的,我们这里就不必用rpm 来安装,太麻烦。

我们先把libidn-devel安装以供Net::LibIDN模块的需要

# yum -y install libidn-devel

然后来安装我们的perl 模块吧,要安装好久,中间的提示直接回车就行了。
安装Term::ReadPassword的时候提示我们输入密码你设置个密码就行了。

# perl -MCPAN -e 'install "YAML"'
# perl -MCPAN -e 'install DateTime'
# perl -MCPAN -e 'force ("install","MIME::Entity");'
# perl -MCPAN -e 'install Crypt::Blowfish'
# perl -MCPAN -e 'install Net::LibIDN'
# perl -MCPAN -e 'install Crypt::PasswdMD5'
# perl -MCPAN -e 'install HTML::Entities'
# perl -MCPAN -e 'install "DBI"'
# perl -MCPAN -e 'install Term::ReadPassword'
# perl -MCPAN -e 'install Crypt::CBC'
# perl -MCPAN -e 'install DBD::mysql'
# perl -MCPAN -e 'install File::Copy::Recursive'
# perl -MCPAN -e 'install File::MimeInfo::Magic'
# perl -MCPAN -e 'install "Term::ReadKey"'

在安装MIME::Entity 我们用了强行安装,如果不强行安装在测试的过程中会安装失败
注意我们安装了MIME::Entity等于安装了MIME::Parser 因为它们都是 MIME-tools 这个包里的

然后再安装
# perl ispcp-setup

注意中间有auto generate 字样的最好手动输入密码

        Welcome to ispCP '1.0.7 OMEGA' Setup Dialog.

        This program will set up ispCP OMEGA system on your server.

        Next you are asked to enter a "fully qualified hostname" (FQHN).
        For more infos read http://en.wikipedia.org/wiki/FQDN.


        Please enter a fully qualified hostname [localhost.localdomain]: host1.mydoop.com

        Please enter the system network address [192.168.0.249]: 192.168.0.249	<-本机IP

        Please enter the domain name where ispCP OMEGA will be
        reachable on [admin.localhost.localdomain]: ispcp.mydoop.com	<-管理域名

        Please enter SQL server hostname [localhost]:

        Please enter ispCP OMEGA SQL database name [ispcp]:

        Please enter ispCP OMEGA SQL user name [root]:

        Please enter ispCP OMEGA SQL password [none]:

        Please repeat ispCP OMEGA SQL password:

        Please enter ispCP FTP SQL user [vftp]:

        Please enter ispCP OMEGA FTP SQL user password [auto generate]:

        Please repeat ispCP OMEGA ftp SQL user password:

        Please enter ispCP OMEGA PMA control user [pma]:

        Please enter ispCP OMEGA PMA control user password [auto
        generate]:

        Please repeat ispCP OMEGA PMA control user password:

        Please enter administrator login name [admin]:

        Please enter administrator password:	<-这里密码一定要复杂要过8位

        Please repeat administrator password:

        Please enter administrator e-mail address: cnfreebsd@163.com	<-这里写上你的Mail

        Secondary DNS server address IP (optional) []: 202.96.128.86	<-这里写上外网DNS

        Do you want allow the system resolver to use the local
        nameserver? [Y/n]: y

        Use MySQL Prefix? Possible values: [i]nfront, [b]ehind, [n]one.
        [none]:

        Please select a Fast CGI module: [f]cgid or fast[c]gi. [fcgid]:	<-这是fcgid

        Please enter Server's Timezone [Asia/Shanghai]:

        Should AWStats be activated? [no]:


                The program is now ready to set up ispCP on your system.
        Do you want to continue? [Y/n]: y

        Starting ispCP installation
         * Stopping all services: .........                            [ Done ]

        System checks
         * Mysql server connection:                                    [ Done ]

        Services setup
         * ispCP users and groups:                                     [ Done ]
         * ispCP directories:                                          [ Done ]
         * ispCP main configuration file:                              [ Done ]
         * ispCP database:                                             [ Done ]
         * ispCP default language table:                               [ Done ]
         * ispCP default SQL data:                                     [ Done ]
         * ispCP system hosts file:                                    [ Done ]
         * ispCP system resolver:                                      [ Done ]
         * ispCP crontab file:                                         [ Done ]
         * ispCP Bind9 main configuration file:                        [ Done ]
         * ispCP Apache fastCGI modules configuration:                 [ Done ]
         * ispCP Apache main vhost file:                               [ Done ]
         * ispCP Apache AWStats vhost file:                            [ Done ]
         * ispCP Postfix configuration files:                          [ Done ]
         * ispCP Courier-Authentication:                               [ Done ]
         * ispCP ProFTPd configuration file:                           [ Done ]
         * ispCP init scripts:                                         [ Done ]

        GUI setup
         * ispCP GUI Bind9 configuration:                              [ Done ]
         * ispCP GUI fastCGI/PHP configuration:                        [ Done ]
         * ispCP GUI vhost file:                                       [ Done ]
         * ispCP PMA configuration file:                               [ Done ]


        Permissions setup
         * Set engine permissions:                                     [ Done ]
         * Set gui permissions:                                        [ Done ]

        Finishing installation
         * Starting all services: .........                            [ Done ]

        Additional tasks
         * ispCP Rkhunter configuration:                               [ Done ]
         * ispCP System cleanup:                                       [ Done ]

        Congratulations you installed ispCP '1.0.7 OMEGA' successfully!

        Please type http://ispcp.mydoop.com in your browser and
        log in with your Administrator Account to use ispCP.

已成功安装!!

然后打开看一下,http://ispcp.mydoop.com 或 http://192.168.0.249

两个警告,看来是权限不够,设置一下

# chmod 664 /var/www/ispcp/gui/include/ispcp-db-keys.php

再刷新一下,看看
当然最后可能你会发现有个问题是,为什么打开一次ispcp 就打不开第二个页面了。
呵呵,这个简单
找到文件
/etc/httpd/vhosts/00_master.conf

# php_admin_value open_basedir “/var/www/ispcp/gui/:/etc/ispcp/:/var/run/ispcp.lock:/proc/:/bin/df:/bin/mount:/var/log/rkhunter/rkhunter.log:/var/log/chkrootkit.log:/usr/share/pear/”

# sed -i -e "s/php_admin_value open_basedir/#php_admin_value open_basedir/g" /etc/httpd/vhosts/00_master.conf

这一行注释了,再重起一下httpd 就可以了。

再配置一下我们的服务

# chkconfig --level 345 mysql on
# chkconfig --level 345 nginx on
# chkconfig --level 345 httpd on
# chkconfig --level 345 proftpd on
# chkconfig --level 345 memcached on
# chkconfig --level 345 named on
# chkconfig --level 345 squid on
# chkconfig --level 345 ispcp_daemon on
# chkconfig --level 345 ispcp_network on

好了ispcp安装算完工了,主要是在安装perl 和模块的时候可能要些时间
如果要修改 ispcp 访问ip 修改以下两个文件就行了
/etc/httpd/vhosts/00_master.conf -> VirtualHost
/etc/ispcp/ispcp.conf -> BASE_SERVER_IP

修改完成后重起一下 httpd,ispcp_daemon 服务
安装算是完成了!前些时间太忙了,一直没有补充上去。

最后编辑:
作者:dnybz
这个作者貌似有点懒,什么都没有留下。