centos5.5下安装apache
centos5.5会默认自带一个apache,首先要卸载掉,再装新的卸载 rpm -aq httpd 查出名字
yum erase 查出的名字
卸载好了,按下面步骤安装
下面是linux下安装apache的完整代码,系统是redhat5.5
下载httpd-2.2.6.tar.bz2把httpd-2.2.6.tar.bz2放到/soft 下
#cd /soft
#tar jxvf httpd-2.2.6.tar.bz2 //解压
#cd httpd-2.2.6 //定位到httpd-2.2.6 文件夹下
#ls //l显示httpd-2.2.6 文件夹下内容
#./configure --help | more //查看安装apache参数
#./configure--prefix=/usr/local/apache--enable-so //配置apache路径
#make //编译apache
#make install //安装apache
#cd /usr/local/apache
#cd conf/
#cp -a httpd.conf httpd.conf- //备份apache配置文件
#chkconfig--list httpd //列出httpd服务
#chkconfig httpd off //如果关闭系统自带了httpd的服务,如果存在
#service httpd status //查看自带htttpd服务状态
#/usr/local/apache/bin/apachectl -k start //linux下启动apache命令
#netstat -an | grep :80 //查看linux80端口是否开启
#ps -aux | grep httpd //linux下查看apache进程
#cd ../..
#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache //拷贝apache启动脚本
#vi /etc/rc.d/init.d/apache // 这里是编辑apache启动脚本
在开头的#!/bin/sh下面加上
#chkconfig: 23458515
#chkconfig --add apache //添加apache服务
#chkconfig --list apache //列出apache服务
#service apache stop //停止apache服务
#netstat -an | grep :80 //查看linux的80端口是否关闭
#ps -aux | grep httpd //查看是否不存在
#service apache start //启动apache服务
#ps -aux | grep httpd //查看是否存在
打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你
linux下安装apache已经成功了
页:
[1]