Personal Web Sharing / Apache

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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 :)
 

belvdr

macrumors 603
Aug 15, 2005
5,660
1,001
No longer logging into MR
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
belvdr said:
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.
umm... how do i check permissions? the only thing about permissions i know is running disk utility.
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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
 

Attachments

kgarner

macrumors 68000
Jan 28, 2004
1,513
0
Utah
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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?
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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
 

radiantm3

macrumors 65816
Oct 16, 2005
1,022
0
San Jose, CA
Butler Trumpet said:
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
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).
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
radiantmark said:
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).
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
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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.
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
jsw said:
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.
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
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
Butler Trumpet said:
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
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.
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
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.
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
jsw said:
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.
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 :)
 

belvdr

macrumors 603
Aug 15, 2005
5,660
1,001
No longer logging into MR
Butler Trumpet said:
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 :)
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.
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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!
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
Butler Trumpet said:
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!
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.
 

jsw

Moderator emeritus
Mar 16, 2004
22,819
41
Andover, MA
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".
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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?
 

Butler Trumpet

macrumors 6502
Original poster
May 26, 2004
472
29
Dekalb IL
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 :)
 

Attachments