Apache2 Restart Error

simran@pplaystation:~$ sudo /etc/init.d/apache2 restart

* Restarting web server apache2 apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName
… waiting apache2: Could not reliably determine the server’s fully qualified domain name, using 127.0.1.1 for ServerName

To fix this problem, I edited the apache2.conf file. Opened the terminal and typed,

$ sudo vim /etc/apache2/apache2.conf

By default apache2.conf file will not contain the server name. Now, simply add the following line to the file.

ServerName localhost

Save the file and exit from vim. Finally restart the server.

$ sudo /etc/init.d/apache2 restart

And this worked.

Here, one thing is important to know that the layout of apache2 is quite different from the standard Apache configuration. Due to the use of environment variables, apache2 needs to be started/stopped with ‘/etc/init.d/apache2’, apachectl, or apache2ctl. Calling ‘/usr/bin/apache2’ directly will not work with the default configuration. To call apache2 with specific command line arguments, just call apache2ctl with the same arguments.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s