Apache is easy to install on Windows, see Apache 2.2 installation on Windows XP, andcan be more difficult on Linux. This page will help you install Apache on Ubuntu Linux, specifically Ubuntu 11.4. The same steps should work on other versions of Ubuntu from 10.4 onwards.
This page uses the Gnome user interface. All these steps are hidden somewhere in Unity and the other user interfaces available in Ubuntu.
Select Applications then Ubuntu software centre. Search for apache2 in the search box at the top right corner of the software centre. You should find Apache HTTP Server metapackage with a subtitle of apache2. Install the package by selecting the Install button.
The download and installation takes about two minutes on broadband and a slow netbook. The download is 3.2 MB and that will expand to 12 MB on disk. If the documentation is installed, you can delete the documentation to save space.
How do you test Apache? Visit http://localhost. You should see the following Web page.
It works!
This is the default web page for this server.
The web server software is running but no content has been added, yet.
Add-on modules
The package contains some, but not all, of the optional add-on modules for Apache. The Windows version works for Web development without adding anything else on. The Linux versions usually require some extras and finding the required extras can be difficult. A search in the Ubuntu software centre will find some while others will be in packages with strange names.
Configuration files
The Apache configuration files are in /etc/apache2 and you will have to perform strange Linux acrobatics to get past security and update the files. Apache files can include other files. The first thing you do is set up a configuration file in your web directory and include that in the Apache config file. You can then update your own file at any time using any method you like.
Your own directory is usually /home/ followed by your login name. If your login name is peter then your home directory is /home/peter. Create your own Web directory named /home/peter/web.
The main Apache configuration file is /etc/apache2/apache2.conf. Find a way to edit the file and add the following lines at the end, changing peter to your name.# Include my virtual host configurations:
Include /home/peter/web/apache.conf
Web sites
Apache defaults to defining web sites in /var/www, a location that is useless for your test Web sites. Use your own configuration file to define your own web sites in your own web directory.
Your own directory is usually /home/ followed by your login name. If your login name is peter then your home directory is /home/peter. Create your own Web directory named /home/peter/web









- Facebook Like
- Google Plus One
- Log in or register to post comments