Apache 编译安装

# wget http://www.apache.org/dist/httpd/httpd-2.2.9.tar.gz  (此处我是直接用的下载好的包)
# tar -zxvf httpd-2.2.9.tar.gz
# cd httpd-2.2.9
# ./configure --prefix=/usr/local/httpd --enable-mods-shared='proxy proxy_ajp proxy_balancer'
# make

报错 make: *** 没有指明目标并且找不到 makefile。 停止。

经网上查找原因为 没有安装gcc 

run yum -y install gcc

然后再运行(下面这三步运行时间比较长)

./configure --prefix=/usr/local/httpd --enable-mods-shared='proxy proxy_ajp proxy_balancer'

make

make install

然后启动apache : cd /usr/local/httpd/bin ->./apachectl start

报错:Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName

解决:vi /usr/local/httpd/conf/httpd.conf

加入一句 ServerName localhost:80

再一次执行 cd /usr/local/httpd/bin ->./apachectl start

运行成功

但是输入http://192.168.0.101 还是无法访问

最后关闭防火墙:service iptables stop

在浏览器输入http://192.168.0.101 

小插曲:

最开始虚拟机连不上网 没办法用yum 安装make 采用rpm命令安装的make命令

下载make-3.81-19.el6.i686.rpm

运行:rpm -ivh make-3.81-19.el6.i686.rpm

posted @ 2015-01-07 01:53  alicean  阅读(239)  评论(0编辑  收藏  举报