在Linux服务器上安装Apache 2

时间:2015-12-09 14:48:26

标签: linux apache

我已将侦听端口修改为8080.但是当我运行' apachetcl start'时,错误消息仍然显示为:

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1. Set the 'ServerName' directive globally to suppress this message
(98)Address already in use: AH00072: make_sock: could not bind to address [::]:80
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.

我还检查了Apache错误日志。

[Wed Dec 09 12:39:16.457678 2015] [mpm_event:notice]
[pid 96777:tid 139998996637568] AH00489: Apache/2.4.7
(Ubuntu) configured -- resuming normal operations
   [Wed Dec 09 12:39:16.457753 2015] [core:notice] [pid 96777:tid 139998996637568] AH00094: Command line: '/usr/sbin/apache2'

如何取消此消息?

2 个答案:

答案 0 :(得分:2)

解决这个问题:

  1. 打开/etc/apache2/apache2.conf

    返回页首:ServerName localhost

    现在关闭!

  2. OPEN /etc/apache2/ports.conf

  3. 您将看到两个80或443或8080.删除一个并保存...现在

    apachetcl start
    

    或者你可以这样做:

    sudo netstat -ltnp | grep ':80'
    
    sudo kill -9 2242
    

    然后重新启动apache2

    sudo /etc/init.d/apache2 restart
    

    然后开始

    sudo /etc/init.d/apache2 start
    

答案 1 :(得分:0)

与JM511的响应类似,但操作顺序不同。他们建议的方法是apache2使用新的进程ID重新启动自身并仍占用端口。

sudo etc/init.d/apache2 stop

sudo netstat -ltnp | grep ':80'

sudo kill -9 2178 #killed the process id of the process listening to port 80

sudo opt/bitnami/ctlscript.sh restart apache
相关问题