网站运营
位置:首页>> 网站运营>> Linux和Solaris建Apache虚拟根环境二(6)

Linux和Solaris建Apache虚拟根环境二(6)

 来源:asp之家 发布时间:2010-05-08 18:04:00 

标签:linux,apache,脚本

8.6 进入Apache目录树中,完成建立、配置、运行和构造

$ cd /usr/local/src/chr/apache_1.3.12
non-DSO:
$ SSL_BASE=../openssl-0.9.5a RSA_BASE=../rsaref-2.0/local
./configure --prefix=/apache --with-layout=chroot
--enable-module=most --enable-module=so --enable-module=ssl
--disable-rule=SSL_COMPAT --enable-rule=SSL_SDBM
--activate-module=src/modules/php4/libphp4.a
--activate-module=src/modules/perl/libperl.a
DSO:
$ cd src/modules
$ make clean ## seems to be necessary if you previously compiled in the apache tree
$ cd ../../
$ SSL_BASE=../openssl-0.9.5a RSA_BASE=../rsaref-2.0/local
./configure --prefix=/apache --with-layout=chroot
--enable-module=most --enable-shared=max --enable-shared=ssl
--disable-rule=SSL_COMPAT --enable-rule=SSL_SDBM
$ make



8.7 重新安装Apache。如果他在运行,要停止运行再安装。

ROOT# chroot /www /apache/bin/apachectl stop

ROOT# make install ## I am root!

8.8 对于non-DSO安装你可以检测内部编译模块。

ROOT# chroot /www /apache/bin/httpd -l

| grep -E '(php|perl|ssl)'
mod_ssl.c
mod_php4.c
mod_perl.c


8.9 在实现了虚拟根环境目录树中生成随机的设备

ROOT# cd /www/dev
ROOT# mknod random c 1 8
ROOT# mknod urandom c 1 9


8.10 将缺省配置文件融合到你当前的httpd.conf文件中。

我在不同于标准端口(80端口)的其他端口上进行了测试,但是对于安全端口(443端口),没有web服务起跑再它上面,所以我马上就会用一下这个端口。

在这个例子中,我对缺省的配置文件httpd.conf的一些修改如下:

User www
Group www
ServerName yourserver.yourdomain.here
Port 8088 ## pick a test port
Listen 8088 ## in 'IfDefine SSL' section
Listen 443 ## this is the standard secure port!
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
# your Hello.pm script for mod_perl testing:
SetHandler perl-script
PerlHandler Apache::Hello
SSLCertificateFile /apache/conf/server.crt
SSLCertificateKeyFile /apache/conf/server.key
# in this example I generate the key and crt files into /apache/conf

0
投稿

猜你喜欢

手机版 网站运营 asp之家 www.aspxhome.com