This content has been marked as final.
Show 5 replies
-
1. Re: Virtual Hosts broken in JBoss 5?
javidjamae Sep 7, 2008 7:22 PM (in response to javidjamae)I just tried this again on JBoss 5 CR1 and it still doesn't seem to work.
Could somebody confirm if this is related to: https://jira.jboss.org/jira/browse/JBAS-3918
Or am I just doing something wrong? -
2. Re: Virtual Hosts broken in JBoss 5?
jfclere Sep 8, 2008 2:23 AM (in response to javidjamae)Have you declared your virtual host in server.xml
-
3. Re: Virtual Hosts broken in JBoss 5?
jaikiran Sep 8, 2008 4:08 AM (in response to javidjamae)FYI - I do have it working on JBoss-5 CR1.
Javid,
When you say, its not working, i guess you get a 404 error or something similar in the browser. Do the logs show something like:
2008-09-08 13:22:17,151 DEBUG [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (main) Initialized: {WebApplication: /D:/jboss-5.0.0.CR1/server/jaikiran/deploy/MyApp.war/, URL: vfsfile:/D:/jboss-5.0.0.CR1/server/jaikiran/deploy/MyApp.war/, classLoader: BaseClassLoader@18f1ef8{vfsfile:/D:/jboss-5.0.0.CR1/server/jaikiran/deploy/MyApp.war/}:26156792} jboss.web:j2eeType=WebModule,name=//myhost-jboss-5.com/MyApp,J2EEApplication=none,J2EEServer=none
This log will confirm that the virtual host is being honoured.
Here's my server.xml entry:<Host name="myhost-jboss-5.com" autoDeploy="false" deployOnStartup="false" deployXML="false"> <Alias>www.myhost-jboss-5.com</Alias> <Valve className="org.apache.catalina.valves.AccessLogValve" prefix="myhost-com-" suffix=".log" pattern="common" directory="${jboss.server.home.dir}/log"/> </Host>
jboss-web.xml:<jboss-web> <virtual-host>myhost-jboss-5.com</virtual-host> </jboss-web>
The only difference between my setup and your's is the hosts file. I have this:127.0.0.1 localhost 10.77.222.50 myhost-jboss-5.com
I could not get it working with127.0.0.1 myhost-jboss-5.com
So i decided to use the system IP to map the virtual host.
One other thing, if you are having proxies setup, is to add myhost-jboss-5.com in firefox to bypass proxy.
Finally, this is the URL which is used to access the application http://myhost-jboss-5.com:8080/MyApp/MyServlet -
4. Re: Virtual Hosts broken in JBoss 5?
javidjamae Sep 23, 2008 8:56 PM (in response to javidjamae)Thanks for the suggestion.
I tried this out on CR1 and CR2 but I still can't get it to work. I set up the hosts file to point to my IP address:127.0.0.1 localhost 172.16.64.45 somehostname.com
And, I verified that the virtual host is deployed:2008-09-23 19:44:49,015 DEBUG [org.jboss.web.tomcat.service.deployers.TomcatDepl oyment] (main) Initialized: {WebApplication: /C:/jboss-5.0.0.CR1/server/web/tmp/ deploy/hello21878-exp.war/, URL: file:/C:/jboss-5.0.0.CR1/server/web/tmp/deploy/ hello21878-exp.war/, classLoader: BaseClassLoader@100c858{vfszip:/C:/jboss-5.0.0 .CR1/server/web/deploy/hello.war}:16828504} jboss.web:j2eeType=WebModule,name=// somehostname.com/hello,J2EEApplication=none,J2EEServer=none
The interesting thing is that I'm not getting a 404 from Tomcat, but rather a "Failed to Connect" from Firefox. I can access a non-virtual host application fine using "localhost:8080" so I know I don't have a problem connecting to Tomcat on my machine. Any ideas? -
5. Re: Virtual Hosts broken in JBoss 5?
jaikiran Oct 2, 2008 1:01 AM (in response to javidjamae)"javidjamae" wrote:
The interesting thing is that I'm not getting a 404 from Tomcat, but rather a "Failed to Connect" from Firefox.
I guess its a setting in Firefox which is creating this issue. As i mentioned in my earlier reply:"javidjamae" wrote:
One other thing, if you are having proxies setup, is to add myhost-jboss-5.com in firefox to bypass proxy.