TechSpot

Apache Web Server

By InkLill
Jan 15, 2011
Post New Reply
  1. 1. I am running apache 2.2. Whenever i try to connect via my ip address to my website it takes me to login to the netgear router i have.
    2. The IP Address assigned to my router is dynamic. If I change it to static IP will I have any problems with my internet or comcast?
    3. I am guessing this problem could be solved by assigning my server a different IP, but is this possible while still being connected to the same router?
    4. Are there any tutorials (or can you tell me) how I can set up apache to host my html website made in Adobe Dreamweaver.

    Thanks
     
  2. JMMD

    JMMD TechSpot Chancellor Posts: 1,177

    You need to use a different port for the Apache server.

    If you want to run a site, just buy a domain and set it up on a free web host account. Running a site from your home is against the Comcast TOS. It can be done but it's probably not worth it.
     
  3. InkLill

    InkLill TS Rookie Topic Starter Posts: 16

    I am not going to be hosting a full out website from it....just a small file server and possibly an internet proxy for me and a few friends.
    Could you give me more detailed instructions on changing the port?
     
  4. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    I have Apache on my laptop and here's the setup
    1) I use the router to reserve an IP address using the laptop's MAC. This then acts just like a static address on the LAN side.
    2) I config Apache to use port 80 & 20080 to bypass any ISP filtering (restrictions) on port 80
    3) Port forward port 20080 off of the router to the preassigned laptop address.

    While it is true that the ISP WAN side address may change from time to time,
    I can always find it and use the new address - - OR - -
    use dyndns.org to cause the changes to be understood.

    for local testing, I use the LAN IP address of the laptop http : // 192.168.x.y/ (using the default port 80).

    Never use a domain.name per se unless you really have one, in which case the above is not correct.

    Use only relative URLs in your HTML code, eg href="./path/file" so that your code
    works even after it is uploaded to a real web host.

    [edit]
    For external access from the Internet the user needs your WAN ip address (or the name created for B]dyndns.org[/B)
    and a url with the port number 20080, eg http : // yourWanIp:20080/
    [/edit]
     
  5. InkLill

    InkLill TS Rookie Topic Starter Posts: 16

    Thanks jobeard, sounds like it should work.
    do I have to edit the big config text file to change the apache port?
    and when pe?ople outside of my wan network connect should they be directed to port 20080 or 8?
     
  6. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    yes, you can have multiple ports; use 80 for local system access and the 20080 is to avoid your isp from blocking port 80 inbound
    see above [edit]
     
  7. InkLill

    InkLill TS Rookie Topic Starter Posts: 16

    Currently at work on settting this up. Will let you know how it went shortly

    Edit:
    Sorry for my noobism, but can you give me the specific line of the config file that I have to change too use port 20080?
    Also, How do i find WAN IP address?

    Edit2:
    Everything works local through the 192.168.x.y address, but now I am having trouble assigning the ports.
    I still need the config file help as in my first edit, and tell me whether or not I have the port forward set up, as below

    Service Type: TCP/UDP
    Starting Port 80
    Ending Port 80
    Server IP Address 192.168.1.13 (the address reseved for my comps MAC address)

    THe second port forward is set up the sam eccept starting and ending at 20080
     
  8. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    in the Apache2/conf dir find the http.conf file (different versions of Apache may have more than one .conf)

    edit and search for # Listen: Allows you to bind Apache to specific IP addresses
    below that comment (# lines are comments) find
    Listen 80
    and add
    Listen 20080​
    below it

    now bounce the server: stop then restart
    Assuming Apache on a Windows platform and a login as Admin
    net stop apache2
    net start apache2​


    On a Linux platform kill -1 $pid # where $pid is the apache process
     
  9. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

  10. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    on my netgear, the port forward reads
    enable[x] Service Name aaaa starting port bbb ending port ccc ip address ddd
    where the user defines aaa,bbb,ccc,ddd
    and I use
    aaa = WebServer
    bbb = 20080
    ccc = 20080
    ddd = ip-address-of the server machine (must be static or address reserved; ie a constant value across any boot)
     
  11. InkLill

    InkLill TS Rookie Topic Starter Posts: 16

    I changed everything the way you have it set up. Neither my WAN or my LAN address will let me connect from anything (even local computers) on either port. It works fine from the same computer the server is on but not from anywhere else.
     
     
  12. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    this is either an error in the port forward or your firewall configuration.
     
  13. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    remember: the external user must use port 20080
    Code:
      http://yourWanIp[B]:20080[/B]/
     
  14. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    An approach:

    1) first be sure you can access ://yourLANip-address:20080/
    this will show that httpd.conf is correct and that the firewall is open on that port.
    Using localhost:20080/ is not a test, as most firewalls open everything on localhost.

    2) then use the yourWanip-address:20080 to verify the router

    You should be able to ping yourWanip-address

    Port testing can be attempted using http://www.canyouseeme.org/
     
  15. InkLill

    InkLill TS Rookie Topic Starter Posts: 16

    My LAN address works through both ports but only on the server computer, not anywhere else locally
     
  16. jobeard

    jobeard TS Ambassador Posts: 13,516   +336

    check your firewall on the server AND any client systems on the same router

    1) the server system must Allow IN TCP source-ip=any port 80, 20080

    2) the clients should be ok unless you have a very strict FW (bravo!) and then the need
    Allow TCP out port 20, 20080

    [edit] /localhost:xxx/ only works to access the system with the keyboard you are typing upon - -
    localhost is always ip-address 127.0.0.1 and never leaves the local system.
    Other systems attached to your router will need to use the server's Lan address
    [/edit]
     


Add New Comment

TechSpot Members
Login or sign up for free,
it takes about 30 seconds.
You may also...


Get complete access to the TechSpot community. Join thousands of technology enthusiasts that contribute and share knowledge in our forum. Get a private inbox, upload your own photo gallery and more.