(20014)Internal error: Error retrieving pid file logs/httpd.pid
Remove it before continuing if it is corrupted.
其实这个错误就是因为Apache目录下的 logs 子目录下的 httpd.pid 文件内容是空的。这个文件是记录进程ID的文件。因为这个文件是空的,就无法启动,实在是超雷人。你随便写点数字进去,再启动Apache,就可以成功了:
[root@piaoyun ~]# more /usr/local/apache2/logs/httpd.pid
这个文件是空的,肯定是有问题的,增加一个数据试试!
[root@piaoyun ~]# echo "1234">>/usr/local/apache2/logs/httpd.pid
[root@piaoyun ~]# more /usr/local/apache2/logs/httpd.pid
1234
再次重启apache
[root@piaoyun ~]# service httpd start
这次ok了,继续查看/usr/local/apache2/logs/httpd.pid
[root@piaoyun ~]# more /usr/local/apache2/logs/httpd.pid
3092
可以看到,apache启动成功后,已经自动获得了一个pid值,看来apache启动的时候是会去读这个httpd.pid文件的,如果这个文件为空,就抛错了。