Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

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
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.