2

I also tried to add webserver localhost to this file sudo nano /etc/apache2/apache2.conf and got this output when I tried to restart 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!

Below is what was in the sudo nano /etc/apache2/conf.d/fqdn file:

webserver localhost

I then got this output:

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.

...fail!

Below is what was in the apache error log:

[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

How can I resolve this issue?

0

The line

webserver localhost

is invalid. You have to remove it.

Use ServerName if you want to set the FQDN:

ServerName localhost
  • I did that and then ran this command with this output: ubuntu@webserver:~$ sudo /etc/init.d/apache2 restart * Restarting web server apache2 ... waiting Is this expected? I still can't view the "It works!" from the local host in the web browser. – Joe Mar 28 '14 at 20:05
  • The config seems to be fixed but Apache is waiting for something when starting. See if there's something about that in the log files. – Florian Diesch Mar 28 '14 at 20:21
  • This is what's currently in the log: [Fri Mar 28 19:46:02 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations [Fri Mar 28 19:48:30 2014] [notice] caught SIGTERM, shutting down [Fri Mar 28 19:48:31 2014] [notice] Apache/2.2.22 (Ubuntu) PHP/5.3.10-1ubuntu3.10 with Suhosin-Patch configured -- resuming normal operations – Joe Mar 28 '14 at 20:29

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.