I am new to configuring Apache. I have two applications that I need to run locally, they are running on different servers - one on jboss and the other on Jetty. Now both of them use the same Apache server for serving static files.

I resolved the issues with jboss and jetty server for http port (8080) and ajp port (8009). Both the servers startup without port conflicts. Then came the configuration part for Apache.

The httpd.conf has the definition for server1 (app1 on jboss), so I added a reference to a vhostsfile and put in the configuration for server2(app2 on jetty). Problem is if I have the reference to the vhostsfile, app2 works fine but app1 never gets resolved by Apache - "The requested URL /us/en_us was not found on this server"

At first I thought perhaps I should put both server's definition in vhosts file and so I did. Put in definition for server1 below server2 but - app1 still did not load while app2 loaded as before. Requests to app1 were showing up access logs for app2.

Then in the vhosts file, I swapped the definitions i.e put server1's definition above server2, now both the apps did not load in the browser.

I hope I am not too confusing here. App1 with server1's definition only (no vhost) works. Upon adding server2's definition (in vhosts), app1 stops working but app2 does work. Also, which ever server's definition is above the other in vhosts file was intercepting requests to both the apps.

Yepp, I have 'NameVirtualHost *:80' in my vhosts file. And I changed to '; as you mentioned. It did not work however. App2 loaded and App1 did not. Access log for Server2 shows 404 for requests going to App1 - wrong wiring there. I want to mention that the httpd file also has the definition for server1 which we have repeated in vhosts file.
–
SoltanGFeb 19 '12 at 2:34

Get rid of the duplicate. What's the output from apache2ctl -S?
–
Shane Madden♦Feb 19 '12 at 8:52