It's not a secret anymore!
The moose likes Tomcat and the fly likes Probelm with creating virtual hosting with tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Products » Tomcat
Reply Bookmark "Probelm with creating virtual hosting with tomcat" Watch "Probelm with creating virtual hosting with tomcat" New topic
Author

Probelm with creating virtual hosting with tomcat

karicheti sandya
Greenhorn

Joined: Dec 29, 2008
Posts: 5
Hi,

i have a domain called mysite.com
i have the web application and place the all the jsp files in
C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps\mysite

Now i run my jsp files as http://11.22.33.44:8080/mysite/index.jsp

When i run like this it worked fine.Now i have to create the virtual hosting with tomcat to my application.

like http://www.mysite.com/index.jsp

For that i changed the server.xml in conf/server.xml

server.xml

<Host name="www.mysite.com" appBase="webapps/mysite"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

And also changed the conf/catelina/mysite/ROOT.xml

<Context displayName="sayhi" docBase="" path=""
workDir="work/Catalina/sayhi/_">
</Context>

i changed like that but it didn't work.Please suggest can i made any other changes.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

We have a special forum for Tomcat issues. Let's go there instead.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12268
    
    1
The appBase attribute must be an absolute file system path because you are creating a new application context.

Bill


Java Resources at www.wbrogden.com
karicheti sandya
Greenhorn

Joined: Dec 29, 2008
Posts: 5
When i give the url as

http://www.mysite.com:8080/mysite/index.jsp


it worked fine.But my requirement is to change the url as


http://www.mysite.com/index.jsp

For that requirement what changes i have to made.please suggest
Rene Larsen
Ranch Hand

Joined: Oct 12, 2001
Posts: 1179

Have you tried to replace the appBase attribute as William suggested??

He wrote that you need to use an absolute file system path.

e.g.


Regards, Rene Larsen
Dropbox Invite
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Probelm with creating virtual hosting with tomcat
 
Similar Threads
Tomcat Configuration - context woes?
How to package a project and install in tomcat webapps?
Apache-Tomcat Integration
My JSP dont work on Apache Tomcat
What is Tomcat virtual host, What is different from the Apache Tomcat?