linux apache安装

下载 httpd-2.4.12.tar.gz 
939  mkdir soft
  941  cd soft/
  943  cp /tmp/httpd-2.4.12.tar.gz /soft/
  945  tar -zxvf httpd-2.4.12.tar.gz
  947  cd httpd-2.4.12

下载apr-1.5.1.tar.gz 
  957  tar -zvxf apr-1.5.1.tar.gz
  958  cd apr-1.5.1
  959  ./configure --prefix=/usr/local/apr
  960  make && make install

 下载apr-util-1.5.4.tar.gz 
  961  cd ..
  962  tar -zxvf apr-util-1.5.4.tar.gz
  963  cd apr-util-1.5.4
  964  ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config
  965  make
  966  make install

下载pcre-8.32.tar.gz 
  967  cd ..
  968  ls
  969  tar -zvxf pcre-8.32.tar.gz
  970  cd pcre-8.32
  971  ls
  972  ./configure --prefix=/usr/local/pcre
  973  make
  974  make install


  975  cd ..
  985  cd httpd-2.4.12

  988  ./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util/ --with-pcre=/usr/local/pcre
  989  make
  990  make install
  991  cd /usr/local/apache/
  992  ls
  993  cd conf/
  994  ls
  995  cp -a httpd.conf httpd.conf.bak
  996  ls
  997  chkconfig --list httpd
  998  service httpd status
  999  cd ..
1000  ls
1001  ./bin/apachectl -k start
1002  netstat -an | grep 80
1004  ps aux|grep httpd
1005  cp /usr/local/apache/bin/apachectl /etc/rc.d/init.d/apache
1006  vim /etc/rc.d/init.d/apache 
行首加入如下配置:
    #!/bin/sh
    #chkconfig: 2345 85 15   2345表示2345四个启动级别里面加载这个服务,85表示启动(开机时)顺序号,15表示关闭(关机时)顺序号
1007  chkconfig --add apache
1008  chkconfig apache on
1009  netstat -an |grep :80
1010  service apache stop
1011  service apache start


遇到问题说明:

rpm -qa |grep httpd
 rpm -e --nodeps httpd-tools-2.2.15-29.el6.centos.x86_64
rpm -qa |grep httpd
 rpm -e --nodeps httpd-2.2.15-29.el6.centos.x86_64
 ls
  rpm -qa |grep httpd
  yum remove apache


报错: no acceptable C compiler found in $PATH
yum install gcc

linux下安装安装pcre-8.32
./configure --prefix=/usr/local/pcre 出现以下错误
configure: error: You need a C++ compiler for C++ support
正解
yum install -y gcc gcc-c++

AH00557: httpd: apr_sockaddr_info_get() failed for lihonglei
AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1. Set the 'ServerName' directive globally to suppress this message
修改
./conf/httpd.conf文件
erverName www.example.com:80
行注释去掉 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值