aspose file tools*
The moose likes Tomcat and the fly likes Virtual Hosts with Tomcat/Apache Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Virtual Hosts with Tomcat/Apache" Watch "Virtual Hosts with Tomcat/Apache" New topic
Author

Virtual Hosts with Tomcat/Apache

Bill Leighton
Greenhorn

Joined: Oct 12, 2004
Posts: 3
I have been searching for an answer for this, but nothing seems to be just what I need, or else I am doing it completly wrong, which is much more likely.

Anyway, I want to have one folder on my linux machine, /var/www/html/work/testjsp that will keep all of my html and jsp files.

I want to get to this by using the URL testjsp.mydomain.com, which is in my DNS.

I have Apache configured with Virtual hosts, did that first and it worked fine with an index.html or index.php file in the root.

Then I tried to configure Tomcat to use the same path so if I have index.jsp in the root, that would work as well. But when I try that, I am either getting file not found, or if I change a few things it was redirecting back to the default index.jsp in the webapps directory (however, I think I figured that out, I was using Name and not name in my Host directive, so it was getting ignored).

Can someone be so kind to either point me in the right direction or give me an example of the VirtualHost lines and the Host lines I need in Apache and Tomcat.

BTW, I am using the auto feature of Apache to create my jk file if that is any help.

I really appreciate any help on this, I need to get this up and running so I can learn as much on JSP as I can in the next week. Big project.
Bill Leighton
Greenhorn

Joined: Oct 12, 2004
Posts: 3
If it helps, here are my current host information from httpd.conf and server.xml and what was created in the auto mod_jk file.

httpd.conf...


server.xml....


mod_jk....
Bill Leighton
Greenhorn

Joined: Oct 12, 2004
Posts: 3
Ok, think I got it. For anyone who is interested, the Auto file was overwriting the Virtual Host in the httpd.conf file and that Auto file was missing some of the needed directives. So, I edited the Auto file and it started working. Of course anytime I restart Tomcat I am going to get the error again, so I will have to edit it each time, but I will figure that part out later. Just glad I got it working.
 
 
subject: Virtual Hosts with Tomcat/Apache