centos 6.5安装apache的简单步骤

发布时间:2019-09-06编辑:脚本学堂
本文介绍了centos 6.5系统下安装apache服务器的方法,安装依赖包,安装httpd,修改端口信息等,需要的朋友参考下。

centos 6.5安装apache具体步骤:

1、安装依赖包
 

tar zxvf apr-1.5.0.tar.gz
tar zxvf apr-util-1.5.3.tar.gz

cd apr-1.5.0

./configure --prefix=/usr/local/apr
make
make install

cd apr-util-1.5.3

./configure --prefix=/usr/local/apr-util --with-apr=/usr/local/apr
make
make install

2、安装httpd
 

yum install -y gcc gcc-c++  #如果没有装c++
tar zxvf pcre-8.33.tar.gz
tar zxvf httpd-2.4.7.tar.gz

cd pcre-8.33

./configure --prefix=/usr/local/pcre
make
make install

cd httpd-2.4.7

./configure --prefix=/usr/local/apache --enable-so --enable-dav --enable-dav-fs --enable-mnaintainet-mode --with-apr=/usr/local/apr --with-apr-util=/usr/local/apr-util --with-pcre=/usr/local/pcre
make
make install

3、换端口
vi /usr/local/apache/conf/httpd.conf
将80端口换成81端口
 

cd /usr/local/apache/bin

启动apache服务器
 

./apachectl start
 

出现httpd: Could not reliably determine the server's fully qualified domain name, using localhost.local

解决方法:
vim /usr/local/apache/conf/httpd.conf
 

#ServerName www.example.com:80 (去掉注释即可)

修改为:
 

ServerName 192.168.36.130:81

停止apache服务器:
 

./apachectl stop