CentOS 6.5安装apache详细步骤

发布时间:2019-12-12编辑:脚本学堂
本文介绍了CentOS 6.5安装apache服务器的具体步骤,centos下apache安装教程,需要的朋友参考下。

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
 

复制代码 代码示例:

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
启动
./apachectl start
出现httpd: Could not reliably determine the server's fully qualified domain name, using localhost.local
解决/usr/local/apache/conf/httpd.conf
#ServerName www.example.com:80   (去掉前面的注释即可)
修改成ServerName 192.168.36.130:81

停止 :
./apachectl stop

以上介绍了centos 6.5中apache的安装过程,希望对大家有所帮助。