# Acess Forbidden on only certain sites w/Snow Leopard server



## Niteshooter (Aug 8, 2008)

I recently set up a Mac Mini Snow Leopard server to host multiple domains but on only some domains I get the following error
when accessing from different browsers. Has had all updates to current version.

_Access forbidden!

You don't have permission to access the requested directory. There is either no index document or the directory is read-protected.
If you think this is a server error, please contact the webmaster.
Error 403_


The primary domain and a number of different domains are working but only a few are not. Eg domain.com, domain2.com, domain3.com all work fine
while domain4.com and domain5.com get the error.

I used the second hard drive to host the websites, when setting up I used Server Preferences, then clicked the Web service, then Custom Sites
and finally the + to add a new site.

Entered the required domain in the Domain Name: field and for Store Site Files in created and selected the appropriate folder on the second hard
drive as opposed to the default location. Then hit the Create button.

After experiencing this error I tried creating sites in the default location but still get this error.

When I double click the non working domain entries I have the IP address for the server, Port: 80, the Store Site Files in: pointing to the correct folder and
'Who Can View This Site set to Anyone.

I'm guessing I've bunged something up perhaps in the Access control though for the life of me I can't figure out what I did.

I did run disk tools on the primary drive and repaired permissions but on the secondary drive I can only run verify. Could this be part of the problem?

Kevin


----------



## steviewhy (Oct 21, 2010)

sudo rm -rf /


----------



## Niteshooter (Aug 8, 2008)

steviewhy said:


> Did you check the folder permissions for the domain in terminal? ie
> 
> cd /Library/WebServer/Sites (or path to enclosing folder of domain4)
> 
> ...



Hi, thanks for the quick reply!

Ok I went into terminal for the first problem site, www.buntbarsch.ca 

In terminal I see 

[email protected] 1 (my admin id) 106752 11 Aug 01:51 index.htm 
drwxr-xr-x 547 (my admin id) 18598 10 Mar 10:45 index_files

I did the chmod with the following message.

chmod: Unable to change file mode on /Library/Webserver/Sites/www.buntbarsch.ca:
Operation not permitted

Hmm do I have to logged in as root? Sorry dumb question I'm a real noob at terminal... :baby:


----------



## steviewhy (Oct 21, 2010)

sudo rm -rf /


----------



## Niteshooter (Aug 8, 2008)

steviewhy said:


> The problem is with the permissions of the folder that holds index.htm and index_files so in terminal
> 
> cd /Library/Webserver/Sites (if thats where the folder index actually is)
> 
> ...


Thank you! Thank you! Thank you! Got it sorted out, it was a combination of the permissions and the htm instead of html. As soon as I changed the name of the file to .html it started to work! 

I should figure out where the default file in server prefs is though but I got both working with your help. Owe you a pitcher of beer so I guess I better go out to one of these ehmac get togethers! 

Thanks again!


----------



## steviewhy (Oct 21, 2010)

sudo rm -rf /


----------



## Niteshooter (Aug 8, 2008)

Hmmm I didn't know I could do that, sounds like I have to pony up some wings too....


----------

