When i enter command

admin@ubuntu:~$ sudo /etc/init.d/apache2 restart
[sudo] password for admin: 

I get this msg

Syntax error on line 3 of /etc/apache2/conf.d/fqdn:
Invalid command 'echo', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.

Please tell me how i restart my apache2 server...

  • Did you already try "apache2ctl restart" (without quotation marks)? Sep 8 '12 at 17:25
  • You first need to fix the syntax error in file /etc/apache2/conf.d/fqdn. Please edit your question and include that file if you need help with that. Sep 8 '12 at 17:29

Apparently, you have a syntax error in a config file. The first step would be to look at /etc/apache2/conf.d/fqdn to see what it says, and perhaps post the contents of the file if you need help. You can check this file with a text editor, or use cat or less (ie gedit /etc/apache2/conf.d/fqdn).

FYI, this file stands for "Fully Qualified Domain Name", and is normally a single line with something like this:

ServerName localhost

That should be all that is necessary for a home server. Did you change this file?

  • contents of the fqdn file is:ServerName localhost echo "ServerName localhost" | sudo tee /etc/apache2/conf.d/fqdn
    – Yash
    Sep 13 '12 at 15: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.