Ubuntu 12.04 上 apache2 重启失败

Ubuntu 12.04 上 apache2 重启失败

我还尝试将 web 服务器 localhost 添加到此文件 sudo nano /etc/apache2/apache2.conf 中,并在尝试重新启动 apache2 时得到此输出:

ubuntu@webserver:~$ sudo service apache2 restart
Syntax error on line 38 of /etc/apache2/apache2.conf:
Invalid command 'webserver', perhaps misspelled or defined by a module not included        in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
...fail!

以下是 sudo nano /etc/apache2/conf.d/fqdn 文件的内容:

webserver localhost

然后我得到了这个输出:

ubuntu@webserver:~$ sudo service apache2 restart
Syntax error on line 1 of /etc/apache2/conf.d/fqdn:
Invalid command 'webserver', perhaps misspelled or defined by a module not included   in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

...失败!

以下是 Apache 错误日志中的内容:

[Tue Mar 25 12:35:48 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Tue Mar 25 12:41:47 2014] [notice] caught SIGTERM, shutting down
[Tue Mar 25 12:41:48 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Tue Mar 25 12:44:01 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Tue Mar 25 12:53:18 2014] [notice] caught SIGTERM, shutting down
[Tue Mar 25 12:53:19 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations
[Fri Mar 28 18:19:42 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations

我该如何解决这个问题?

答案1

线路

webserver localhost

无效。您必须将其删除。

使用服务器名称如果你想设置 FQDN:

ServerName localhost

相关内容