免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 7328 | 回复: 5
打印 上一主题 下一主题

[FreeBSD] 这两天开始研究ISPConfig了,做些记录 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2008-04-01 17:06 |只看该作者 |倒序浏览
本文起因:
坛子上最近有人开始到处找hosting控制板了,所以我也小研究了一下。结果昨天在FreeBSD上全部光荣失败了,当然包括ispconfig。不过在所有试过的控制板中,ispconfig在安装过程中可以看出是最强大的一款,所以不甘心和极度无聊驱使我开始进行二次尝试并且决心把过程记录下来。

文档约定:
当然,鉴于昨天的失败经历,本文最后很可能以失败结尾。各位看个热闹得了:)
本文由BestWC,Alson Black原创。任何人可自由转载,不受限制。包括本句话在内的所有内容都可任意修改。

先决条件:
当然,perl/clamav-0.92.1.tar.gz/openssl/zip/unzip 等等这些常用组件是可以提前安装好的,但在ispconfig的安装过程中,这些包还是会自动解开并试图安装,所以提前准备一下并不是坏事。
按照前人们对ispconfig的理解,它会在一个默认是81的端口新开一个WEB服务,使用apache1.3提供服务。所以,对你的apache是没有影响的。官网上有句话挺有意思,大概意思就是如果你已经拥有上百个站点,需要一个控制台来维护它们,那么ispconfig不是为你准备的。OK,综上,关于apache和php这些WEB组件,最好还是等安装完ispconfig后再去慢慢配置。

首先svn更新最新安装包:

svn co svn://svn.ispconfig.org/ispconfig/trunk/ ispconfig

更新完后记得打个包,下面有用。

完成后我们来大概看看ispconfig的目录结构:
cmdtools
install_ispconfig
packages
tree.txt
.
|
|-------cmdtools/
|       |-------.svn/
|       |       |-------entries
|       |       |-------format
|       |       |-------prop-base/
|       |       |-------props/
|       |       |-------text-base/
|       |       |       |-------ftp_simple_backup.php.svn-base
|       |       |-------tmp/
|       |               |-------prop-base/
|       |               |-------props/
|       |               |-------text-base/
|       |-------ftp_simple_backup.php
|-------install_ispconfig/
|       |-------.svn/
|       |       |-------entries
|       |       |-------format
|       |       |-------prop-base/
|       |       |       |-------setup2.svn-base
|       |       |-------props/
|       |       |-------text-base/
|       |       |       |-------check.php.svn-base
|       |       |       |-------config.inc.php.tmp.svn-base
|       |       |       |-------db_ispconfig.sql.svn-base
|       |       |       |-------dist.txt.svn-base
|       |       |       |-------install.php.svn-base
|       |       |       |-------ispconfig_server.svn-base
|       |       |       |-------ispconfig_tcpserver.svn-base
|       |       |       |-------license.txt.svn-base
|       |       |       |-------setup.svn-base
|       |       |       |-------setup1.svn-base
|       |       |       |-------setup2.svn-base
|       |       |       |-------uninstall.svn-base
|       |       |       |-------vsftpd.conf.svn-base
|       |       |-------tmp/
|       |               |-------prop-base/
|       |               |-------props/
|       |               |-------text-base/
|       |-------binaries/
以下略。主要来看看compile_aps中的内容,这些都是安装程序带的安装包。
| |-------compile_aps/
| | |-------.svn/
| | | |-------entries
| | | |-------format
| | | |-------prop-base/
| | | | |-------Mail-SpamAssassin-3.2.4.tar.gz.svn-base
| | | | |-------apache_1.3.41.tar.gz.svn-base
| | | | |-------awstats-6.7.tar.gz.svn-base
| | | | |-------clamassassin-1.2.4.tar.gz.svn-base
| | | | |-------clamav-0.92.1.tar.gz.svn-base
| | | | |-------cronolog-1.6.2.tar.gz.svn-base
| | | | |-------mod_ssl-2.8.31-1.3.41.tar.gz.svn-base
| | | | |-------openssl-0.9.8g.tar.gz.svn-base
| | | | |-------php-5.2.5.tar.gz.svn-base
| | | | |-------unzip-5.52.tar.gz.svn-base
| | | | |-------uudeview-0.5.20.tar.gz.svn-base
| | | | |-------zip-2.3.tar.gz.svn-base
OK,记住这里出现的东西,很可能等等会用到。

