Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2519225
  • 博文数量: 867
  • 博客积分: 10010
  • 博客等级: 上将
  • 技术积分: 9800
  • 用 户 组: 普通用户
  • 注册时间: 2006-07-27 14:44
文章分类

全部博文(867)

文章存档

2007年(6)

2006年(861)

我的朋友

分类: LINUX

2006-07-30 22:35:46

准备工作:
完成该种配置,需要如下软件包:
httpd-2.0.55.tar.bz2  php-5.0.4.tar.bz2
openssl-0.9.7g.tar.gz

第一步:安装Openssl
tar xvfz openssl-0.9.7g.tar.gz
cd openssl-0.9.7g
./config
make
make install

第二步:安装Apache
tar xvfz httpd-2.0.55.tar.gz
cd httpd-2.0.55
./configure --enable-ssl --with-ssl=/usr/local/ssl/
--enable-suexec --with-suexec-docroot=/usr/local
--enable-cgi --enable-rewrite --enable-so
--enable-logio --prefix=/usr/local/apache
--enable-module=most
--enable-shared=max --bindir=/usr/bin
--sbindir=/usr/sbin --sysconfdir=/etc/httpd
make
make install
生成加密证书:
mkdir /etc/httpd/ssl.crt
openssl genrsa -des3 -passout pass:asecretpassword
-out /etc/httpd/ssl.crt/server.key.org 1024
openssl req -new -passin pass:asecretpassword -passout
pass:asecretpassword -key
/etc/httpd/ssl.crt/server.key.org -out
   /etc/httpd/ssl.crt/server.csr -days 3650
openssl req -x509 -passin pass:asecretpassword
-passout pass:asecretpassword -key
/etc/httpd/ssl.crt/server.key.org -in
  /etc/httpd/ssl.crt/server.csr -out
/etc/httpd/ssl.crt/server.crt -days 3650
openssl rsa -passin pass:asecretpassword -in
/etc/httpd/ssl.crt/server.key.org -out
/etc/httpd/ssl.crt/server.key
mkdir /etc/httpd/ssl.key
mv /etc/httpd/ssl.crt/server.key
/etc/httpd/ssl.key/server.key
chmod 400 /etc/httpd/ssl.key/server.key

第三步:安装PHP
tar jxvf php-5.0.4.tar.bz2
./configure --with-apxs2=/usr/sbin/apxs
--with-mysql=/var/lib/mysql --enable-track-vars
--enable-sockets
--with-config-file-path=/etc --enable-ftp --with-zlib
--with-openssl=/usr/local/ssl
--enable-force-cgi-redirect
--enable-exif --with-gd --enable-memory-limit
--disable-debug --disable-rpath --disable-static
--with-pic
--with-layout=GNU --enable-calendar --enable-sysvsem
--enable-sysvshm --enable-sysvmsg --enable-trans-sid
--enable-bcmath --with-bz2 --enable-ctype --with-db4
--with-iconv --enable-filepro --with-gettext
--enable-mbstring --enable-shmop --enable-wddx
--disable-xml --with-xmlrpc --enable-yp --with-zlib
--without-pgsql --enable-dbx --enable-experimental-zts
--without-mm --enable-gd-native-ttf --with-imap-ssl
--enable-soap --enable-dbase
make
make install
cp /tmp/php-5.0.4/php.ini-dist /etc/php.ini

第四步:配置Apache
   在/etc/httpd/httpd.conf 中添加如下语句:
  AddHandler cgi-script .cgi
AddHandler cgi-script .pl
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
AddType application/x-httpd-php .php .php5 .php4 .php3
   建立/etc/init.d/httpd 文件:
  #!/bin/sh
 
case "$1" in
start)
 /usr/sbin/apachectl startssl
;;
stop)
 /usr/sbin/apachectl stop
;;
restart)
 $0 stop && sleep 3
 $0 start
;;
reload)
 $0 stop
 $0 start
;;
*)
echo "Usage: $0 {start|stop|restart|reload}"
exit 1
esac
chmod 755 /etc/init.d/httpd
如果希望每次系统重新启动时都能自动运行,则:
ln -s /etc/init.d/httpd /etc/rc2.d/S20httpd
ln -s /etc/init.d/httpd /etc/rc3.d/S20httpd
ln -s /etc/init.d/httpd /etc/rc4.d/S20httpd
ln -s /etc/init.d/httpd /etc/rc5.d/S20httpd
ln -s /etc/init.d/httpd /etc/rc0.d/K20httpd
ln -s /etc/init.d/httpd /etc/rc1.d/K20httpd
ln -s /etc/init.d/httpd /etc/rc6.d/K20httpd

第五步:测试
   在/usr/local/apache/htdocs中编写一个info.php文件:
   phpinfo();
  php?>
启动Apache:
/etc/init.d/httpd start
  在浏览器中输入:
和 进行测试。
阅读(1121) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~