Apache2重启问题

时间:2015-09-02 05:33:21

标签: apache ubuntu-14.04

我使用的是Ubuntu 14.04。我试图在我的终端上重启Apache,但它给了我以下错误:

sneha@SCS-I82:~/work/sample_app(master)$ sudo /etc/init.d/apache2 restart
 * Restarting web server apache2                                                                                                                (98)Address already in use: AH00072: make_sock: could not bind to address [::]:8080
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                                                                                                                         [fail]
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

还尝试使用以下命令,但仍然存在同样的问题:

sneha@SCS-I82:~/work/sample_app(master)$ sudo service apache2 restart
 * Restarting web server apache2                                                                                                                (98)Address already in use: AH00072: make_sock: could not bind to address [::]:8080
(98)Address already in use: AH00072: make_sock: could not bind to address 0.0.0.0:8080
no listening sockets available, shutting down
AH00015: Unable to open logs
Action 'start' failed.
The Apache error log may have more information.
                                                                                                                                         [fail]
 * The apache2 instance did not start within 20 seconds. Please read the log files to discover problems

我还在/etc/apache2/apache2.conf文件的底部添加了ServerName localhost。 我还在/etc/apache2/ports.conf文件中将端口更改为8080。

有人可以为此建议一些解决方案。

1 个答案:

答案 0 :(得分:2)

其他一些进程已经在端口8080上侦听。您可以通过运行类似以下内容来找出哪个进程:

var y = (from c in db.Table
         where c.Date.Value.Month == 5
         select c).ToList();

否则您可以将端口从8080更改为未使用的端口。