开始安装吧。
www# ls
cmdtools                install_ispconfig       packages                tree.txt
www# cd install_ispconfig
www# ls
.svn                    db_ispconfig.sql        ispconfig_server        scripts                 sv
binaries                dist.txt                ispconfig_tcpserver     security                uninstall
check.php               install.php             license.txt             setup                   vsftpd.conf
compile_aps             isp                     mailstats               setup1
config.inc.php.tmp      ispconfig               mod                     setup2
www# ./setup
FreeBSD 7.0
ERROR: Ihr Betriebssystem wird nicht unterst黷zt! / Your operating system is not supported! / Votre systeme d'exploitation n'est pas support?
www#

错误提示看起来是检测到系统为FreeBSD并且不在支持列表中。OK,发扬我们一贯的流氓作风,把这段判断给扼杀在摇篮中!
在setup1中的280行左右:
log "operating system: $distversion"   
dist_supported=`grep -i "$distvers" dist.txt`
   
if [ "$dist_supported" == "" ] || [ "$distvers" == "" ]; then
  error "Ihr Betriebssystem wird nicht unterst黷zt! / Your operating system is not supported! / Votre systeme d'exploitation
fi 上面这个if要杀要剐全看你了,呵呵。

修改完后我们再试一次。
www# ./setup
FreeBSD 7.0
Upgrade einer existierenden ISPConfig-Installation. / Upgrading an existing ISPConfig installation. / Mise ?jour d'une installation d'ISPConfig existante.
Das Upgrade wird von Ihnen ge鋘derte Templates/Dateien von ISPConfig 黚erspielen. Wenn Sie diese Dateien sichern m鯿hten, sollten Sie jetzt eine zweite Shell 鰂fnen, um ein Backup der betroffenen Dateien durchzuf黨ren.
The upgrade will overwrite your manual changes to files/templates of ISPConfig. In order to save those files you should open a second shell to make a backup of the affected files.
En uppgradering kommer att skriva 鰒er manuella 鋘dringar gjorda p?filer/mallar i ISPConfig.F鰎 att spara dessa 鋘dringar b鰎 du 鰌pna ett andra skal f鰊ster f鰎 att g鰎a en backup p?ber鰎da filer.
Cette mise ?jour va supprimer vos changements dans les fichiers des manuels/modeles d'ISPConfig. Pour sauvegarder ces fichiers vous devez ouvrir une seconde fen阾re shell et enregistrer les fichiers concern閟.
./setup2: line 75: /ispconfig_server: No such file or directory
W鋒len Sie Ihre Sprache (deutsch/englisch/spanisch/franz鰏isch/italienisch/niederl鋘disch/polnisch/schwedisch/serbian): / Please choose your language (German/English/Spanish/French/Italian/Dutch/Polish/Swedish/Serbian):  / Merci de choisir votre langue (Allemand/Anglais/Espagnol/Fran鏰is/Italien/N閑rlandais/Polonais/Su閐ois/Serbian):
1) de
2) en
3) es
4) fr
5) it
6) nl
7) pl
se
9) sr
Ihre Wahl: / Your Choice: / Votre Choix:
按照提示选择语言吧。下略。
x apache_1.3.41/htdocs/manual/stopping.html.fr
x apache_1.3.41/htdocs/manual/stopping.html.html
x apache_1.3.41/htdocs/manual/suexec.html.en
x apache_1.3.41/htdocs/manual/suexec.html.html
x apache_1.3.41/htdocs/manual/suexec.html.ja.jis
x apache_1.3.41/htdocs/manual/suexec_1_2.html
x apache_1.3.41/htdocs/manual/unixware.html
x apache_1.3.41/htdocs/manual/upgrading_to_1_3.html
x apache_1.3.41/htdocs/manual/urlmapping.html
x apache_1.3.41/htdocs/manual/vhosts/
x apache_1.3.41/htdocs/manual/vhosts/details.html
x apache_1.3.41/htdocs/manual/vhosts/details_1_2.html
x apache_1.3.41/htdocs/manual/vhosts/examples.html
x apache_1.3.41/htdocs/manual/vhosts/fd-limits.html.en
x apache_1.3.41/htdocs/manual/vhosts/fd-limits.html.html
x apache_1.3.41/htdocs/manual/vhosts/fd-limits.html.ja.jis
x apache_1.3.41/htdocs/manual/vhosts/footer.html
x apache_1.3.41/htdocs/manual/vhosts/header.html
x apache_1.3.41/htdocs/manual/vhosts/host.html
x apache_1.3.41/htdocs/manual/vhosts/index.html.en
x apache_1.3.41/htdocs/manual/vhosts/index.html.html
x apache_1.3.41/htdocs/manual/vhosts/index.html.ja.jis
x apache_1.3.41/htdocs/manual/vhosts/ip-based.html
x apache_1.3.41/htdocs/manual/vhosts/mass.html
x apache_1.3.41/htdocs/manual/vhosts/name-based.html.en
x apache_1.3.41/htdocs/manual/vhosts/name-based.html.html
x apache_1.3.41/htdocs/manual/vhosts/name-based.html.ja.jis
x apache_1.3.41/htdocs/manual/vhosts/vhosts-in-depth.html
x apache_1.3.41/htdocs/manual/vhosts/virtual-host.html
x apache_1.3.41/htdocs/manual/win_compiling.html.en
x apache_1.3.41/htdocs/manual/win_compiling.html.html
x apache_1.3.41/htdocs/manual/win_compiling.html.ja.jis
x apache_1.3.41/htdocs/manual/win_service.html.en
x apache_1.3.41/htdocs/manual/win_service.html.html
x apache_1.3.41/htdocs/manual/win_service.html.ja.jis
x apache_1.3.41/htdocs/manual/windows.html.en
x apache_1.3.41/htdocs/manual/windows.html.html
x apache_1.3.41/htdocs/manual/windows.html.ja.jis
x apache_1.3.41/htdocs/README.rus
x apache_1.3.41/icons/
x apache_1.3.41/icons/a.gif
x apache_1.3.41/icons/a.png
x apache_1.3.41/icons/alert.black.gif
x apache_1.3.41/icons/alert.black.png
之后程序会一直解包并进行必要的编译,我们休息一会。

