Domanda

I've got an app which is running on JBoss 7. Its URL is http://localhost:8080/archive/app. How can I make it look http://localhost:8080/app or http://localhost/app?

PS. /archive means archive.war

È stato utile?

Soluzione

1) Remove the welcome root. In the standalone.xml set:

<virtual-server name="default-host" enable-welcome-root="false">

2) Set the context root. In your archive.war add a jboss-web.xml file in the WEB-INF folder:

<?xml version="1.0"?>
<jboss-web>
   <context-root>/</context-root>
</jboss-web>

3) Set the http port to 80. In the standalone.xml change:

<socket-binding name="http" port="8080"/> to <socket-binding name="http" port="80"/>

Remember that if your server runs on a Linux machine it must be launched by root in order to use ports under 1024. In that case you can redirect from 80 to 8080 by means of iptables without the need to change the standalone.xml socket-binding

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top