linux 安装部署 apache http server

1 篇文章 0 订阅
1 篇文章 0 订阅
  1. 英文版部署说明 请参照 http://httpd.apache.org/docs/current/install.html
  2. 下载httpd  http://httpd.apache.org/download.cgi  点击下载 httpd-2.4.9.tar.gz  
  3. ftp上传到linux服务器 ,解压tar -xf httpd-2.4.9.tar.gz  
  4. 进入 刚解压的httpd目录 cd httpd-2.4.9
  5. 配置./configure --prefix /user/local/httpd-2.4.9 
    1. 本人执行到这步时出错,错误信息主要如下
    2. checking for APR... no  没有找到 apr
      configure: error: APR not found.  Please read the documentation
      .
    3. 英文版中有Requirements :the following requirements exist for building Apache httpd:
    4. 去 http://apr.apache.org/download.cgi 下载apr-1.5.0.tar.gz[必须] 、apr-util-1.5.3.tar.gz[必须]、apr-iconv-1.2.1.tar.gz[暂时没用到]
    5. 去 http://www.pcre.org/ 下载最新的pcre[必须]
    6. 分别解压并安装 3个必须的文件,在安装过程中如果觉得安装失败想删除重新开始 只要查找 whereis apr 或apr-util或pcre 然后 rm -rf 掉找到的目录即可
      1. 安装apr
      2. tar -xf apr-1.5.0.tar.gz
      3. cd apr-1.5.0
      4. ./configure --prefix=/usr/local/apr
      5. make
      6. make install
      7. 安装 apr-tuil
      8. tar -xf apr-util-1.5.3.tar.gz
      9. cd apr-util-1.5.3
      10. ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
      11. make
      12. make install
      13. 安装pcre 
      14. 注:linux下安装安装pcre可能错误  configure: error: You need a C++ compiler for C++ support  解决办法:yum install -y gcc gcc-c++
      15. tar -xf pcre-8.35.tar.gz
      16. cd pcre-8.35
      17. ./configure --prefix=/usr/local/pcre
      18. make
      19. make install
    7. 安装完后 可以看一下ls /usr/local 目录下 多出 apr, apr-util,pcre  3个文件夹
    8. 这时再进入httpd-2.4.9目录 ./configure --prefix =/usr/local/apache2 --with-pcre=usr/local/pcre   我是这么执行的 如果说找不到apr 或者 apr-util 可以用 --with-apr =/usr/local/apr  --with-apr-util =/usr/local/apr-util 来指定.
    9. make
    10. make install
    11. 安装完成后 /usr/local 目录下 多出apache2文件夹。
    12. cd /usr/local/apache2/bin  启动apache    ./apachectl start
    13. 注:启动apache时可能错误:Could not reliably determine the server`s fully qualified domain name 这个貌似不影响启动 解决办法是 修改 apache2/conf/httpd.conf 文件 找到ServerName 所在行解除#号注释 并修改ip地址 或 直接添加一行ServerName  localhost:80
    14. 最后访问 http://ip地址  出现

      It works!

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值