Tweet
Bookmark this on Delicious
This series of tutorials aim to teach you how to install an Apache Server on Linux from source (that is by compiling the source code of the Apache server yourself). For the purpose of this article, we will be working on a platform running Ubuntu 10.04, but essentially any version of Linux will do (the process changes little, and provided you know a few basic Linux commands you will be able to adapt the following).
There are advantages and disadvantages to compiling an Apache server from source.
Advantages
Compiling an Apache server from source allows you to:
We will be downloading the Apache server source code directly from the Apache website (http://www.apache.org/) and install an Apache server directly on the desktop.
1) Go to the Apache website
2) Go to the download section
3) Select a mirror and download the source code of the Apache server
4) Under the directory httpd, select the file /httpd-2.3.14-beta.tar.gz in order to get the source code for the version 2.2.19 of Apache - the last stable version at the time this Linux tutorial was written)
5) Save this file on your desktop (for testing purpose only; when you really set up your own functional Apache server, it is recommended that you choose safe and appropriate installation paths) and unzip its content there. You should now have a folder named httpd-2.2.19 on your desktop.
N.B.: you can verify the MD5 checksum of the archive before unzipping it, if you are paranoid
Next tutorial: Installing an Apache server on Linux - Compiling your Apache server
Back to computer forums
Installing an Apache server on Linux - Compiling from Source - Introduction
This series of tutorials aim to teach you how to install an Apache Server on Linux from source (that is by compiling the source code of the Apache server yourself). For the purpose of this article, we will be working on a platform running Ubuntu 10.04, but essentially any version of Linux will do (the process changes little, and provided you know a few basic Linux commands you will be able to adapt the following).
Installing an Apache server on Linux - Compiling from Source - Why compile Apache from source ?
There are advantages and disadvantages to compiling an Apache server from source.
Advantages
Compiling an Apache server from source allows you to:
- Fully configure every aspect of your server: in particular, you will have full control over what exactly is compiled (which modules), which will allow you to avoid overloading your Apache server with unnecessary modules. This in turn means improved security (because security decreases when the number of added modules increases). In other words, you will compile an Apache server containing only these modules that will be necessary for your websites. This also means increased efficiency, because these modules compiled directly with the server often run more efficiently than those added as an external dependency (.so files). On average, you will save 20% speed at startup time and 5% speed at execution time if you compile your Apache modules directly with the server as opposed to link to these as shared libraries (more about this at http://httpd.apache.org/docs/2.2/dso.html)
- Become aware of how your Apache server works and what it really takes to run it: you will then be more aware of the security aspects and will be able to respond more quickly when your website fails (you will be able to identify the origin of a server failure and repair an Apache server without having to rely on external work, which is both expensive and insecure)
- Increased administrative work: the main drawback with compiling your Apache server from source is the increased administrative duties that come with it: indeed, since most Apache modules will be compiled directly with the server, you will need to recompile that one every time an Apache update is needed (provided it affects a compiled Apache module)
Installing an Apache server on Linux - Compiling from Source - Downloading your Apache server source code
We will be downloading the Apache server source code directly from the Apache website (http://www.apache.org/) and install an Apache server directly on the desktop.
1) Go to the Apache website
2) Go to the download section
3) Select a mirror and download the source code of the Apache server
4) Under the directory httpd, select the file /httpd-2.3.14-beta.tar.gz in order to get the source code for the version 2.2.19 of Apache - the last stable version at the time this Linux tutorial was written)
5) Save this file on your desktop (for testing purpose only; when you really set up your own functional Apache server, it is recommended that you choose safe and appropriate installation paths) and unzip its content there. You should now have a folder named httpd-2.2.19 on your desktop.
N.B.: you can verify the MD5 checksum of the archive before unzipping it, if you are paranoid
Next tutorial: Installing an Apache server on Linux - Compiling your Apache server
Back to computer forums
