Chinaunix首页 | 论坛 | 博客
  • 博客访问: 7656415
  • 博文数量: 1770
  • 博客积分: 18684
  • 博客等级: 上将
  • 技术积分: 16357
  • 用 户 组: 普通用户
  • 注册时间: 2010-06-02 10:28
个人简介

啥也没写

文章分类

全部博文(1770)

文章存档

2024年(15)

2023年(44)

2022年(39)

2021年(46)

2020年(43)

2019年(27)

2018年(44)

2017年(50)

2016年(47)

2015年(15)

2014年(21)

2013年(43)

2012年(143)

2011年(228)

2010年(263)

2009年(384)

2008年(246)

2007年(30)

2006年(38)

2005年(2)

2004年(1)

分类: LINUX

2009-09-27 20:26:42

IspCP Omega 简单介绍:
IspCP 是作为另一款开源虚拟主机管理系统VHCS2的替代产品,采用Apache2+PHP5(fastcgi模式,支持每个虚机独立的 php.ini)+MySQL5(提供内置的phpmyadmin)提供 Web 服务(也支持传统的 CGI),FTP 采用 Proftpd(也支持 webftp 功能),邮件是 postfix+courier+squirrermail,和 IspCPH管理平台(PHP 代码,支持管理员、代理商、虚拟主机用户三级用户,相互之间可以自由切换,自由增加子域名、FTP、MySQL、Mail 账号),另外对于每个虚拟主机都有独立的每天完整备份机制(可以用 FTP 下载)。

系统:CentOS5.2,无桌面,安装开发工具,开发库

一、禁用SELinux
# vi /etc/selinux/config

SELINUX=enforcing
修改为
SELINUX=disabled

# vi /etc/sysconfig/network
将HOSTNAME修改为
HOSTNAME=test.test.com

iptables没必要禁了,ispCP安装好后,会生成防火墙规则,并启用iptables

重启系统
# init 6

二、安装ispCP所需基本软件
1、下载ispcp-omega:
# mkdir /root/download
# cd /root/download
# wget
# tar xzf ispcp-omega-1.0.0.tar.gz
# cd ispcp-omega-1.0.0

2、安装rpm包:
# yum install `cat ./docs/CentOS/centos-packages`
这个过程会提示很多包都没有,没有关系,呆会激活另外一个更新源时,再重复以上yum的步骤。
(由于是这样,在考虑干脆在这一步就用那个源,免得重复)

3、安装一个perl会用到的软件
# cd /root/download
# wget
# rpm -Uvh ncftp-3.2.0-3.el5.kb.i386.rpm

4、初始化perl模块安装环境
# perl -MCPAN -e shell
# /usr/lib/perl5/5.8.8/CPAN/Config.pm initialized.

CPAN is the world-wide archive of perl resources. It consists of about
100 sites that all replicate the same contents all around the globe.
Many countries have at least one CPAN site already. The resources
found on CPAN are easily accessible with the CPAN.pm module. If you
want to use CPAN.pm, you have to configure it properly.

If you do not want to enter a dialog now, you can answer ‘no’ to this
question and I’ll try to autoconfigure. (Note: you can revisit this
dialog anytime later by typing ‘o conf init’ at the cpan prompt.)

Are you ready for manual configuration? [yes] 直接回车

The following questions are intended to help you with the
configuration. The CPAN module needs a directory of its own to cache
important index files and maybe keep a temporary mirror of CPAN files.
This may be a site-wide directory or a personal directory.

First of all, I’d like to create this directory. Where?

CPAN build and cache directory? [/root/.cpan] 直接回车

If you want, I can keep the source files after a build in the cpan
home directory. If you choose so then future builds will take the
files from there. If you don’t want to keep them, answer 0 to the
next question.

How big should the disk cache be for keeping the build directories
with all the intermediate files?

Cache size for build directory (in MB)? [10] 直接回车

By default, each time the CPAN module is started, cache scanning
is performed to keep the cache size in sync. To prevent from this,
disable the cache scanning with ‘never’.

Perform cache scanning (atstart or never)? [atstart] atstart

