Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4031678
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:37:37+00:00 2026-05-20T11:37:37+00:00

I am using the stand alone version of Archiva, it uses Jetty for its

  • 0

I am using the stand alone version of Archiva, it uses Jetty for its application container. It defaults to something like http://mycompany.com:8080/archiva I want to get rid of the application context and just make it http://mycompany.com:8080/ so I can map it to a sub-domain using Virtual Hosts in Apache 2.2.x.

I can’t figure out what to change in the configuration files. Here is the jetty.xml file with all the comments cut out for brevity.

<?xml version="1.0"?>
<!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">

<Configure id="Server" class="org.mortbay.jetty.Server">

    <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!-- =========================================================== -->
    <Set name="ThreadPool">
      <!-- Default bounded blocking threadpool 
      -->
      <New class="org.mortbay.thread.BoundedThreadPool">
        <Set name="minThreads">10</Set>
        <Set name="maxThreads">250</Set>
        <Set name="lowThreads">25</Set>
      </New>
    </Set>


    <Call name="addConnector">
      <Arg>
          <New class="org.mortbay.jetty.nio.SelectChannelConnector">
            <Set name="host"><SystemProperty name="jetty.host"/></Set>
            <Set name="port"><SystemProperty name="jetty.port" default="8081"/></Set>
            <Set name="maxIdleTime">30000</Set>
            <Set name="Acceptors">2</Set>
            <Set name="statsOn">false</Set>
            <Set name="confidentialPort">8443</Set>
        <Set name="lowResourcesConnections">5000</Set>
        <Set name="lowResourcesMaxIdleTime">5000</Set>
          </New>
      </Arg>
    </Call>

    <Set name="handler">
      <New id="Handlers" class="org.mortbay.jetty.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.mortbay.jetty.Handler">
           <Item>
             <New id="Contexts" class="org.mortbay.jetty.handler.ContextHandlerCollection"/>
           </Item>
           <Item>
             <New id="DefaultHandler" class="org.mortbay.jetty.handler.DefaultHandler"/>
           </Item>
           <Item>
             <New id="RequestLog" class="org.mortbay.jetty.handler.RequestLogHandler"/>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.ContextDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="configurationDir"><SystemProperty name="jetty.home" default="."/>/contexts</Set>
          <Set name="scanInterval">1</Set>
        </New>
      </Arg>
    </Call>

    <Call name="addLifeCycle">
      <Arg>
        <New class="org.mortbay.jetty.deployer.WebAppDeployer">
          <Set name="contexts"><Ref id="Contexts"/></Set>
          <Set name="webAppDir"><SystemProperty name="jetty.home" default="."/>/apps</Set>
      <Set name="parentLoaderPriority">false</Set>
      <Set name="extract">true</Set>
      <Set name="allowDuplicates">false</Set>
        </New>
      </Arg>
    </Call>

    <Ref id="RequestLog">
      <Set name="requestLog">
        <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
          <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set>
          <Set name="filenameDateFormat">yyyy_MM_dd</Set>
          <Set name="retainDays">90</Set>
          <Set name="append">true</Set>
          <Set name="extended">true</Set>
          <Set name="logCookies">false</Set>
          <Set name="LogTimeZone">GMT</Set>
        </New>
      </Set>
    </Ref>

    <!-- =========================================================== -->
    <!-- extra options                                               -->
    <!-- =========================================================== -->
    <Set name="stopAtShutdown">true</Set>
    <Set name="sendServerVersion">true</Set>
    <Set name="sendDateHeader">true</Set>
    <Set name="gracefulShutdown">1000</Set>

  <Array id="plusConfig" type="java.lang.String">
    <Item>org.mortbay.jetty.webapp.WebInfConfiguration</Item>
    <Item>org.mortbay.jetty.plus.webapp.EnvConfiguration</Item>
    <Item>org.mortbay.jetty.plus.webapp.Configuration</Item>
    <Item>org.mortbay.jetty.webapp.JettyWebXmlConfiguration</Item>
    <Item>org.mortbay.jetty.webapp.TagLibConfiguration</Item>
  </Array>

  <!-- =========================================================== -->
  <!-- Deploy all webapps in webapps-plus                          -->
  <!-- =========================================================== -->
  <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>

  <!-- ARCHIVA CONFIG -->

  <New id="validation_mail" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>mail/Session</Arg>
    <Arg>
      <New class="org.mortbay.naming.factories.MailSessionReference">
        <Set name="user"></Set>
        <Set name="password"></Set>
        <Set name="properties">
          <New class="java.util.Properties">
            <Put name="mail.smtp.host">localhost</Put>
          </New>
        </Set>
      </New>
    </Arg>
  </New>

  <!-- Archiva database -->
  <New id="archiva" class="org.mortbay.jetty.plus.naming.Resource">
      <Arg>jdbc/archiva</Arg>
      <Arg>
       <New class="org.apache.commons.dbcp.BasicDataSource">
             <Set name="driverClassName">org.apache.derby.jdbc.EmbeddedDataSource</Set>
             <Set name="url">jdbc:derby:<SystemProperty name="appserver.base" default=".."/>/data/databases/archiva</Set>
             <Set name="username">sa</Set>
             <Call name="addConnectionProperty">
               <Arg>create</Arg>
               <Arg>true</Arg>
             </Call>
       </New>
      </Arg>
  </New>

  <New id="archivaShutdown" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/archivaShutdown</Arg>
    <Arg>
      <New class="org.apache.commons.dbcp.BasicDataSource">
             <Set name="driverClassName">org.apache.derby.jdbc.EmbeddedDataSource</Set>
             <Set name="url">jdbc:derby:<SystemProperty name="appserver.base" default=".."/>/data/databases/archiva</Set>
             <Set name="username">sa</Set>
              <Call name="addConnectionProperty">
               <Arg>shutdown</Arg>
               <Arg>true</Arg>
             </Call>
       </New>
    </Arg>
  </New>

  <!-- Users / Security Database -->

  <New id="users" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/users</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
        <Set name="user">sa</Set>
        <Set name="createDatabase">create</Set>
      </New>
    </Arg>
  </New>

  <New id="usersShutdown" class="org.mortbay.jetty.plus.naming.Resource">
    <Arg>jdbc/usersShutdown</Arg>
    <Arg>
      <New class="org.apache.derby.jdbc.EmbeddedDataSource">
        <Set name="DatabaseName"><SystemProperty name="appserver.base" default=".."/>/data/databases/users</Set>
        <Set name="user">sa</Set>
        <Set name="shutdownDatabase">shutdown</Set>
      </New>
    </Arg>
  </New>
