Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Apache 2.x is now installed.

Warning

in In the tomcat section, we discuss installation using the serveradmin id, how about  installing about installing apache ? as serveradmin or staff user?

If you load up your browser and type in the ip IP address of your server you will see a simple page letting you know Apache is working.

Provide Server Name

Apache is working fine, but during restart you will get the warning message, "apache2: Could not reliably determine the server's fully qualified domain name, using ...".

Most websites have a domain name attached to them. Apache is looking for this on start-up. There actually is not much documentation on exactly what is happening here. If you happen to know then please let me know via comments on this page. Based on my reading here is how to resolve the error.

As of June 5, 2012 I believe that with the more recent build of Ubuntu 12 and Apache 2.2.22,

Code Block
langbash
# Fix this, it should be ServerName hostname
sudo bash -c "hostname >> /etc/apache2/conf.d/name"
Note

The following will also work too, though I think that localhost may or may not be as desirable depending on if you get the server status name... look into this later,

Code Block
langbash
sudo bash -c "'localhost' >> /etc/apache2/conf.d/name"

With older versions of Apache and Ubuntu (I need to track down where this change) you can instead (still to determine if conf.d/name would still work) use httpd.conf,

Code Block
languagebash
sudo bash -c "hostname >> /etc/apache2/httpd.conf"

Test

Verify that the Apache Web Server is running first by hitting your server's IP Address. If you do not know your ip address, at the console type,

...

You should see a webpage show up saying "It works!".

Provide Server Name

Apache is working fine, but during restart you will get the warning message, "apache2: Could not reliably determine the server's fully qualified domain name, using ...".

Most websites have a domain name attached to them. Apache is looking for this on start-up. Depending on the version of Apache and Ubuntu this can be resolved by adding the ServerName Directive with the hostname of the server into the file name or httpd.conf.

Expand
titleSide Note...
There actually is not much documentation on exactly what is happening here. If you happen to know then please let me know via comments on this page. Based on my reading here is how to resolve the error.

As of June 5, 2012 the more recent build of Ubuntu 12 and Apache 2.2.22 add an entry into the file called name,

Code Block
langbash
sudo echo "ServerName $(bash -c "hostname")" >> /etc/apache2/conf.d/name"

Restart Apache to confirm you do not get the warning messages,

Code Block
langbash
sudo service apache2 restart

With older versions of Apache and Ubuntu (I need to track down when this changed) I traditionally (still to determine if conf.d/name would still work) add the entry to httpd.conf,

Code Block
languagebash
sudo echo "ServerName $(bash -c "hostname")" >> /etc/apache2/httpd.conf"

Apache Basic Server Hardening

Here are some of the basic hardening steps I take today.

...