Apache File Permissions?

Joined
Sep 30, 2009
Messages
5
Reaction score
0
Points
1
Hi - I am trying to learn HTML, I have apache enabled on my macbook pro and I am able to create some basic pages with text, but when i try to put an image on my page i get a "Forbidden - You don't have permission to access /ImageName.jpg on this server." message. Can someone help me set the proper permissions???

Thanks
James
 
Joined
Sep 24, 2009
Messages
146
Reaction score
3
Points
18
Location
New York
Your Mac's Specs
MBP - 15in, 2.66ghz, 8gb RAM, 2x GPU, 320gb HDD
Where is the image located? If its located off-site (not locally) are you sure you should have permissions to it? If it is stored locally, are you logged into the admin account, or do you have admin permissions with the account you are logged into?
 
OP
J
Joined
Sep 30, 2009
Messages
5
Reaction score
0
Points
1
Since i am just practicing, it is stored locally (HD->Library->webserver->Documents->Images) and I am not sure what I am logged in as? I just made the switch to mac from PC so i am not sure how user permissions work.....when i set up my computer for the first time i created a user/pass for myself i guess i would ASSUME that i am not logged in as admin
 
Joined
Sep 24, 2009
Messages
146
Reaction score
3
Points
18
Location
New York
Your Mac's Specs
MBP - 15in, 2.66ghz, 8gb RAM, 2x GPU, 320gb HDD
If you're using just the default account then yes you have admin permissions.. hmm.. are you using the correct file path? I dont know how you stored your files, but if you store your .html files in documents and are trying to access your images it should look something like this:

<img src="../Images/ImageName.jpg" />

Also, you may have changed some permissions without know it... so if you go to Applications/utilities/disk utilities/ then select the startup volume and click first aid tab, then click repair disk permissions button. Hopefully that helps
 
Joined
May 31, 2009
Messages
203
Reaction score
3
Points
18
Location
Vancouver, Canada
Your Mac's Specs
15" Unibody (Jan 09)
Open up Terminal in /Applications/Utilities and type:

Code:
chmod -R 777 /Library/WebServer/Documents

Then press enter.
That should do it, if not:

Code:
sudo chmod -R 777 /Library/WebServer/Documents
 
OP
J
Joined
Sep 30, 2009
Messages
5
Reaction score
0
Points
1
Thank you the second one worked!!!

btw what is different about the second one, using 'sudo'? i tried the first one without it and it didnt work...
 
Joined
May 31, 2009
Messages
203
Reaction score
3
Points
18
Location
Vancouver, Canada
Your Mac's Specs
15" Unibody (Jan 09)
"sudo" means "run as administrator".

"chmod" means "change permissions to..."
"777" means "allow all to read and write"
"-R" means "recursive"
And the last part is the location.

:)
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top