Mapping a subdomain in a servlet context using Apache 2.x and Tomcat 6.x

I installed Archiva on my machine under Tomcat 6.x in http://dev.mycompany.com:8080/archivaand can access the application and everything, but I want to access it from the subdomain archiva.mycompany.com.

I have Apache 2.x running on a port 80, and using Virtual Hosts and mod_proxy to route from other subdomains to the various other services that I run on this computer.

Now I want to create a subdomain archiva.dev.mycompany.comand point to dev.mycompany.com:8080/archiva.

I can’t understand what I need to put in mine ProxyPassand ProxyPassReverseto do this work the way I want it.

I tried the following and everything he does adds /archivato the URL again and again.

<VirtualHost *:80>
    ServerAdmin me@mycompany.com
    ServerName archiva.dev.mycompany.com
    ProxyPreserveHost On

    <Proxy *>
      Order allow,deny
      Allow from all
    </Proxy>
    ProxyPass / http://dev.mycompany.com:8080/archiva
    ProxyPassReverse / http://dev.mycompany.com:8080/archiva
</VirtualHost>

and I get this error message

HTTP Status 404 - /archivaarchiva/
type Status report
message /archivaarchiva/  
description The requested resource (/archivaarchiva/) is not available.

, Google, :

ProxyPass / ajp://dev.mycompany.com:8080/archiva/
ProxyPassReverse / http://dev.mycompany.com:8080/archiva/

404 Servlet Winstone, , .

- , , , ?

+3
2

.

:

  • archiva, archiva //archiva/

  • - apache2.

, "http://repo. [domain]/" URL- , "http://[domain]: [port]/"

Apache2:

ProxyRequests Off
ProxyPreserveHost On
<VirtualHost [ip]>

        ServerName repo.[domain]
        ProxyPass / http://[ip]:8082/
        ProxyPassReverse / http://[ip]:8082/

        <Proxy *>
              Order deny,allow
              Allow from all
        </Proxy>

</VirtualHost>

conf/jetty.xml:

- :

<!--
  <Call class="org.mortbay.jetty.webapp.WebAppContext" name="addWebApplications">
    <Arg><Ref id="Contexts"/></Arg>
    <Arg>./apps</Arg>
    <Arg>org/mortbay/jetty/webapp/webdefault.xml</Arg>
    <Arg><Ref id="plusConfig"/></Arg>
    <Arg type="boolean">True</Arg>
    <Arg type="boolean">False</Arg>
  </Call>
-->

+ :

  <New class="org.mortbay.jetty.webapp.WebAppContext">
    <Arg><Ref id="Contexts"/></Arg>
    <Arg>./apps/archiva</Arg>
    <Arg>/</Arg>
    <Set name="configurationClasses"><Ref id="plusConfig"/></Set>
  </New>
+2

, :

HTTP 404 -/archivaarchiva/

, - /, .

ProxyPass/http://dev.mycompany.com:8080/archiva

ProxyPass ProxyPassReverse /

( /):

ProxyPass/http://dev.mycompany.com:8080/archiva/

. http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

/, / . .

-1

All Articles