cancel
Showing results for 
Search instead for 
Did you mean: 

Virtual Host

morphinof
Champ in-the-making
Champ in-the-making
Hello,

Simple question about virtual hosting in tomcat, actually my wqs website adress is : xx.xx.xx.xx:8090/website and i wan to configure tomcat to redirect xx.xx.xx.xx:8090 (the actualy tomacat homepage, webapps folder and ROOT website) to this website without adding /website.

Unfortunatly there is not httpd.conf file to edit virtuals hosts so i tried to add host in server.xml file as following :


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

        <!– SingleSignOn valve, share authentication between web applications
             Documentation at: /docs/config/valve.html –>
        <!–
        <Valve className="org.apache.catalina.authenticator.SingleSignOn" />
        –>

        <!– Access log processes all example.
             Documentation at: /docs/config/valve.html –>
        <!–
        <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" 
               prefix="localhost_access_log." suffix=".txt" pattern="common" resolveHosts="false"/>
        –>
</Host>

then i changed default host in server.xml:

<Engine name="Catalina" defaultHost="www.domain.com">

finally i made a copy of the folder C:\Alfresco\tomcat\conf\localhost and rename it "www.domain.com" and result was an error 500 after restarting tomcat.

Any idee for solving this ?

Thanks a lot !
14 REPLIES 14

bremmington
Champ on-the-rise
Champ on-the-rise
I would tend to simply rename wcmqs.war to be ROOT.war and then Tomcat will automatically map it as the default app. On your website node in the repo, set the Web Context property to just "/".

morphinof
Champ in-the-making
Champ in-the-making
Thanks for this quick response, do you have an idee for the error 500 after my default host replacement ?

bremmington
Champ on-the-rise
Champ on-the-rise
Is there anything in the log?

morphinof
Champ in-the-making
Champ in-the-making
There is my last log error of my last try :


ERROR: org.springframework.extensions.surf.render.RenderService - An exception occurred while rendering: 500page
org.springframework.extensions.surf.exception.PageRendererExecutionException: Unable to locate template for page: 500page
   at org.springframework.extensions.surf.render.bean.PageRenderer.body(PageRenderer.java:83)
   at org.springframework.extensions.surf.render.AbstractRenderer.render(AbstractRenderer.java:75)
   at org.springframework.extensions.surf.render.RenderService.renderPage(RenderService.java:408)
   at org.springframework.extensions.surf.mvc.PageView.dispatchPage(PageView.java:388)
   at org.springframework.extensions.surf.mvc.PageView.renderView(PageView.java:329)
   at org.springframework.extensions.surf.mvc.AbstractWebFrameworkView.renderMergedOutputModel(AbstractWebFrameworkView.java:285)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:619)
ERROR: org.alfresco.wcm.client.view.StreamedAssetView - Unable to stream asset data!
ClientAbortException:  java.io.IOException
   at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
   at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
   at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
   at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
   at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
   at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
   at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
   at org.alfresco.wcm.client.view.StreamedAssetView.renderMergedOutputModel(StreamedAssetView.java:95)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException
   at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:696)
   at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:726)
   at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:126)
   at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:532)
   at org.apache.coyote.Response.doWrite(Response.java:560)
   at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
   … 38 more
ERROR: org.alfresco.wcm.client.view.StreamedAssetView - Unable to stream asset data!
ClientAbortException:  java.io.IOException
   at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:358)
   at org.apache.tomcat.util.buf.ByteChunk.flushBuffer(ByteChunk.java:434)
   at org.apache.tomcat.util.buf.ByteChunk.append(ByteChunk.java:349)
   at org.apache.catalina.connector.OutputBuffer.writeBytes(OutputBuffer.java:381)
   at org.apache.catalina.connector.OutputBuffer.write(OutputBuffer.java:370)
   at org.apache.catalina.connector.CoyoteOutputStream.write(CoyoteOutputStream.java:89)
   at java.io.BufferedOutputStream.write(BufferedOutputStream.java:105)
   at org.alfresco.wcm.client.view.StreamedAssetView.renderMergedOutputModel(StreamedAssetView.java:95)
   at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:250)
   at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1060)
   at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:798)
   at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:716)
   at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:647)
   at org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:552)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
   at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:646)
   at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:436)
   at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:374)
   at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:302)
   at org.tuckey.web.filters.urlrewrite.NormalRewrittenUrl.doRewrite(NormalRewrittenUrl.java:213)
   at org.tuckey.web.filters.urlrewrite.RuleChain.handleRewrite(RuleChain.java:171)
   at org.tuckey.web.filters.urlrewrite.RuleChain.doRules(RuleChain.java:145)
   at org.tuckey.web.filters.urlrewrite.UrlRewriter.processRequest(UrlRewriter.java:92)
   at org.tuckey.web.filters.urlrewrite.UrlRewriteFilter.doFilter(UrlRewriteFilter.java:381)
   at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
   at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
   at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
   at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
   at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
   at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
   at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
   at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
   at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
   at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
   at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
   at java.lang.Thread.run(Thread.java:619)
Caused by: java.io.IOException
   at org.apache.coyote.http11.InternalAprOutputBuffer.flushBuffer(InternalAprOutputBuffer.java:696)
   at org.apache.coyote.http11.InternalAprOutputBuffer$SocketOutputBuffer.doWrite(InternalAprOutputBuffer.java:726)
   at org.apache.coyote.http11.filters.ChunkedOutputFilter.doWrite(ChunkedOutputFilter.java:126)
   at org.apache.coyote.http11.InternalAprOutputBuffer.doWrite(InternalAprOutputBuffer.java:532)
   at org.apache.coyote.Response.doWrite(Response.java:560)
   at org.apache.catalina.connector.OutputBuffer.realWriteBytes(OutputBuffer.java:353)
   … 38 more

morphinof
Champ in-the-making
Champ in-the-making
I would tend to simply rename wcmqs.war to be ROOT.war

Have i to redeploy it from tomcat manager interface or can i just replace ROOT folders with wcmqs file directly ?

On your website node in the repo, set the Web Context property to just "/"

Do you mean when i create the site web via share i just put / in url name field to refer to /ROOT folder files ?

bremmington
Champ on-the-rise
Champ on-the-rise
In fact, your appBase is wrong. Tomcat expects this to point at a folder full of webapps. You've changed it to point inside one webapp. What you are trying to do is simply change the context at which your website app is mapped. Do this by adding a Context element inside the Host element of your server.xml. See the Tomcat reference docs for more information.

bremmington
Champ on-the-rise
Champ on-the-rise
If you want to simply replace the default ROOT webapp, just rename your website.war to be ROOT.war (delete the existing ROOT.war and ROOT folder if they exist).

In the repo it is the "Web Context" property of the website node ("Quick Start Editorial", for example) that needs to be set to "/", not the name of the node.

morphinof
Champ in-the-making
Champ in-the-making
Thanks, deploy wcmqs as root application seems to be a good way to solve my problem, the fact is i dont have ROOT.war in my webapps folder, just have those :

alfresco.war, awe.war, share.war, wcmqs.war, and i would like to keep tomcat manager application avalaible.

I assume that i can deploy wcmqs as ROOT an tomcat manager (actual ROOT application) into another webapp, can i ?

bremmington
Champ on-the-rise
Champ on-the-rise
Yes, you can configure Tomcat to map any app into any context.