Centos Apache安装

Apache安装:下载地址:http://httpd.apache.org/download.cgi


apache需要先安装依赖包apr、apr-util、pcre


apr、apr-util下载地址:https://apr.apache.org/download.cgi

pcre下载地址:http://blog.csdn.net/wangjunjun2008/article/details/38314387


tar -zxvf apr-1.5.2.tar.gz
cd apr-1.5.2
./configure --prefix=/usr/local/apr
make && make install
tar -zxvf apr-util-1.5.4.tar.gz
cd apr-util-1.5.4
./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr/bin/apr-1-config 
make && make install
tar-zxvf pcre-8.40.tar.gz
cd pcre-8.40
./configure --prefix=/usr/local/pcre
make && make install

 完成依赖包安装后,安装apache:

tar-zxvf httpd-2.4.10.tar.gz
cd httpd-2.4.10
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre --with-ssl=/usr/local/ssl --enable-so --enable-ssl --enable-mods-shared=all  --enable-cache   --enable-disk-cache   --enable-file-cache  --enable-mem-cache  

 安装完成后

./usr/local/apache/bin/httpd -k start

Usage: ./httpd [-D name] [-d directory] [-f file]
               [-C "directive"] [-c "directive"]
               [-k start|restart|graceful|graceful-stop|stop]
               [-v] [-V] [-h] [-l] [-L] [-t] [-T] [-S] [-X] 

访问机器所在IP,出现It works的界面,即表示Apache安装成功

httpd: Could not reliably determine the server's fully qualified domain name, using ::1 for ServerName 的原因参考下面链接的解答:

http://stackoverflow.com/questions/5856205/starting-httpd-httpd-could-not-reliably-determine-the-servers-fully-qualified

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值