Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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...

share|improve this question
Did you already try "apache2ctl restart" (without quotation marks)? – Geppettvs D'Constanzo 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. – Florian Diesch 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?

share|improve this answer
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 posting your answer, you agree to the privacy policy and terms of service.

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