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