Saturday, September 19, 2009

Moving VirtualBox to a new machine

1) Copy the hard disk to the new machine.
2) Register it in VB (File->Virtual Medial Manager)
3) Create a new machine with the same name AND select the above HD for it and check settings (I had to change System-Processor->Enable PAE/NX + Network to Bridged).
4) If eth0 is gone!
Edit the file /etc/udev/rules.d/70-persistent-net.rules
Delete the line with eth0 and change eth1 to eth0.
Restart :)

Wednesday, September 9, 2009

Setting apache in front of tomcat

1) install apache, tomcat, php5 (not required for this, but is good), mod_jk (sudo apt-get install libapache2-mod-jk)

2) create workers.properties file with
# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009

3) add in httpd.conf
JkWorkersFile /etc/apache2/workers.properties

JkMount /ihzh/* worker1
OR
in the sites-available/webapp (if in tomcat)
JkMount /* worker1

Now if apache can be accessed on: http://host/
ihzh (running on tomcat) can be accessed on: http://host/ihzh/ (last "/" is important!).