Apache-rhel5.8环境下编译安装
作者:网络 软件教程库 2020-05-12
apache安装过程
step 1:安装包gcc或gcc-c++
# yum install gcc
#yum install gcc-c++
step 2:安装包apr和apr-util
apr-1.4.8.tar.gz apr-util-1.5.2.tar.gz
# tar -zxf apr-1.4.8.tar.gz
# cd apr-1.4.8
新建目录/usr/local/apr,用作安装目录:
# mkdir /usr/local/apr
# ./configure --prefix=/usr/local/apr
# make
# make install
安装apr-util
# ./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
# make
# make install
step 3:安装包prce
# cd pcre-8.33
#mkdir /usr/local/pcre
./configure --prefix=/usr/local/apache --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util
# make
# make install
step 4:安装apache http server
# tar zxvf httpd-2.4.6.tar.gz
#cd httpd-2.4.6
#./configure --prefix=/opt/data/apache2 \
--enable-so \
--enable-mods-shared=most \
--with-mpm=worker \
--with-apr=/usr/local/apr \
--with-apr-util=/usr/local/apr-util \
--with-included-apr \
--with-pcre=/usr/local/pcre \
#make
#make install
step 5:启动apache服务
#/opt/data/apache2/bin/apachectl start
用浏览器访问http://localhost时提示it works!
启动报错:
# /usr/local/apache/bin/apachectl start
ah00558: httpd: could not reliably determine the server‘s fully qualified domain name, using getlnx05.gfg1.esquel.com. set the ‘servername‘ directive globally to suppress this message
这个时候需要编辑httpd.conf配置文件,添加seravername的具体ip地址。
seravername 192.168.1.123:80
如果从其它电脑连接访问apache时,输入url地址:http://ip 页面没有显示正常,而上面配置也ok,那么你必须关闭防火墙,有时候甚至需要重启电脑才能ok,重启apache服务都无效。
# chkconfig iptables off
# chkconfig iptables off
# /usr/local/apache/bin/apachectl restart
apache-rhel5.8环境下编译安装
原文地址:http://www.cnblogs.com/rusking/p/4471409.html
本文内容由软件教程库(原文链接:https://www.itjcku.com/9999/1091362.html)本站为各位整理
推荐内容