Currently I am working with vmware. I want to be flexible in reconfiguring my server without constantly having to re-install. Next to that I like it that I can configure my complete server and then move it to the production server. I am also looking into virtualization for the production server. Some of my collegues are also looking at it, and it looks very promising.

Ofcourse when using a new technique, you will be facing some problems. Within this blog I will explain my idea and the solution that I created.

Demand
I want an environment where I am able to install new servers on demand. I want to be able to have a continuous intergation server, a test server, a quality assureance server and of course a production server. If I go to my management and tell them I need 4 servers to start with they will not like it. It is better to ask for one big server and use vmware. Next to that I am very flexible in moving around servers. I can configure the server locally and put it on the host server if I am done. In the end there will be almost no downtime for testers etc.
Oke, that point should be clear now. There is another thing. I do not want to expose all virtual servers to the clients. This could lead to a lot of firewall rules, ip addresses to remember or dns entries. I want to be flexible. That is why I want a proxy in front of the virtual machines. This proxy is installed on the host machine and redirects to virtual machines.

Solution
The following image shows the complete picture in a deployment diagram

deploymentdiagvmware

This diagram shows the host server that is running windows 2003 server edition. This server can be reached using a vpn and remote terminal client. Within this server we have vmware running with two images. One image for continuous integration and the maven reports, the second image contains apache tomcat with our deployed application.

First we install the linux virtual machines. I took a pre configured ubuntu installation:
http://www.thoughtpolice.co.uk/vmware/
After that I needed to install java, tomcat,continuum,apache2, ssh. It surprised my how easy this is nowadays. As an example, the next command downloads and configures ssh on the server.

$ sudo apt-get install ssh

It cannot get more easy than this. Simular steps were necessary for the other components. One other I want to mention is downloading the continuum jar. This is done with a command called wget.

$ wget http://www.apache.org/dyn/closer.cgi/maven/binaries/continuum-1.0.3-bin.tar.gz

Again, very easy. If you want to have more information, these websites helped me figuring out the right commands:
http://www.kintespace.com/rasxlog/?p=468
http://www.spaceprogram.com/knowledge/2006/05/installing-java-5-jdk-and-tomcat-on.html

Now you want to install and configure the apache 2 http server. Installation is not that difficult on most systems. You need to include the proxy module for apache. This can be done with the command

$ sudo a2enmod proxy

The final part is configuring the proxy, therefore you must add the following lines of code to the file /etc/apache2/mods-enabled/proxy.conf

ProxyPass /ci http://192.168.93.130/continuum
ProxyPassReverse /ci http://192.168.93.130/continuum

ProxyPass /naboo http://192.168.93.130/naboo
ProxyPassReverse /naboo http://192.168.93.130/naboo

ProxyPass /test http://192.168.93.130:8080/scheduling
ProxyPassReverse /test http://192.168.93.130:8080/scheduling

It is not the best step-by-step approach I have created, still I thing this will do. If you are have questions, use the comments. If you want more information about the mod_proxy module have a look at this website:
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html

Using vmware and apache http server as a proxy