1.错误:没有服务器名称
CentOS6下Appache启动报错:Could not reliably determine the server’s fully qualified domain name, using xx.xxx.edu.cn for ServerName
解决方法:
vi /etc/httpd/conf
修改或者添加为:ServerName localhost
:wq保存,重启:
/etc/init.d/httpd restart
2.错误:端口不能绑定
CentOS6下修改Appache端口后,重启动报错:
(13)Permission denied: make_sock: could not bind to address 0.0.0.0:8899
no listening sockets available, shutting down
解决:
SELinux安全机制的影响
方法一:停掉SELinux。vi /etc/selinux/config ,修改为SELINUX=disabled
方法二:用semanage添加相关端口,CentOS6下semanage默认没有安装,先安装
yum whatprovides /usr/sbin/semanage
yum -y install policycoreutils-python
查看已经http已经有哪些端口:
semanage port -l|grep http
添加新端口:
semanage port -a -t http_port_t -p tcp 8899
重启服务:
/etc/init.d/httpd restart