Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added stopping and starting notes.

...

Apache 2.x is now installed.

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

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

Stopping, Starting, Restarting and Reload

You should know the basic commands to running Apache 2. Go ahead and try them. Note ignore the warning message about "fully qualified domain name" as that is covered in the next section.

As of Ubuntu 12, the following the basic commands to manage Apache2 are,

Code Block
langbash
sudo service apache2 stop
sudo service apache2 start
sudo service apache2 restart
sudo service apache2 reload # Somebody explain the difference. I know but don't have the energy tonight. 

Before Ubuntu12,

Code Block
languagebash
sudo /etc/init.d/apache2 stop
sudo /etc/init.d/apache2 start
sudo /etc/init.d/apache2 restart
sudo /etc/init.d/apache2 reload

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

...

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

Before Ubuntu12, use the following command to restart apache2, sudo /etc/init.d/apache2 restart

 

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.