1 Reply Latest reply on Feb 17, 2008 4:55 PM by zzzz8

    URL Rewriting failing on Linux (Fedora Core 7)

    zzzz8

      URL rewriting seems to be failing on my setup (Fedora Core 7, JBoss 4.2.2 GA, JBoss Native 2.0.3 or JBoss Native 2.0.1) for no apparent reason (no exceptions, etc.) - when it works on the exact same setup on my Windows machine (XP, JBoss 4.2.2 GA, JBoss Native 2.0.3).

      Here's my rewrite.properties file:

      RewriteCond %{SERVER_PORT} ^80
      RewriteCond %{REQUEST_URI} ^.*
      RewriteRule ^/(.*) https://%{HTTP_HOST}/myapp [R=301,L]


      I've turned up logging of the org.apache.catalina category to TRACE and I get the following log snippet on Windows (when I tried accessing http://localhost/abc - which then directs me to https://localhost/myapp):

      21:55:00,765 DEBUG [MapperListener:] Handle jboss.web:type=RequestProcessor,work
      er=http-127.0.0.1-80,name=HttpRequest1 type : JMX.mbean.registered
      21:55:00,781 DEBUG [MapperListener:] Handle jboss.web:type=RequestProcessor,work
      er=http-127.0.0.1-80,name=HttpRequest1 type : JMX.mbean.registered
      21:55:00,781 DEBUG [MapperListener:] Handle jboss.web:type=RequestProcessor,work
      er=http-127.0.0.1-80,name=HttpRequest1 type : JMX.mbean.registered
      21:55:00,875 DEBUG [[localhost]:] Rewrote /abc as https://localhost/myapp with
       rule pattern ^/(.*)


      I don't see the same stack trace on Linux - in fact, when I try to access http://localhost/abc, I don't see anything resulting in the log file. I just get an Unable to connect error on Firefox. When I type in a URL which I know works - https://localhost/myapp - that doesn't require forwarding, then it works...

      Is there a bug with rewriting URLs on JBoss Native Linux - or what am I doing wrong?

        • 1. Re: URL Rewriting failing on Linux (Fedora Core 7)
          zzzz8

          OK, I found the issue.

          I just took out the address attribute in the server.xml file in the Connector element:

          <Connector port="80" address="${jboss.bind.address}"
           maxThreads="250" maxHttpHeaderSize="8192"
           emptySessionPath="true" protocol="HTTP/1.1"
           enableLookups="false" redirectPort="443" acceptCount="100"
           connectionTimeout="20000" disableUploadTimeout="true" />
          
          It's OK now... Hopefully, this won't cause any problems.