To considerably speed up the initial CPAN shell startup, it is
possible to use Storable to create a cache of metadata. If Storable
is not available, the normal index mechanism will be used.

Cache metadata (yes/no)? [yes] 直接回车

The next option deals with the charset your terminal supports. In
general CPAN is English speaking territory, thus the charset does not
matter much, but some of the aliens out there who upload their
software to CPAN bear names that are outside the ASCII range. If your
terminal supports UTF-8, you say no to the next question, if it
supports ISO-8859-1 (also known as LATIN1) then you say yes, and if it
supports neither nor, your answer does not matter, you will not be
able to read the names of some authors anyway. If you answer no, names
will be output in UTF-8.

Your terminal expects ISO-8859-1 (yes/no)? [yes] 直接回车

If you have one of the readline packages (Term::ReadLine::Perl,
Term::ReadLine::Gnu, possibly others) installed, the interactive CPAN
shell will have history support. The next two questions deal with the
filename of the history file and with its size. If you do not want to
set this variable, please hit SPACE RETURN to the following question.

File to save your history? [/root/.cpan/histfile] 直接回车
Number of lines to save? [100] 直接回车

The CPAN module can detect when a module that which you are trying to
build depends on prerequisites. If this happens, it can build the
prerequisites for you automatically (’follow’), ask you for
confirmation (’ask’), or just ignore them (’ignore’). Please set your
policy to one of the three values.

Policy on building prerequisites (follow, ask or ignore)? [ask] ask

The CPAN module will need a few external programs to work properly.
Please correct me, if I guess the wrong path for a program. Don’t
panic if you do not have some of them, just press ENTER for those. To
disable the use of a download program, you can type a space followed
by ENTER.

Where is your gzip program? [/bin/gzip] 直接回车
Where is your tar program? [/bin/tar] 直接回车
Where is your unzip program? [/usr/bin/unzip] /直接回车
Where is your make program? [/usr/bin/make] 直接回车
Where is your links program? [/usr/bin/links] 直接回车
Where is your wget program? [/usr/bin/wget] 直接回车
Where is your ncftp program? [/usr/bin/ncftp] 直接回车
Where is your ftp program? [/usr/kerberos/bin/ftp] 直接回车
Where is your gpg program? [/usr/bin/gpg] 直接回车
What is your favorite pager program? [/usr/bin/less] 直接回车
What is your favorite shell? [/bin/bash] 直接回车

Every Makefile.PL is run by perl in a separate process. Likewise we
run ‘make’ and ‘make install’ in processes. If you have any
parameters (e.g. PREFIX, LIB, UNINST or the like) you want to pass
to the calls, please specify them here.

If you don’t understand this question, just press ENTER.

Parameters for the ‘perl Makefile.PL’ command?
Typical frequently used settings:

PREFIX=~/perl       non-root users (please see manual for more hints)

Your choice:  [] 直接回车
Parameters for the ‘make’ command?
Typical frequently used setting:

-j3              dual processor system

Your choice:  [] 直接回车
Parameters for the ‘make install’ command?
Typical frequently used setting:

UNINST=1         to always uninstall potentially conflicting files

Your choice:  [] 直接回车

Sometimes you may wish to leave the processes run by CPAN alone
without caring about them. As sometimes the Makefile.PL contains
question you’re expected to answer, you can set a timer that will
kill a ‘perl Makefile.PL’ process after the specified time in seconds.

If you set this value to 0, these processes will wait forever. This is
the default and recommended setting.

Timeout for inactivity during Makefile.PL? [0] 直接回车

If you’re accessing the net via proxies, you can specify them in the
CPAN configuration or via environment variables. The variable in
the $CPAN::Config takes precedence.

Your ftp_proxy?
Your http_proxy?
Your no_proxy?
You have no /root/.cpan/sources/MIRRORED.BY
I’m trying to fetch one
CPAN: LWP::UserAgent loaded ok
Fetching with LWP:


Now we need to know where your favorite CPAN sites are located. Push
a few sites onto the array (just in case the first on the array won’t
work). If you are mirroring CPAN to your local workstation, specify a
file: URL.

