This discussion is archived
6 Replies Latest reply: May 17, 2012 8:30 PM by 13498 RSS

Need help with redirect URL

13498 Newbie
Currently Being Moderated
I have two web servers running on the same server. One is jboss and the other is Oracle iplanet web server 7. The jboss web server is going down this weekend for maintainence, how do I redirect jboss URL to a maintenance html page on webserver 7? I'm having a hard time redirecting the request from jboss to webserver 7. Here is my codes from webserver 7:

<If $from="http://jbossserver:8080/action/*">
NameTrans fn="redirect" url="/maintenance.html"
</If>

I have also tried different variables like $url, $host..etc and none of them work.

Thanks for any help!

Regards,

- Johnny
  • 1. Re: Need help with redirect URL
    handat Expert
    Currently Being Moderated
    Try


    <If $url =~ "http://jbossserver:8080/action/*">
    NameTrans fn="redirect" url="/maintenance.html"
    </If>
  • 2. Re: Need help with redirect URL
    13498 Newbie
    Currently Being Moderated
    Thanks for the reply. Unfortunately, it doesn't work.

    - Johnny
  • 3. Re: Need help with redirect URL
    handat Expert
    Currently Being Moderated
    What doesn't work? You need to clearly specify what is not working in order to get help? Also what is the rest of your config? Are your config settings in the correct order? I am assuming the web server is actually also acting as a reverse proxy for your jboss server? Btw, jboss is an application server, not a web server.
  • 4. Re: Need help with redirect URL
    13498 Newbie
    Currently Being Moderated
    Hi Handat,

    You're right, jboss is an app server. I have tried what you had suggested, and I got an "Unable to connect" error. It seems like webserver is not listening to port 8080. There is no error from the access or error log. It is back to where I was before trying out different variables.

    Another thing, I didn't setup reverse proxy. Do I need to? Is it difficult to setup? I am not familiar with reverse proxy. In the pass, I was using Netscape/SunOne web server page redirection. All I recall was, in the URL redirects page, I just set from and to boxes and it worked with no problem. With webserver 7, there are so much changes. Actually, I have been using webserver 7 for more than a year, but never has to touch the URL Redirects page. I only use it for simply task like directory mapping for files upload/download and never expect to setup the page redirection.

    Here are the full code from <hostname>-obj.conf, assume the hostname is jboss in this case:

    <Object name="default">
    AuthTrans fn="match-browser" browser="*MSIE*" ssl-unclean-shutdown="true"
    NameTrans fn="ntrans-j2ee" name="j2ee"
    NameTrans fn="pfx2dir" from="/mc-icons" dir="/usr/local/webserver7/lib/icons" name="es-internal"
    <If $url =~ 'http://jboss:8080/action/*'>
    NameTrans fn="redirect" url-prefix="/test.html"
    </If>
    PathCheck fn="uri-clean"
    PathCheck fn="check-acl" acl="default"
    PathCheck fn="find-pathinfo"
    PathCheck fn="find-index-j2ee"
    PathCheck fn="find-index" index-names="index.html,home.html,index.jsp"
    ObjectType fn="type-j2ee"
    ObjectType fn="type-by-extension"
    ObjectType fn="force-type" type="text/plain"
    Service method="(GET|HEAD)" type="magnus-internal/directory" fn="index-common"
    Service method="(GET|HEAD|POST)" type="*~magnus-internal/*" fn="send-file"
    Service method="TRACE" fn="service-trace"
    Error fn="error-j2ee"
    AddLog fn="flex-log"
    </Object>

    <Object name="j2ee">
    Service fn="service-j2ee" method="*"
    </Object>

    <Object name="es-internal">
    PathCheck fn="check-acl" acl="es-internal"
    </Object>

    <Object name="cgi">
    ObjectType fn="force-type" type="magnus-internal/cgi"
    Service fn="send-cgi"
    </Object>

    <Object name="send-precompressed">
    PathCheck fn="find-compressed"
    </Object>

    <Object name="compress-on-demand">
    Output fn="insert-filter" filter="http-compression"
    </Object>

    <Object ppath="http:*">
    Service fn="proxy-retrieve" method="*"
    </Object>


    Thank you for your help!

    - Johnny
  • 5. Re: Need help with redirect URL
    handat Expert
    Currently Being Moderated
    Actually, redirection isn't your problem. If your jboss server was listening on 8080 and you shut it down for maintenance, then nothing is listening on that port, hence nothing can connect to it. What you need to do is add a listener on iws7 to listen on that port so that it can actually receive the request to redirect.
  • 6. Re: Need help with redirect URL
    13498 Newbie
    Currently Being Moderated
    Thanks for the explanation. It is funny you mentioned adding a new listener. I did that today. Instead of adding a new listener, I added a new virtual server with a new listener with new port and it worked fine.

    I do have another question, why the asterisk (*) is not working the way it should when adding in the pattern for wild card. I can never get it working. With the new listener, in the url box, I set "//" instead "/*" and it work fine, but not with asterisk. I use that a lot in app server for the url pattern and asterisk just work fine, but not in iws7.

    Anyway, thank you for your help. At least, I am in the right track now.

    - Johnny

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points