</Configure>

Here is the contents of my /apps directory:

[Thu Mar 03 22:03:37] [root]@[dev] /opt/archiva/apps
# dir
total 12K
drwxr-xr-x 3 root root 4.0K Mar  2 17:34 .
drwxr-xr-x 8 root root 4.0K Mar  2 17:39 ..
drwxr-xr-x 9 root root 4.0K Mar  2 17:34 archiva

Thanks for taking the time to look at this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T11:37:38+00:00Added an answer on May 20, 2026 at 11:37 am

    OK, there’s a few options for a solution.

    1. If you rename apps/archiva to apps/root then it should do exactly what you want.

    2. Otherwise, you can modify your jetty.xml so that it deploys each app (in your case you only have 1) explicitly (rather than the way it is now, which deploys everything in apps/)
      That’s a bit of a pain, so I don’t recommend it.

    3. Save this in apps/archiva/WEB-INF/jetty-web.xml:

      <?xml version="1.0" encoding="ISO-8859-1"?>
      <!DOCTYPE Configure PUBLIC "-//Mort Bay Consulting//DTD Configure//EN" "http://jetty.mortbay.org/configure.dtd">
      <Configure class="org.mortbay.jetty.webapp.WebAppContext">
      <Set name="contextPath">/</Set>
      </Configure>

    4. You can use the context deployer http://docs.codehaus.org/display/JETTY/ContextDeployer instead of deploying the app directly – this will allow you to configure the contextPath

    I think option 1 is the easiest, but option 3 is pretty easy too.
    2. and 4. are both more complicated.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm consuming a web service using a stand-alone VBScript. The web service returns to
How can I build a stand-alone SOAP-based Web Services using Delphi? Must work with
Okay, so I'm designing a stand-alone web service (using RestLET as my framework). My
I have a stand-alone java application that makes some database read/write business on a
I'm writing a standalone application in VB.NET using Visual Studio 2005. I want to
I generate XML using JAXB2 for an standalone java app that uses maven 3,
I've got an unmanaged c++ console application in which I'm using srand() and rand().
I am having a problem using VS2010 and framework version 4 with bitmap effects.
I'm using a standalone version of Aptana and I have just finished reformatting. When
I would like to have an application/script that I could use to execute a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.