문제

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

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top