x clamav-0.92.1/database/
x clamav-0.92.1/database/main.cvd: Premature end of gzip compressed data: Input/output error
tar: Error exit delayed from previous errors.
ERROR: Could not unpack ClamAV
这里出现了错误导致程序运行终止,并自动删除了安装包(狠啊)。分析一下之后发现,系统自带的clamav-0.92.1的包有些问题,至少是在我的机器上无法正常解压。那么,再次发扬我们一贯的无耻作风,偷天换日。
www# cd /usr/ports/security/clamav
www# make fetch
将clamav-0.92.1包下载到distfiles中。
上面备份的包这会派上用场了,重新解一下吧。
www# cd install_ispconfig
www# cd compile_aps
www# cp /usr/ports/distfiles/clamav-0.92.1.tar.gz ./
这里最好再制作一个备份包,谁知道等等会出什么问题。
OK,再来一次。
www# cd ..
www# ./setup
终于解包OK进入了编译过程。我们接着休息。
+---------------------------------------------------------------------+
| Before you install the package you now should prepare the SSL       |
| certificate system by running the 'make certificate' command.       |
| For different situations the following variants are provided:       |
|                                                                     |
| % make certificate TYPE=dummy    (dummy self-signed Snake Oil cert) |
| % make certificate TYPE=test     (test cert signed by Snake Oil CA) |
| % make certificate TYPE=custom   (custom cert signed by own CA)     |
| % make certificate TYPE=existing (existing cert)                    |
|        CRT=/path/to/your.crt [KEY=/path/to/your.key]                |
|                                                                     |
| Use TYPE=dummy    when you're a  vendor package maintainer,         |
| the TYPE=test     when you're an admin but want to do tests only,   |
| the TYPE=custom   when you're an admin willing to run a real server |
| and TYPE=existing when you're an admin who upgrades a server.       |
| (The default is TYPE=test)                                          |
|                                                                     |
| Additionally add ALGO=RSA (default) or ALGO=DSA to select           |
| the signature algorithm used for the generated certificate.         |
|                                                                     |
| Use 'make certificate VIEW=1' to display the generated data.        |
|                                                                     |
| Thanks for using Apache & mod_ssl.       Ralf S. Engelschall        |
|                                          rse@engelschall.com        |
|                                          www.engelschall.com        |
+---------------------------------------------------------------------+
<=== src
SSL Certificate Generation Utility (mkcert.sh)
Copyright (c) 1998-2000 Ralf S. Engelschall, All Rights Reserved.
Generating custom certificate signed by own CA [CUSTOM]
______________________________________________________________________
STEP 0: Decide the signature algorithm used for certificates
The generated X.509 certificates can contain either
RSA or DSA based ingredients. Select the one you want to use.
Signature Algorithm ((R)SA or (D)SA) [R]:
OK,这里开始制作私匙,按照提示自己选择吧。
制作完成后PHP5开始自动编译了,继续休息吧:)

