Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Can't access Webserver Externally on new port

    NAT
    2
    4
    1.1k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • D
      daylightasunder
      last edited by

      I have been trying to get a specific webpage hosted on our internal webserver to be accessible externally.  I use pfSense for my firewall and it seems to be passing the request as the log file shows it passing the external request to the internal server address.

      I have configured this specific external website on port 12345 (as example) by adding
      Listen 12345 to the apache config
      I then added
      NameVirtualHost *:12345

      <virtualhost *:12345="">DocumentRoot /var/www/site
      ServerName internal.server.name
      ServerAlias site site.server.name:12345 external_IP</virtualhost>

      I have also added a DNS entry to make  site.server.name point to external_IP which resolves properly

      Internally I can access the site by typing  internal.server.name.  Externally, I have tried to access using external_IP:12345 and site.server.name:12345 and both give me a page can not be displayed.

      Nat rule is as follows
      No RDR not checked
      Interface : WAN
      Protocal TCP
      Source (any/all)
      Destination: Wan_IP, PORT :12345
      Redirect: Internal_Webserver_IP
      Redirect Port: 12345
      Description : Name
      No XMLPRC unchecked
      NAt Reflection : Default
      Filter Rule: Create and will follow

      Rule
      Action : Pass
      Interface: WAN
      TCP Ver : 4
      Protocol TCP
      Source: Any
      Destination: Internal Webserver Address
      Port : 12345
      Log: Checked

      In the firewall log I see the firewall passing( Green Arrow): WAN : MyIP:random_port : internal_webserver:12345 : TCP:S

      Is there something I'm missing?  Or some suggestions as how to troubleshoot this problem?  I have looked at the Apache log files and don't see any access to them when trying to access externally, but do see them serving information out when in the local instance.

      Thanks :)  Any help is greatly appreciated

      1 Reply Last reply Reply Quote 0
      • V
        viragomann
        last edited by

        I have looked at the Apache log files and don't see any access to them when trying to access externally, but do see them serving information out when in the local instance.

        That looks like there is your local firewall blocking external access.

        1 Reply Last reply Reply Quote 0
        • D
          daylightasunder
          last edited by

          @viragomann:

          I have looked at the Apache log files and don't see any access to them when trying to access externally, but do see them serving information out when in the local instance.

          That looks like there is your local firewall blocking external access.

          Took a look at the machine and
          /etc/apache2/iptables -L

          Chain INPUT (policy ACCEPT)
          target    prot opt source              destination

          Chain FORWARD (policy ACCEPT)
          target    prot opt source              destination

          Chain OUTPUT (policy ACCEPT)
          target    prot opt source              destination

          UFW is disabled.

          If those are all the firewalls in the Webserver machine.

          1 Reply Last reply Reply Quote 0
          • D
            daylightasunder
            last edited by

            It ended up being that the webserver had a different gateways then the pfSense one.  It would forward the information and then not get back to the same place.  Thanks for the help.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.