-
1. Re: JBOSS AS 7.1.1 URL Redirect
spolti Feb 14, 2014 11:18 AM (in response to madhushinde)Hi,
1.I need to direct from port 80 to 8080
Maybe you can add a iptables rule to redirect, like this:
# iptables -A PREROUTING -t nat -i eth0 -p tcp --dport 80 -j REDIRECT --to-port 8080
2.In my URL I need to hide root context name
I need to redirect URL, if I enter www.hello.com to my application.
OK, you must do 2 things, configure the application context root and configure a virtual host, configure the jboss vhost then add you domain in your DNS server, or locally for tests.
First: Configure the application context root and configure a virtual host
Your jboss-web.xml must be like that:
<?xml version="1.0" encoding="UTF-8" ?><jboss-web>
<context-root>/</context-root>
<virtual-host>www.hello.com</virtual-host>
</jboss-web>
Second:
In your standalone|domain.xml, in the urn:jboss:domain:undertow:1.0 subsystem, between server tags, add this conf:
<host name="V_HOST_NAME" alias="www.hello.com" default-web-module="APP_NAME"/>
Typically the default-web-name is the war name whithout suffix, or you are using maven you mus use <artifactId> name.
Third: Configure your DNS.
Rgz
-
2. Re: JBOSS AS 7.1.1 URL Redirect
madhushinde Feb 13, 2014 11:26 PM (in response to spolti)Hello,
Thanks a ton . It helped me.
Regards
-
3. Re: JBOSS AS 7.1.1 URL Redirect
vbchin2 Feb 14, 2014 12:34 AM (in response to madhushinde)If you are just tinkering with your personal system at home or work, the above approach might work. I probably will be suggesting something that you didn't ask for but I will continue ...
The usual and often best practice is to have a Web Server like Apache or JBoss EWS in front of the JBoss Application Server as it also doubles as Load Balancer if you ever prefer to use it that way.
- Once installed you can add a VirtualHost entry into the httpd.conf file, just as shown in the post here.
- As a final tweak you have to ensure that www.example.com is pointed to the machine where the app is installed/running, so you have to modify the DNS entries to do the required mapping.
Also, "Accept" the replies providing your desired solution. This will give points to the people contributing to solutions in the community.
-
4. Re: JBOSS AS 7.1.1 URL Redirect
madhushinde Feb 16, 2014 10:58 PM (in response to vbchin2)Hello,
Thank you for the reply .I would try out this solution too.Will post the update.
Regards