linux下安装apache 2.2.25

查看http安装版本 
[root@host1 ~]# rpm -qa|grep http httpd-2.2.3-11.el5_1.3  
[root@localhost ~]# rpm -qi httpd 
[root@localhostyum.repos.d]# rpm -qa |grephttpd 
httpd-2.2.3-31.el5 
[root@localhostyum.repos.d]# rpm -qi httpd 
Name        : httpd                        Relocations: (not relocatable) 
Version     : 2.2.3                             Vendor: Red Hat, Inc. 
Release     : 31.el5                        Build Date: Wed 15 Jul 2009 09:04:41 PM CST Install Date: Sun 30 Jan 2011 03:22:11 PM CST      Build Host: hs20-bc2-5.build.redhat.com Group       : System Environment/Daemons    Source RPM: httpd-2.2.3-31.el5.src.rpm Size        : 3433874                          License: Apache Software License Signature   : DSA/SHA1, Tue 28 Jul 2009 01:27:19 PM CST, Key ID 5326810137017186 Packager    : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla> URL         : http://httpd.apache.org/ Summary     : Apache HTTP Server 
Description : 
The Apache HTTP Server is a powerful, efficient, and extensible web server.  
[root@localhostyum.repos.d]# httpd -v 

Server version: Apache/2.2.3 
Server built:   Jul 15 2009 09:02:25  
[root@localhostyum.repos.d]# apachectl -v Server version: Apache/2.2.3 Server built:   Jul 15 2009 09:02:25  
查看http安装位置 
[root@localhost ~]# find / -name httpd.conf /etc/httpd/conf/httpd.conf  
[root@localhost ~]# whichapachectl /usr/sbin/apachectl  
[root@localhost ~]# whichhttpd /usr/sbin/httpd


下载 http://httpd.apache.org/download.cgi#apache22

下面是linux下安装apache的完整代码,系统是redhat5.5
下载httpd-2.2.6.tar.bz2  把httpd-2.2.6.tar.bz2放到/soft 下
[root@localhost ~]#cd /soft
[root@localhost soft]#tar jxvf httpd-2.2.6.tar.bz2    //解压apache的压缩包
[root@localhost soft]#cd httpd-2.2.6     //定位到httpd-2.2.6 文件夹下
[root@localhost httpd-2.2.6]#ls     //查看显示httpd-2.2.6 文件夹下内容
[root@localhost httpd-2.2.6]#./configure --help | more    //查看安装apache配置参数
[root@localhost httpd-2.2.6]#./configure  --prefix=/usr/local/apache  --enable-so    //  配置apache路径
[root@localhost httpd-2.2.6]#make     //编译apache
[root@localhost httpd-2.2.6]#make install    //安装apache
[root@localhost httpd-2.2.6]#cd /usr/local/apache   //进入apache的目录     
[root@localhost apache]#  cd conf/
[root@localhost conf]#cp -a httpd.conf httpd.conf-     //备份apache配置文件
[root@localhost conf]#chkconfig  --list httpd     //查看httpd服务是否已存在
[root@localhost conf]#chkconfig httpd off    //关闭系统自带了httpd的服务,如果存在httpd服务   
[root@localhost conf]#service httpd status    //查看自带httpd服务状态
[root@localhost conf]#/usr/local/apache/bin/apachectl -k start    //linux启动apache命令              
[root@localhost conf]#netstat -an | grep :80    //查看linux80端口是否开启
[root@localhost conf]#ps -aux | grep httpd     //linux下查看apache进程
[root@localhost conf]#cd ../..
[root@localhost local]#cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache //拷贝apache启动脚本
[root@localhost local]#vi /etc/rc.d/init.d/apache    // 这里是编辑apache启动脚本
  在开头的#!/bin/sh  下面加上
              #chkconfig: 2345  85  15
[root@localhost local]#chkconfig --add apache    //添加apache服务
[root@localhost local]#chkconfig --list apache    //列出apache服务
[root@localhost local]#service apache stop    //停止apache服务
[root@localhost local]#netstat -an | grep :80     //查看linux的80端口是否关闭
[root@localhost local]#ps -aux | grep httpd     //查看是否存在httpd服务,若果之前自带httpd服务启动的话会导致新添加的apache服务启动失败
[root@localhost local]#service apache start    //启动apache服务
打开你的服务器ip地址,看看是否出现了tomcat的默认首页,如果出现的话,那么恭喜你
linux下安装apache已经成功了


linux下apache 的安装
1、进入woke目录下:cd /usr/local/work
(如没有则自己新建,命令:mkdir /usr/local/woke)
 
2、在woke目录下从网站下载apache并解压:
wget http://dev.xiaonei.com/apache-mirror/httpd/httpd-2.0.63.tar.gz
解压:tar zxvf httpd-2.0.63.tar.gz
 
3、进入httpd-2.0.63目录:cd httpd-2.0.63
 
4、建立makefile,并将Apache安装到/usr/local/apache2目录下:
./configure -prefix=/usr/local/apache2 -enable-module=so   (/configure前有一个点“.”的)
 
5、开始编译:make
 
6、开始安装Apache到work目录中:
make install
 
7、至此Apache的安装工作完成,可以在每次启动系统时通过如下命令启动或重新启动Apache服务:
/usr/local/apache2/bin/apachectl start
/usr/local/apache2/bin/apachectl restart
 
8、打开浏览器,在地址栏输入“http://localhost”出现“It works!”或apache图标的漂亮界面,说明apache安装成功!


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值