Saturday, November 17, 2007

Multiple Concurrent Servers - A reality !!

When I wrote my last post, I really wasn't sure if I would be able to run multiple servers on my system concurrently. I made three attempts between my last post, and about 19:30. And those attempts all resulted in failure. But as they say, "When things seem evermore difficult, you are really close to solving the problem". And solve I did.

How? No Googling, for a change !! Just plain common sense (of a techie, ofcourse) (jeez, i m getting vain)

So here's the change you make to your router settings that I already mentioned in my previous post. Under Virtual Server, change the Local port from 8080 (or whatever else) to 0 (zero) A zero number means forward all requests. Do not forget to Save and Reboot.

Then, set the different listening ports for your multitude of servers. I havnt figured out a way of changing Tomcat's port, so I let it remain 8080. I thought it safe to keep IIS on the default (80) port. But I changed the Java Application Server and Apache HTTP as follows:

For Sun Java:
  1. Go to localhost:4848 (or whatever administrator port u've set up)
  2. Login with the administrative username and password (which you must have noted down)
  3. Go to Configuration > HTTP Service > HTTP Listeners > http-listener-1 > Listener port.
  4. Enter a random port address between 1025 to 65535. I prefer 5282 (JAVA on ur mobile phone keypad) as it is easy to remember
  5. Save and Logout.
For Apache HTTP:
  1. Go to C:\Program Files\Apache Software Foundation\Apache 2.2\conf\httpd.conf (or whatever is the equivalent conf directory on your system)
  2. You can open the file with notepad
  3. Look for the text Listen
  4. Change the number after that (should be 8080, or 80, before you make the changes) to any number of your choice (between 1025 and 65535)
  5. I chose 9393, just like that
  6. Save the file and close.
Restart your PC and your router. Once everything is up, start all your servers. In this case:
  1. http://localhost/
  2. http://localhost:8080/
  3. http://localhost:5282/
  4. http://localhost:9393/
Thats it. Go to your friend's place (it would be wiser to just call him up, and do the needful). Retrieve your IP address, for example, 59.182.147.56. Ask someone to type the following in simultaneously open browser tabs (or windows, in case the jerk of a friend still uses IE6, not Firefox):
  1. http://59.182.147.56/
  2. http://59.182.147.56:8080/
  3. http://59.182.147.56:5282/
  4. http://59.182.147.56:9393/
If all works fine, your jerk...oops...i mean friend, should get the default pages (or the index, in case you've put something there) for each of those servers.

Whew. Finally, I achieved what I set out to achieve. Now I can R.I.P. May god bless my soul. I don't think I'll be posting anytime soon. Cya until then.

No comments: