#Intro# This project makes it simple and quick to set up an Apache module development environment. It uses Vagrant to create an Ubuntu VM that has all the required build tools to create and debug Apache modules.
- install Oracle's VirtualBox. This is used by Vagrant to create the VM that we'll use. Here is a link to the download page
- install Vagrant. You can either download the package or install using RubyGems. If you have any problems, check the Getting Started page.
- Download the base Ubuntu VM.
$ vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
- make sure you have git installed. Github has great instructions
- clone the repo
$ git clone git://github.com/anuaimi/apache_module.git
- create the virtual machine. This will start Ubuntu and run Puppet to install the needed packages. It will also download the source to Apache.
$ vagrant up
- The Apache source is put in the shared directory (/vagrant in the VM and the current directory on your host computer) which means you can view/edit the source on your host machine and run it in the VM
- When you are ready to compile and run your module, you can ssh into the machine, follow the instruction below
$ vagrant ssh
$ cd /vagrant
sudo apxs2 -c apache-2.2.xx/modules/experimental/mod_example.c
- You can now run Apache and test out your module.
- configure apache the way that you want it
- make a copy of the module source you want to change
- use apxs2 to compile it and link it to the modules directory
- apache runtime is in /usr/lib/apache2. You'll find the module subdirectory there
- I had originally tried to install the source into the /vagrant directory so that a developer would be able to use their native OS to editor the source for the module but ran into an issue with VirtualBox not being able to symlink in a shared foler - https://github.com/mitchellh/vagrant/issues/713