I am attempting to restart Apache and am getting the following message...

> devil@DEVil:/etc/apache2$ sudo /etc/init.d/apache2 restart  *
> Restarting web server apache2                                         
> AH00558: apache2: Could not reliably determine the server's fully
> qualified domain name, using Set the 'ServerName' directive
> globally to suppress this message

The solution to this problem seems to be to enter ServerName localhost into the apache2.conf file (problem restarting apache2).

When I go into this file try to alter it it won't let me save as apache2.conf is a "read only" file. How can I alter the permissions to make it writable so I can get Apache up and running?


You have to edit the file as the root user, which could be achieved by entering the command sudo in front of the command you're using to edit the file (and entering the password for your user if asked for one).

For example if you're using vim the command should be

sudo vim /etc/apache2/apache2.conf

and you could replace vim with mc, nano, pico or whatever you prefer

  • Thanks! I figured this out literally 2 seconds before you posted the answer. I used "gksu gedit". – Erik Åsland Oct 21 '15 at 18:21
  • Keep in mind that Apache is used mostly on installations without any graphical environment and gksudo and gedit might not always be available. – Sledge Hammer Oct 21 '15 at 18:30

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.