First, pick a nearby continent and country (you can pick several of
each, separated by spaces, or none if you just want to keep your
existing selections). Then, you will be presented with a list of URLs
of CPAN mirrors in the countries you selected, along with previously
selected URLs. Select some of those URLs, or just keep the old list.
Finally, you will be prompted for any extra URLs — file:, ftp:, or
http: — that host a CPAN mirror.

(1) Africa
(2) Asia
(3) Central America
(4) Europe
(5) North America
(6) Oceania
(7) South America
Select your continent (or several nearby continents) [] 2
Sorry! since you don’t have any existing picks, you must make a
geographic selection.

(1) China
(2) Hong Kong
(3) Indonesia
(4) Israel
(5) Japan
(6) Republic of Korea
(7) Russia
(8) Singapore
(9) Taiwan
(10) Thailand
(11) Turkey
(12) Viet Nam
Select your country (or several nearby countries) [] 1
Sorry! since you don’t have any existing picks, you must make a
geographic selection.

(1)
(2)
Select as many URLs as you like (by number),
put them on one line, separated by blanks, e.g. ‘1 4 5′ [] 1 2

Enter another URL or RETURN to quit: [] 直接回车
New set of picks:


commit: wrote /usr/lib/perl5/5.8.8/CPAN/Config.pm
Terminal does not support AddHistory.

cpan shell — CPAN exploration and modules installation (v1.7602)
ReadLine support available (try ‘install Bundle::CPAN’)

cpan> exit

5、安装perl模块
cat ./docs/CentOS/centos-perl | xargs -I {} perl -MCPAN -e ‘install {}’

6、激活另外两个源,用于更新php
# wget
# wget
# rpm -Uvh remi-release-5*.rpm epel-release-5*.rpm
# vi /etc/yum.repos.d/remi.repo
# vi /etc/yum.repos.d/epel.repo
# vi /etc/yum.repos.d/epel-testing.repo
在这三个文件最后添加
priority=1
保存退出

7、使用remi源,安装刚才找不到的软件包
yum –enablerepo=remi install `cat ./docs/CentOS/centos-packages`

8、删除sendmail
# yum -y remove sendmail

9、删除 mysql-5.0.45-7.el5
# yum -y remove mysql-5.0.45-7.el5

这里记住它删除了那些包,呆会用remi源重新安装跟MySQL相关的软件包
至于为什么要删除,因为yum –enablerepo=remi update php*时,会安装一个依赖包mysql-libs-5.1.34-1.el5.remi.i386.rpm
这个包与mysql-5.0.45-7.el5冲突,所以要卸载mysql-5.0.45-7.el5。
用新源重新安装
# yum –enablerepo=remi install mysql amavisd-new libdbi-dbd-mysql mod_auth_mysql mysql-server perl-DBD-MySQL php-mysql proftpd-mysql mysql-devel postgresql-devel

10、ispCP安装文档说CentOS官方源里的PHP有问题,所以这里需要更新PHP
# yum –enablerepo=remi update php*

11、安装Courier IMAP server
由于INSTALL安装文档中所给出的地址已经失效,我们手动创建相关rpm包
# yum -y –enablerepo=remi install libtool*
# yum -y –enablerepo=remi install gamin-devel
# useradd -m -s /bin/bash compileuser
# passwd compileuser
# visudo

在root行添加以下内容:
compileuser   ALL=(ALL)       ALL
保存退出

