Building an Apache Web Server

Introduction

(Update: This article uses Ubuntu as its base O/S. If you’d prefer an Apache server built on Centos/RHEL/Scientific Linux, then many of the steps described here still apply, but this article is C/R/S-specific).

This site is more usually noted for having assorted tips on running Oracle database servers -so it’s perhaps a bit of a surprise to find on it an article all about building an Apache web server.

The fact is, however, that I find having a web server around extremely useful when it comes to installing and maintaining an Oracle server.

Firstly, it can serve up Kickstart configuration files so that my operating systems are always installed in a minimal and standardized fashion. Secondly, it’s handy to be able to download the Oracle software ISOs from the newly-built database server without having to venture out, sometimes slowly, onto the real Internet and visit the official Oracle download sites. Third, if I install something like WordPress, Drupal or -simplest of all- TiddlyWiki, then I can have easy access to a convenient system documentation mechanism. Configuration quirks, tips, code samples and the like can all be stored in a place that is both private and yet readily-accessible -all you need is a browser and an IP address! Finally, it’s handy to be able to query the database via languages like PHP or Python -and both need a web server to work their magic.

So that’s what this article is about and why I wrote it. I’m not an Apache expert, so take what you read here with the usual tablespoon-fulls of salt. But if you follow along, and then do the same for the other articles in this series, I think you’ll find it interesting, fun and -ultimately- quite productive.

I suppose I should mention in passing that if you’re a die-hard Windows user, you can still install Apache on that O/S -though since XP, Vista and 7 all ship with IIS capabilities anyway, I don’t really see the point. In any case, not much of this article will be relevant to a Windows-using would-be Apache user. :-(

Resource Requirements

I think the main thing I want from my web server is that it should hardly be there! I don’t have a need for a 64-bit megalith with oodles of RAM and multiple CPUs …and, happily, with Apache none of those things are required, either. My Apache servers are all built as follows:

  • 32-(bit x86)
  • 128MB RAM
  • 15GB Hard Disk
  • 1 CPU (single thread)

You might be a little surprised at the hard disk requirements there: 15GB is way more than Apache itself actually needs after all. But I’m going to use my web server to host my Oracle database software -that’s about 2.2GB for the Windows version of 11gR2 and 2.3GB for the Linux version. Start adding in the client software or the gateways and it starts to mount up. Additionally, if I start using things like WordPress or Drupal to document things, the content could get quite bit (especially if I store things like screenshots). So I’m planning for growth and 15GB seems a reasonable amount for that!

Obtaining the Software

The only software you’ll need to download ahead of time is Ubuntu 32-bit Server (from here). Make sure you only download the 32-bit version, even though that site says the 64-bit one is recommended (for these purposes, 64 bits are over-complicated and over-kill). At the time of writing, I’m using version 10.04.2, because it’s the last LTS (Long Term Support) version that’s available. If you want to use 11.04, that works with these instructions, too… but I can’t vouch for any other versions you may wish to use.

Incidentally… why Ubuntu? Simply because it’s the smallest, lightest distro I can think of on which to install and run Apache effectively. If you’d prefer a different distro, feel free: but you’re on your own at that point! This ‘lightness’ and smallness is the main reason, too, for using the server version of Ubuntu, rather than the more usual desktop version. It means there’s no graphical interface once it’s all installed, so you’d better get used to the command line …but with no GUI to deal with, you can save yourself about a gigabyte of RAM requirements!

Virtualisation Software

The only other bit of software you might want is some form of virtualization: after all, you don’t tend to find too many physical PCs or Servers shipping with 128MB of RAM these days! It’s much easier to carve out a 128MB virtual machine from some RAM-laden physical behemoth -although if you happen to have an ancient physical PC sitting around doing nothing, though, feel free to make use of it.

There are two zero-cost desktop virtualization solutions I’d recommend: VMware Player or Oracle VirtualBox. I’m going to suggest you use VirtualBox, simply because it’s got snapshot capabilities (i.e., you can capture the state of a virtual machine at any time and then revert to that state should you screw something up badly!) VMware’s freebie lacks that capability, though it’s otherwise an excellent desktop virtualization offering. (I suppose the only other problem with VMware is that it requires registration before you can download it, which is probably more hassle than it’s worth). If you use other virtualization software than VirtualBox, that’s fine… but some of my instructions and screenshots won’t make a lot of sense outside of the VirtualBox context!

If your physical PC is running Linux, you can probably (depending on your distro) install VirtualBox via your normal software repositories. If your running Windows of some kind (personally, I’m running Windows 7 64-bit), just download the relevant software installation package, double-click and follow the install wizard: you can just accept all the default options, so it’s really just a question of clicking the [Next] button every time. You will probably have to reboot once the installation is complete, but that’s about as tricky as it gets.

I should maybe just mention that my virtual machines are running on a vintage 2006 physical host with nothing more than 4GB of RAM and an ancient 2.4GHz dual-core CPU. You really don’t need the latest and greatest home PC to run Apache+Oracle, so long as it’s got a decent amount of RAM (and lots of free space on its hard disk).

One thought on “Building an Apache Web Server

  1. Pingback: Installing Apache on centos 6 | DIASPAR WAS NOT ALWAYS THUS

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>