Personal Web Sharing / Apache

Discussion in 'Mac Apps and Mac App Store' started by Butler Trumpet, Nov 8, 2005.

  1. Butler Trumpet macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #1
    Am I correct in thinking that any website that i have created I can drop into my "sites" folder and then the address will be "my ip address/~shortusername" ??

    what I would like to do, is have my computer be the server for my site, but Im not sure if Im understanding it correctly. when I try to go to my site, i get this message ... "Forbidden you dont have permissions to access on this server"

    I have web sharing enabled, and its not working. any thoughts?

    thanks everyone :)
     
  2. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #2
    Check the permissions on the Sites folder as well as any documents below it. Directories should be 755 and files should be 644, unless it is a cgi, then it will need 755 as well.

    For use of the chmod command, see the man pages.
     
  3. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #3
    umm... how do i check permissions? the only thing about permissions i know is running disk utility.
     
  4. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #4
    In Terminal:

    ls -l
    will give show you the permissions.
     
  5. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #5
    how does this look?
     

    Attached Files:

  6. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #6
    Alternately, you can simply go to your Sites folder in Finder, click on it (the Sites folder), hit ⌘-I to get info, go down to "Ownership & Permissions:", open up Details, make sure everyone except you (the top item) has read permissions, then click "Apply to enclosed items...". You should have read/write permissions, of course. Do this whenever you see problems, as sometimes you drag in items that are not readable to the outside world, and hence not to users accessing them via Apache.
     
  7. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #7
    okay i did the "apply to enclosed items thing" still no good... is this what it should look like (pic 1) I just tried to visit and got forbidden again... though if i take off the ~michaelswope and just have the ip address it takes me to picture 2
     

    Attached Files:

  8. kgarner macrumors 68000

    kgarner

    Joined:
    Jan 28, 2004
    Location:
    Utah
    #8
    What happens when you type in localhost/~shortname? The reason you get that page when you remove the shortname is that the default location of Web Server is in /Library/Web Server (or Web Server Documents or something), note that that is not ~/Library.

    There are some pretty good articles about setting up Apache on your Mac over at macdevcenter.com. I would check them out.
     
  9. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #9
    macdevcenter helped lots....
    i have my site running now. what i had to do was go into terminal and do some permission stuff. I guess if you have file vault running, then it messes that all up.

    i still have a little problem though. it wont load any pictures that i have at all. i know that the location of the pics is fine.. its really confusing why it wont load them, any ideas?
     
  10. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #10
    also, somehow i know you can make it so people not on my LAN can view my site, but im not sure how. something to do with changing the ip address of the router so it doesnt assign it the normal way.... not really sure...
    ?????
    thanks
     
  11. radiantm3 macrumors 65816

    radiantm3

    Joined:
    Oct 16, 2005
    Location:
    San Jose, CA
    #11
    All your images need to be in the default website directory. As far as your router, you need to forward port 80 to your computer's internal ip (and make sure your internal ip is static).
     
  12. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #12
    what do you mean default website director? Im kinda new to dreamweaver.... ive only been using for about 2 months now.

    and how do I do that ip thing? thanks

    edit: also i have a linksys router
     
  13. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #13
    so i have my images in the folder, they work when I test the site in dreamweaver.... but then if you are to click on them in the site index it says i dont have permissions to access them. though, the site itself is working fine.
     
  14. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #14
    Well, you'll probably need to do the permissions stuff again... if you ever drag in stuff that's not set so that general users (i.e., not you) can at least read it (a lot of stuff from your account might very well be set up so that, by default, only you can read it), then you need to change permissions so that those files are readable. Unfortunately, you might need to do that frequently.
     
  15. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #15
    awesome... i just changed it so under "get info" so that everyone could read, it was set to none... thanks! that was amazingly easy...

    now onto the router problem... i have a feeling that is going to be more of a hassle
     
  16. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #16
    First, as it's likely you don't have a static IP address, you'll want to go to somewhere like DynDNS to get set up with a free dynamic dns address - meaning, from anywhere on the Internet, you could type in something like butlertrumpet.homeip.net and get to your router.

    Then, you need to set up your Linksys router to route all port 80 traffic to your Mac's IP address (and in fact will likely want to, on your Mac, go to System Preferences...->Network and set things up to use DHCP with a manual address - for example. 192.168.1.100).

    So, you'd ensure that your Mac is ALWAYS 192.168.1.100, and your Linksys is set up to route port 80 to 192.168.1.100 (or whatever IP address you pick for the Mac).

    Then, from anywhere, you could go to, say, butlertrumpet.homeip.net (or whatever you set up) and see your Mac.

    The easiest thing then is - if you don't share your Mac - to move your files to the "Macintosh HD"->Library->WebServer->Documents folder. Then, anyone accessing your Mac from outside will see those files as the default when they go to butlertrumpet.homeip.net, as opposed to having to go to butlertrumpet.homeip.net/~yourname.
     
  17. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #17
    Note that with DynDNS or whomever, you need to keep them up to date with changes to your dynamic IP address (how often that changes depends on your ISP... some change all the time, like my #%!@#$?! Verizon FIOS, and some never change even though they're technically "dynamic"). However, DynDNS (and, I'm sure, other such sites) provide software to do that for you, and your Linksys, depending on your firmware, might also be able to do this for you.

    So, basically, you get a free DNS name, and you just need to keep them up to date with which IP address to map that to.
     
  18. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #18
    As far as the router goes:

    To set up the port forwarding, log onto your router (likely at 192.168.1.1 if it's a standard Linksys) and go to Applications & Gaming, then Port Range Forward (which I think is the first tab anyway).

    To set up the dynamic DNS stuff, go to Setup->DDNS.
     
  19. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #19
    okay i got everything set up other than the port forwarding... thats kinda confusing. when i go to application and gaming, there is a blank for application, start, end and then IP address... what goes in those blanks?

    thanks by the way for all your help jsw... and for the speedy turnaround time... thats awesome. you should get a metal or something :)
     
  20. belvdr macrumors 601

    Joined:
    Aug 15, 2005
    #20
    I'd give him a medal, instead of a metal.. :) j/k

    For the form, the application is just a name, call it Web, HTTP; it doesn't matter. The start and the end are both 80. If it gives you an option for TCP, UDP, or BOTH, select TCP. The IP address is the IP of the system that has the web server running on it.

    By the way, if you use DynDNS, do not use the DDNS client in the router. It will update the DynDNS server too much, and they will lock your account. There are free clients that do the same thing, but without all the updates.
     
  21. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #21
    okay, so I have done everything....
    the address is
    http://michaelswope.homeip.net
    though i dont think it is working yet. i need to mess around with it, and figure out which ip it wants. because my router is giving a different one than my computer does... so thats just some busy work.
    thanks everyone for helping!
     
  22. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #22
    The IP you'll need to give DynDNS (or whoever you used) is the one reported in the router's Status tab, listed as "IP Address" under the "Internet" section. The internal address (192.168.1.1, or whatever) isn't what you want... you want to use the external IP address of the router (it's the address "seen" by the rest of the Internet, and therefore it's where DynDNS needs to direct traffic). You're currently using "192.168.1.100"... which is the IP address, I suspect, of your Mac.

    And then, as belvdr explained well above, you want to set up the forwarding of port 80 traffic to your Mac's IP address, which, hopefully, you set up with "Using DCHP with manual address" in the Network prefs so that you know it's always the same... which is really going to be an issue if multiple computers use your router. Still... not a bad idea if setting up a web server.

    So what happens is that "michaelswope.homeip.net" is set up in Domain Name Servers to go to your router (let's say its address is 200.15.205.63 or whatever). So external browsers send traffic on port 80 to 200.15.205.63 (your router) by specifying "michaelswope.homeip.net". Then, your router, seeing port 80 traffic, redirects it internally to 192.168.1.100, i.e., your Mac. And outbound packets from your Mac function similarly.

    But you need to be sure you keep DynDNS updated with any changes to your external IP address.
     
  23. jsw Moderator emeritus

    jsw

    Joined:
    Mar 16, 2004
    Location:
    Andover, MA
    #23
    I recommend (if you used DynDNS, as it appears you did) that you download their DynDNS Updater for Mac. One slightly tricky thing: when setting up the address (refer to the lower right-hand-side pic on that page), be sure to specify "External" in the Interface pull-down near the top. Possibly "External (bypassing Proxy)", but most likely just "External".
     
  24. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #24
    awesome, I will try all of this as soon as I get home from class today.
    Hopefully this will be the end of all of my problems with this.... and maybe the start of me getting a better website.
    currently, mine is hosted through Butler University, its awesome because i have about 50 gigs of stroage on it, and unlimited bandwidth. however the problem is, is that i will only have that account for a few more weeks because i graduated from there, and they close accounts in december... and i have to be on campus to edit my page. so because im in louisville now, not indianapolis, it does me no good.

    does anyone have a prefrence to a good web hosting service?
    i am either thinking .mac or futurequest.net
    both are about the same price, .mac has more features of course, but im not sure about what i can do there. can i upload pages that i have already built? or do you have to use the format that i see pretty much everyone that has a .mac account using?
     
  25. Butler Trumpet thread starter macrumors 6502

    Butler Trumpet

    Joined:
    May 26, 2004
    Location:
    Dekalb IL
    #25
    okay, i did everything... look at the images i attached to see if it looks good to you, and maybe you can figure out why its not working.
    picture 1 - port forwarding
    picture 2 - my IP under status on my router
    picture 3 - what dyndns has for my ip
    picture 4 - what i have set in system prefs for my ip

    im thinking my problem is picture 4, but i cant get my ip to be 12.202.21.2 and still have it connect to the interenet. it will only work with 192.168.1.100

    thanks again :)
     

    Attached Files:

Share This Page