源代码编译安装apache启动报错
问题1:
httpd: apr_sockaddr_info_get() failed for crushlinux1.com
httpd: Could not reliably determine the server's fully qualified domain name, using 127.0.0.1 for ServerName
httpd not running, trying to start
[root@crushlinux1 local]# cd /usr/local/httpd/conf/
[root@crushlinux1 conf]# vi httpd.conf
97 #ServerName www.example.com:80
98 ServerName localhost:80
重新启动apache
[root@crushlinux1 conf]# /usr/local/httpd/bin/apachectl start
[root@crushlinux1 conf]# ps -aux |grep httpd
[root@crushlinux1 conf]# netstat -anptu |grep "httpd"
问题2:
/usr/local/apache/bin/httpd: error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
有很多so模块在/usr/local/lib目录下,所以在/etc/ld.so.conf中加入/usr/local/lib这一行
[root@crushlinux1 conf]# vi /etc/ld.so.conf
/usr/local/lib
[root@crushlinux1 conf]# /sbin/ldconfig -v
现在您已经将 Apach安装在 /usr/local/apache。本安装支持可装载模块
和标准的 MPM prefork。之后,可以使用如下命令启动 Apache 服务器:
[root@crushlinux1 conf]# /usr/local/httpd/bin/apachectl start