Build complete.
Don't forget to run 'make test'.
Installing PHP SAPI module:       apache
[activating module `php5' in /root/ispconfig/httpd/conf/httpd.conf]
cp libs/libphp5.so /root/ispconfig/httpd/libexec/libphp5.so
chmod 755 /root/ispconfig/httpd/libexec/libphp5.so
cp /root/ispconfig/httpd/conf/httpd.conf /root/ispconfig/httpd/conf/httpd.conf.bak
cp /root/ispconfig/httpd/conf/httpd.conf.new /root/ispconfig/httpd/conf/httpd.conf
rm /root/ispconfig/httpd/conf/httpd.conf.new
Installing PHP CLI binary:        /root/ispconfig/php/bin/
Installing PHP CLI man page:      /root/ispconfig/php/man/man1/
Installing build environment:     /root/ispconfig/php/lib/php/build/
Installing header files:          /root/ispconfig/php/include/php/
Installing helper programs:       /root/ispconfig/php/bin/
  program: phpize
  program: php-config
Installing man pages:             /root/ispconfig/php/man/man1/
  page: phpize.1
  page: php-config.1
Installing PDO headers:          /root/ispconfig/php/include/php/ext/pdo/
chown: root: Invalid argument
chown: root: Invalid argument
chown: root: Invalid argument
chown: root: Invalid argument
貌似安装脚本中有几个chown的参数使用不合FreeBSD的规范,这里先不管它,等等回头检查。

cp -f clamassassin /home/admispconfig/ispconfig/tools/clamav/bin
chmod 555 /home/admispconfig/ispconfig/tools/clamav/bin/clamassassin
What email address or URL should be used in the suspected-spam report
text for users who want more information on your filter installation?
(In particular, ISPs should change this to a local Postmaster contact)
default text: [the administrator of that system]
这里又有一个需要输入的地方,个人建议记住这个地方,因为昨天在这之后出现了一个让安装过程终止的错误。

需要解决这个错误其实也比较简单,但确实让我费了不少神。
在编译Mail-SpamAssassin-3.2.4.tar.gz的时候需要了几个未知函数,系统不认。后来我干脆在ports中make patch了这个包手动打包后替换了原来的包,并且用ports安装了SpamAssassin依赖的几个组件,这里就过去了。

OK,让暴风雨来得更猛烈些吧,看看后面还有什么等着我们。
rm -f process_.c
ln ttyio.c ttyio_.c
cc -c -O -I. -DUNIX  -DSFX ttyio_.c
rm -f ttyio_.c
ln unix/unix.c unix_.c
cc -c -O -I. -DUNIX  -DSFX unix_.c
rm -f unix_.c
cc -o unzipsfx unzipsfx.o crc32.o crctab_.o crypt_.o extract_.o fileio_.o  globals_.o inflate_.o match_.o process_.o ttyio_.o unix_.o -s
All prerequisites are fulfilled.
Here we go...
Please enter your MySQL server:
似乎是个好消息,可以开始配置了。按照提示填写这些配置吧。

OK
Please select the protocol (http or https (SSL encryption)) to use to access the ISPConfig system:
1) HTTPS
2) HTTP
Your Choice:
同志们,昨天我是光荣在这里牺牲的,本人较懒,感觉HTTP省事,结果报错一大堆,今天我吸取历史的教训,还是HTTPS吧。:)真主保佑。

Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fwrite(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 111
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 112
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 105
Warning: fwrite(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 111
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 112
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 105
Warning: fwrite(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 111
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 112
usage: pwd_mkdb [-BCiLNp] [-d directory] [-s cachesize] [-u username] file
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
groupadd: not found
Warning: fclose(): supplied argument is not a valid stream resource in /usr/soft/isp/install_ispconfig/install.php on line 97
useradd: not found
usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file target_file
       cp [-R [-H | -L | -P]] [-f | -i | -n] [-lpv] source_file ... target_directory
chown: /ispconfig_server: No such file or directory
chmod: /ispconfig_server: No such file or directory
恩。。。和昨天的错竟然一样,cp的命令也写错了,有够头疼的,看来还是得自己改改。
这里程序好像卡死了,不管它,再打开一个终端乖乖改我们的东西吧。

待续。。。

论坛徽章:
0
2 [报告]
发表于 2008-04-01 17:07 |只看该作者
占位编辑

论坛徽章:
0
3 [报告]
发表于 2008-04-01 17:07 |只看该作者
占位编辑

论坛徽章:
0
4 [报告]
发表于 2008-04-01 19:34 |只看该作者
最新动态:成功了,正在测试。稍候附上全过程记录。

论坛徽章:
0
5 [报告]
发表于 2009-05-16 21:23 |只看该作者
好强大
把过程贴出来阿

论坛徽章:
0
6 [报告]
发表于 2009-05-16 22:15 |只看该作者
强人!学习!预祝成功!!:wink:
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP