At work, I had to run multiple instances of Jetty. As usual, I tried google and came upon this helpful link. From the link, I got an idea how to do it.

I use Ubuntu at work and tried to use Synaptic package manager to install Jetty. It did install Jetty but I could not get it running because of class path issues. I had both my Java home and class path set to appropriate places, but still Jetty refused to boot. So, I removed jetty using Synaptic and downloaded it manually from the Jetty site.

Once I did this, I unpacked Jetty and went to the bin directory and tried to run it using jetty.sh shell script. Voila. Jetty ran successfully. First hurdle passed.

Now, I tried to run multiple instances of jetty using the command ./jetty.sh start ../etc/jetty1.xml ../etc/jetty2.xml. This did not work. A little bit poking round and I saw the start.jar. I tried to run Jetty using java -jar start.jar ./etc/jetty1.xml ./etc/jetty2.xml. Voila. Now, I had two running instances of jetty.

Advertisements