3 Replies Latest reply: Jun 29, 2007 12:46 AM by 807600 RSS

    disabling port number 80 (apache server)

    807600
      Hi ,

      I have installed apache - tomcat in my linux machine (debian O/S). As per my knowledge when a http request comes apache server handles it at port 80 if the request is for static page,otherwise forwards the request to tomcat.
      I want to disable port 80 or apache server (not uninstalling)and therefore all the requests should go to tomcat server at port 8080.
      ex: http://IPADDRESS shouldn't work and http://IPADDRESS:8080 should work.

      Is this possible.? kindly suggest me what configuration changes do i have to do to disable apache at port 80 such that all requests should go to tomcat at 8080.

      Thanks,
      Sai
        • 1. Re: disabling port number 80 (apache server)
          807600
          Huh? Just don't start the Apache httpd. Why is this even remotely a Java question?
          • 2. Re: disabling port number 80 (apache server)
            masijade
            Apache takes all requests at port 80 or 443 per default and handles them, static pages or otherwise. If it is a request that matches a specific pattern it will hand it off to Tomcat using its AJP 12/13 comms protocol and then return the page (Tomcat returns it to Apache AFAIK). Or you can configure Apache using specific patterns to redirect specific requests to port 8080, in which case it is then Tomcat that is directly receiving them, rather than getting through Apache.

            You have a few things you can do, configure Apache to redirect everything coming into port 80 to port 8080 (and 443 to 8443 respectively) in which case everything over ports 80, 443, 8080, and 8443 are being directly handled by Tomcat (flexible, convenient, and relatively safe).

            Or you can simply not start Apache and force people to enter 8080 or 8443 into the url (cumbersome, but relatively safe).

            Or you can simply not start Apache and configure Tomcat to use port 80 and 443, in which case Tomcat must be running as root, and then nothing will answer on 8080 or 8443 (although you could reconfigure Apache to use those ports). (convenient, but not safe).

            I myself, would use the first of those three options (if Tomcat absolutely has to directly handle the requests). But, to be truthful, I would restrict Tomcat to only the admin and AJP 12/13 configured ports and let Apache handle requests communicating with Tomcat through mod_jk and its AJP 12/13 protocols. (safest, convenient, and flexible)
            • 3. Re: disabling port number 80 (apache server)
              807600
              thanks masijade !!