Personal Web Sharing doesnt work

Posted:
in Genius Bar edited January 2014
Hello all.



im trying to get "Personal Web Sharing" to work on my mini but it wont. my set up is as follows:



cable modem plugged into a wireless router, mini picks up the web through airport.











I went into system preferences and clicked on the sharing tab. next i selected "Personal Web Sharing" and click "Start". it gave me an http address that others will use to gain access to my site but it wont work outside of the house.



people outside my network cant access the url but inside my house i can access the url with my laptop. it seems that theres an issue with the wireless network and how it handles access. any suggestions?

Comments

  • Reply 1 of 20
    shetlineshetline Posts: 4,695member
    You need to configure your router so that the HTTP port (port 80) is forwarded through the router to the Mac you're running the web server on.



    Then you need to find out what your WAN IP address is, the IP the world sees on the service-provider side of your router. That's where you'd tell people to go to see your web site.



    That's the short explanation. It could take pages and pages of typing to make this all crystal clear if you're not very familiar with networking concepts.
  • Reply 2 of 20
    thank you i think i can figure it out with that info.
  • Reply 3 of 20
    Keep in mind, however, that a lot of ISP's block incoming requests on port 80, which would mean that people on the "outside" still can't access your self-hosted site.



    Cox communications for example, does this, which is why I have to use port 8080.
  • Reply 4 of 20
    lundylundy Posts: 4,466member
    Which means to avoid having to tell people different and strange IP addresses all the time, go to dynDNS.org and read up on getting a free domain name that you can hand out - and there are several free client daemons that you run on your machine that check the current WAN IP address and keep your dynDNS.org domain name pointing to the correct one.
  • Reply 5 of 20
    huh? hehe sorry lundy, im still trying to figure out where to configure the router...i cant find a setting that says HTTP port. still looking. thanks though.
  • Reply 6 of 20
    i found the page where it allows"external (Internet) calls for services such as a web server"



    can someone make sense of this?





    "Inbound port" ? looks like the software is asking for a range of numbers



    "Type" (choices are TCP or UDP) ? my guess is TCP



    "Private IP address" ? Would this be the IP address of the computer thats hosting?



    "Private port" ? looks like the software is asking for another range of numbers
  • Reply 7 of 20
    i did it with "a little help from my friends" here at appleinsider especially Shetline.



    For anyone with the same problem:



    I found settings on my Belkin router setup page called "Virtual Server". Your router might call it something else but basically your looking for a page that will allow you to specify a "port" which will allow access to your computer. My Belkin setup page had the settings under "Firewall">"Virtual Servers".



    Here are the settings:





    "Inbound port" – 80 (if asked for a range type 80-80



    "Type" – TCP



    "Private IP address" – IP address of computer hosting the files (look in the network preferences of OSX)



    "Private port"
    – same as Inbound port
  • Reply 8 of 20
    shetlineshetline Posts: 4,695member
    Quote:
    Originally Posted by the Beatles


    ...IP address of computer hosting the files (look in the network preferences of OSX)



    An important caveat here, just in case you get your set up working now, and then one day it stops working and you're wondering why...



    Most people have their home networks set up using DHCP, a protocol which automatically assigns IP addresses to the individual computers on a network. When you check your network preferences, what you most likely will be doing is finding out what IP address your computer has been assigned.



    Now, once your computer has been assigned an IP address, it will probably keep that same address for a good long time. However, that address can change! If you lose power to your router, for instance, it's not too terribly unlikely that when the router powers back up, you'll have a new IP address.



    If this happens, your port forwarding for port 80 will end up going to the wrong IP address, and you'll have to fix it manually.



    The best way around this problem is to assign the computer you're using as a web server a fixed IP address. In my house, we have five computers -- two desktop Macs, one desktop PC, and two Mac laptops. I've given the desktops all fixed IP addresses. I keep the laptops on DHCP because that makes it easier to hook up to wireless networks other than our home network without having to change network settings.
  • Reply 9 of 20
    thats funny you mentioned it cause my IP was just reassigned. ok so how do i make it static? can i just make up any address? or in the wireless router settings i can have the router keep my computer IPs static and the only one that will be updated is the router?
  • Reply 10 of 20
    Quote:
    Originally Posted by the Beatles


    thats funny you mentioned it cause my IP was just reassigned. ok so how do i make it static? can i just make up any address? or in the wireless router settings i can have the router keep my computer IPs static and the only one that will be updated is the router?



    As lundy pointed out, use a service like DynDNS.org. You'll sign up for a URL like mywebsite.dyndns.org, which will redirect to your server.

    You'll need to download a program like this that will periodically tell the DynDNS servers what your latest IP address is.



    I can personally vouch for DynDNS.org, as they're what I use. Free and no hassle.
  • Reply 11 of 20
    thanks benzene, i was wondering what "lundy" was talking about. now i know.
  • Reply 12 of 20
    shetlineshetline Posts: 4,695member
    Quote:
    Originally Posted by the Beatles


    thats funny you mentioned it cause my IP was just reassigned. ok so how do i make it static? can i just make up any address? or in the wireless router settings i can have the router keep my computer IPs static and the only one that will be updated is the router?



    Just to be more clear, there are two relevant IP addresses here. All that stuff about DynDNS.org is about your "WAN" IP address -- the address that the ISP-facing side of your router has that the rest of the world can reach you by.



    Some ISPs will give you, or sell you, a fixed WAN IP address, and if they will, you don't need DynDNS.org. All you have to do is, once you've been assigned that IP address, is either give people that raw numerical IP address, or get yourself a domain name which is set up to point to that address.



    Since many ISPs won't give you a fixed IP address, or they charge quite a bit for it by classifying you as a business customer rather than a residential customer, DynDNS.org is great for setting up a domain name which automatically tracks to your home WAN address, even when it changes. I use DynDNS.org myself, and they charge $25/year for the service.



    My router supports DynDNS directly, so I don't have to install any special software on any of my computers to keep the service up and running. If your router doesn't support DynDNS, you end up having to install special software on one of your computer which "phones home" periodically to keep your WAN IP address and your domain name in sync.



    The other IP address, and this is what I was talking about before, is your LAN IP address, the one you'd have for a particular computer on your home network as a member of that network. First thing you have to do is look at how your router is set up, and use this as the basis for setting up manual IP settings for your computer. Typical settings often look something like this:



    Your router's own IP address: 192.168.0.1 (192.168.1.1 is also common).



    The net mask that goes with this address: 255.255.255.0.



    Then if you have DHCP turned on, there's a number you set for the lowest address which DHCP will assign. I'm not sure what's typical, but I have mine set at 20. This means that addresses from 192.168.0.2 through 192.168.0.19 are available to use as fixed IP addresses. You can pretty much pick them arbitrarily, so long as you don't assign two computers on the same network the same address.



    Here's what Mac OS network settings look like for one of my computers:



  • Reply 13 of 20
    mr. hmr. h Posts: 4,870member
    Actually, Benzene & Lundy are talking about a different, but very similar problem.



    There are two IP addresses involved here: one "WAN" IP address; this is the address that your ISP assigns to your modem, and one "LAN" IP address; this is the IP address that your router assigns to your Mac. The "WAN" address is the one that other people on the internet can "see", all computers connected to your home network will appear to have the same IP address from the outside world, due to the magic of NAT.



    To aid in explanation, let's say that your WAN IP address (given to your modem by your ISP) is 64.324.67.89 and your LAN IP address (given to your Mac by your router) is 192.168.0.2.



    When you set up port forwarding on your belkin (in the firewall -> virtual server area), you instructed any requests on port 80 of the 64.324.67.89 IP address to be forwarded to the 192.168.0.2 IP address of your Mac. However, under default settings, routers use DHCP to assign LAN IP addresses).



    This means that if your Mac loses its network connection to the router, when it regains a connection, it may well be given an address other than 192.168.0.2. e.g. 192.168.0.5. However, the port forwarding is setup to forward port 80 requests to 192.168.0.2, so the forwarding will cease to work. DynDNS.org cannot solve this problem for you.



    To solve this problem, you have to consult your router intructions and find out how to assign static LAN IP addresses. This may involve turning off the DHCP server altogether (which would then require you to set the IP address of any machines connecting to your network manually), or setting the DHCP server a restricted range of IP address (e.g. set the DHCP server to assign addresses in the range 192.168.0.10 to 192.168.0.255, reserving 192.168.0.2 to 192.168.0.9 for manually assigned IP address.



    Once the router is configured, you then need to go to system preferences on your Mac and change the "configure IPv4" option under TCP/IP tab of the "network settings" pane to "manually", then enter the desired fixed IP address. You then use this IP address to forward port 80 requests to.



    On to the second problem:



    The second problem is that your WAN IP (e.g. 64.324.67.89) will almost certainly not always be the same. If your modem drops its connection, your modem will probably get a new IP address from the ISP. So if you told your friends they can get you on http://64.324.67.89, now they would not be able to do so. Even worse, someone else may have been assigned the address you used to have, and if they're running a web server too, people will see entirely the wrong site, rather than just nothing.



    This is where dynDNS.org can help. You register something like www.mylovelywebsite.com, and when someone enters that into a webbrowser, a DNS server translates the words into an IP address. Using the dynDNS.org service, you can ensure that this IP address is always the one that has been assigned to you by your ISP.



    Good luck!
  • Reply 14 of 20
    mr. hmr. h Posts: 4,870member
    Shetline beat me to it! With pictures and everything.
  • Reply 15 of 20
    OH i got it, not only will my WAN IP change but my LAN IP can change too. So if i set my TCP settings manually i can control my LAN IP from changing. However i have no control over the WAN IP from changing since the ISP changes that without my control. I could purchase a static WAN IP but they cost much.



    i think i got it. however, if the WAN IP address can change without my control then why would i worry about the LAN IP and configure it manually? what is the benefit of configuring the LAN IP so that it doesnt change if the WAN IP is still going to change?





    Thanks Shetline and thanks Mr. H.
  • Reply 16 of 20
    shetlineshetline Posts: 4,695member
    Quote:
    Originally Posted by the Beatles


    what is the benefit of configuring the LAN IP so that it doesnt change if the WAN IP is still going to change?



    I suppose it all depends what you're running the web server for. Although your WAN IP probably can and will change, with many ISPs your WAN IP can be stable for weeks or months at a time. Perhaps that's "good enough" for what you have in mind, if you and the people who would access your site can cope with the occasional loss of connectivity until you look up what your new IP address has become.



    If you're willing to spend a little money on DynDNS service, it won't matter that your WAN IP changes. Just have your users go to www.yourhomedomain.com, and DynDNS will take care of the rest -- so long as you've got the LAN part of the equation nailed down, of course.



    Before I had DynDNS, I set up a cron job on my Mac to access a web site of mine (one hosted outside of my home) every two hours, where I had a little script set up to record the incoming IP address. I was then able to check a special page on my web site and find out (with perhaps a lag of up to two hours) what my latest home IP address had been.
  • Reply 17 of 20
    lundylundy Posts: 4,466member
    dynDNS charges money now? Bummer.



    As far as getting your WAN (public) IP, just do a curl command on ippages.com and parse out the result:

    Code:




    publicIP=`curl -s -r 0-15 -m 10 www.ippages.com/simple/ | tr -C -d "0-9."`









    Anyone can also go to whatismyip.com.
  • Reply 18 of 20
    shetlineshetline Posts: 4,695member
    Quote:
    Originally Posted by lundy


    Anyone can also go to whatismyip.com.



    Just to make it clear, the point of that cron job I talked about wasn't to check my home computer's WAN IP when I was at home (many easy ways to do that), but to have an easy way to find out my home WAP IP when I was away from home.
  • Reply 19 of 20
    My WAN IP address is handed out via DHCP from my cable provider and it has been the same for over six months now. I am sure that it will randomly change one day when I really need to get in, but it is almost like getting a legal static address!
  • Reply 20 of 20
    lundylundy Posts: 4,466member
    It will change if the cable modem sees a new MAC address.
Sign In or Register to comment.