CentOS5下Apache+PHP环境搭建

一. CentOS5下安装Apahce服务器

1.      下载

下载地址:

下载以下文件:

httpd-2.2.4.tar.gz

将这个文件放入/user/local目录中,并开始安装。

2.安装

#tar zxvf httpd-2.2.4.tar.gz
#cd httpd-2.2.4
#./configure --enable-module=so --enable-dav --enable-dav-fs --enable-so --prefix=/usr/local/apache2 --enable-ssl --with-ssl --enable-track-vars --enable-rewrite --with-z-dir --enable-mods-shared=most (加上SVN模块)
#make
#make install

错误提示:在启动httpd的时候提示错误信息的,但仍可以启动成功。

Starting httpd: httpd: apr_sockaddr_info_get() failed for MYHOST
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName.

可用以下办法解决

#vi /etc/hosts
127.0.0.1 localhost.localdomain localhost MYHOSTNAME
#vi /etc/sysconfig/network
HOSTNAME= MYHOSTNAME
#vi /usr/local/apache2/conf/httpd.conf
ServerName MYHOSTNAME:80

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/ec4a5cc0918aae63543881f2167a804d.html