`

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
启动
./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
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics