Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Moved legacy content out.

...

Sometimes you may get back more than one IP address if you have more than one Ethernet card. If you are unsure, just try them one at a time in the next step. In this case mine is 173.203.126.225.

Then launch Launch a browser and enter your ip address into the browser.

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

Stopping, Starting, Restarting and Reload

...

Code Block
languagebash
hostname 
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 Jan 3, 2015 and recent build of Ubuntu 14.04 and Apache 2.4.7 the recommendation to to include Adding an entry into the Global Configuration .This method ensures that the change will persist even if Apache is upgraded,

Code Block
languagebash
# create the configuration file in the "available" section
echo "ServerName localhost" | sudo tee /etc/apache2/conf-available/servername.conf
# enable it by creating a symlink to it from the "enabled" section
sudo a2enconf servername

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"

This concept has changed over time and look here for legacy versions of Apache.

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"

...

Basic Server Hardening

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

...

I found that you can save (according to htop about 3MB ) of memory if the status apache module is disabled,

Code Block
languagebash
sudo a2dismod
Your choices are: alias auth_basic authn_file authz_default authz_groupfile authz_host authz_user autoindex cgid
                  deflate dir env filter jk mime negotiation proxy proxy_http rewrite setenvif status substitute
Which module(s) do you want to disable (wildcards ok)?
status
Module status disabled.
To activate the new configuration, you need to run:
  service apache2 restart
sudo service apache2 restart
Info

 

That is for now. I might flush this section out a bit more later. Surprisingly, the default Apache configuration is very robust that I rarely need optimization. Instead, we focus optimization efforts on application servers which usually give us the biggest improvements.

References

http://cloudservers.mosso.com/index.php/Ubuntu_-_Apache_configuration#Security_Settings - Rackspace wiki on hardening Apache Web Server.