Question

Restarting Apache Server - Ubuntu

Posted February 11, 2015 74k views

I tried to restart

It says “Could not reliably determine the server’s fully qualified domain name. Using 127.0.0.1. Set the ‘Servername’ directive globally to suppress this message ”.

I haven’t pointed any domain to my IP yet. I am trying to restart apache is because of minor changes in php.ini file.

How can I restart apache2 successfully ? or How to make php.ini changes to work.

3 comments

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

×
6 answers

To fix that problem, you need to create an httpd.conf file.

From the terminal:
sudo nano /etc/apache2/httpd.conf
the file will be blank…add the following line:

ServerName localhost

Save the file and exit nano.(I think it is crtrl X in nano)

Finally restart the server.:
sudo service apache2 restart

Just had the same issue, resolved it by following sierracircle’s instructions except that I edited this file:

sudo nano /etc/apache2/apache2.conf

Hmm, that did not work for me. I tried localhost, the IP address of my server, and the domain for that server. No luck.

I’m wondering if sierracircle isn’t being specif enough about the apache directive ServerName. Does it need to be in some sort of xml block or something?

how to restart server?

sudo service apache2 restart

Submit an Answer