Php – Unable to restart apache2 server on ubuntu 14.04

Apache2PHPubuntu-14.04

I am trying to install PHP and apache2 in my ubuntu 14.04. I installed PHP and apache2 through the following commands

  $sudo apt-get install php5-cli
  $sudo apt-get install apache2-bin

Now I just want to restart apache2 server on ubuntu system. But I am getting the "failed" error while restarting apache2. I mentioned the error below

AH00558: apache2: Could not reliably determine the server's fully qualified domain name, using 127.0.1.1.

Set the 'ServerName' directive globally to suppress this message

Can anyone help me to solve this error?

I need to restart my apache2 server on ubuntu 14.04.

Best Answer

The problem has nothing to do with the notice you are getting Try

tail -f  /var/log/apache2/error.log

Or similar location on you system to check the Apache error log. This will clearly tell you where the error is. The most frequent one I get is that the log directory that I specified in the vhost configuration is missing

As of the notice, add

ServerName localhost

to your configuration and it will be gone. In case your hostname is not localhost run

hostname

to learn what it is and then update ServerName directive with the proper value

On ubuntu the Apache conf file is in

/etc/apache2/apache2.conf

Related Topic