#cd /home/httpd-2.0.54
#./configure --prefix=/opt/www/apache --enable-module=most --enable-shared=max --enable-so
#make
#make install
创建一个httpd启动脚本,内容如下:
#cd /etc/init.d
# vi httpd
脚本内容
#!/bin/bash
# Startup script for the Apache Web Server
# 包含函数库
. /etc/rc.d/init.d/functions
# 获取网络配置
. /etc/sysconfig/network
# 检测 NETWORKING 是否为 "yes"
[ "${NETWORKING}" = "no" ] && exit 0
# apache安装目录
APACHE=/opt/www/apache
# 启动服务函数
start() {
echo $"Starting httpd service: "
$APACHE/bin/apachectl start
RETVAL=$?
echo
}
# 关闭服务函数
stop() {
echo $"Stopping httpd service: "
$APACHE/bin/apachectl stop
RETVAL=$?
echo
}
# 根据参数选择调用
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $"Usage: $0 start|stop|restart"
exit 1
esac
exit 0
#######################################
设置开机自动启动
chmod 755 httpd
chkconfig --level 345 httpd on
#################################
启动httpd
#/etc/init.d/httpd start
安装PHP
#tar zxvf php-4.4.2.tar.gz
#cd php-4.4.2
#./configure --prefix=/opt/www/php
--with-mysql=/usr/local/mysql --with-apxs2=/opt/www/apache/bin/apxs
#make
#make install
#cp php.ini-dist /usr/local/lib/php.ini
#cd /opt/www/apache/conf
#vi httpd.conf
#系统自动添加了这一行,如果没有则自己加入这一行。
LoadModule php4_module modules/libphp4.so
在AddType application/x-tar .tgz下加一行
AddType application/x-httpd-php .php
AddType application/x-httpd-php .php3
编写文件index.php 写入下一行
echo phpinfo() ?>
通过浏览器我们看到了我们的测试结果。至此,PHP装好了
阅读(1722) | 评论(1) | 转发(0) |