CentOS 6.5安装apache详细步骤
时间:2014-06-22 04:48 来源:linux.it.net.cn 作者:IT网
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
(责任编辑:IT)
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 (责任编辑:IT) |