# su compileuser
$ mkdir $HOME/rpm
$ mkdir $HOME/rpm/SOURCES
$ mkdir $HOME/rpm/SPECS
$ mkdir $HOME/rpm/BUILD
$ mkdir $HOME/rpm/SRPMS
$ mkdir $HOME/rpm/RPMS
$ mkdir $HOME/rpm/RPMS/i386
$ echo “%_topdir $HOME/rpm” >> $HOME/.rpmmacros
$ cd /tmp
$ wget
$ wget
$ sudo rpmbuild -ta courier-authlib-0.62.1.tar.bz2
$ cd $HOME/rpm/RPMS/i386
$ sudo rpm -Uvh courier-authlib-0.62.1-1.i386.rpm courier-authlib-userdb-0.62.1-1.i386.rpm
$ cd /tmp
$ rpmbuild -ta courier-imap-4.4.1.tar.bz2
$ cd $HOME/rpm/RPMS/i386
$ sudo rpm -ivh courier-imap-4.4.1-1.i386.rpm
退出compileuser,切换为root
$ exit
# groupadd courier -g 3000
# useradd -u 3000 -c ‘Courier Mail Server’ -d /dev/null -g courier -s /bin/false courier
# service mysqld start
# /usr/bin/mysql_secure_installation

12、安装mod_fcgid
# cd /root/download/
# wget
# rpm -Uvh mod_fcgid-2.2-4.el5.kb.i386.rpm

13、删除无用的Apache文件
# rm -f /etc/httpd/conf.d/*

三、安装ispCP OMEGA

1、编译ispCP OMEGA:
# cd /root/download/ispcp-omega-1.0.0
# make -f Makefile.centos install

2、复制生成的目录到系统:
# cp -RLf /tmp/ispcp/* /
# cp -Rv /tmp/ispcp/etc/init.d /etc/rc.d/
# ln -s /etc/rc.d/init.d /etc/init.d
# mkdir /var/mail/virtual

3、配置BIND:
# mv /var/named/data /var/named/data2
# ln -s /var/named/chroot/var/named/data /var/named/data
vi /var/named/chroot/etc/named.caching-nameserver.conf after line:
在include “/etc/named.rfc1912.zones”;后添加以下内容

include “/etc/named-ispcp.conf”;

保存退出

4、 创建SASL database 目录并配置使Postfix调用SASL的配置文件:
# touch /etc/sasldb2
# mkdir -p /var/spool/postfix/etc
# cp /etc/sasldb2 /var/spool/postfix/etc/sasldb2
# mv /usr/lib/sasl2/smtpd.conf /usr/lib/sasl2/smtpd.conf.OLD
# vi /usr/lib/sasl2/smtpd.conf
添加以下内容:

pwcheck_method: auxprop
auxprop_plugin: sasldb
mech_list: PLAIN LOGIN CRAM-MD5 DIGEST-MD5

保存退出

5、添加Apache配置文件:

# echo ‘include vhosts/*.conf’ >> /etc/httpd/conf/httpd.conf
# chown apache:apache /var/www/ispcp/gui/tools/webmail/data

6、安装:
# cd /var/www/ispcp/engine/setup
# perl ispcp-setup

7、设置系统参数:
# chmod 777 /var/www/ispcp/gui/phptmp

8、安装服务:
# chkconfig –add ispcp_daemon
# chkconfig –add ispcp_network
# chkconfig –levels 345 ispcp_daemon on
# chkconfig –levels 345 ispcp_network on
# service ispcp_daemon start
# service ispcp_network start

9、清楚临时文件目录,安装完成:
# rm -R /tmp/ispcp

至此安装完成,此时需要做的工作是service iptables save,否则,防火墙或系统重启,ispCP所生成的规则会丢失。

四、主要参考资料:
1、ispcp-omega安装包里的安装手册
2、

五、一些提示:
1、yum安装都需要比较长的时间,yum那里有个小窍门,当源比较慢时,可以按下Ctrl+c,这样yum会尝试另外一个源,如果一直慢,就再 Ctrl+c,总有个源是比较快的,如果这样做了,yum只会下载所有的包,不会安装,所以需要重新运行下yum install `cat ./docs/CentOS/centos-packages`,这时候才会安装

2、DNS功能暂时只能在localhost用,因为以下:
Modify /var/named/chroot/etc/named.caching-nameserver.conf according your needs (default it binds only to localhost)

3、ispcp的配置文件在:/etc/ispcp/ispcp.conf,将管理所用的域名改为了IP地址,phpMyAdmin可以实现免密码自动登录,哈哈。

4、刚访问,发现是软件包更新了,courier相关包可以到上面下载



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