Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Possible Duplicate:
403 Forbidden Error on Mac OS X Localhost

When I go to localhost/~admin/ or 127.0.0.1/~admin/ my browser says:

"Forbidden

You don't have permission to access /~admin/ on this server."

How do I change this?!??!?! It's driving me nuts!

when I go to localhost or 127.0.0.1/ my browser says: "It Works!".

I'm running mac osx 10.8.

I created aliases in my .bash_profile file so that I can start, restart and stop Apache quickly:

alias startApache="sudo apachectl start"
alias stopApache="sudo apachectl stop"
alias restartApache="sudo apachectl restart"

In my /etc/apache2/httpd.conf file I turned on php5:

LoadModule php5_module        libexec/apache2/libphp5.so

I also made sure to change the permissions for my admin.conf file with this command in terminal:

sudo chmod 644 username.conf

This is my /etc/apache2/users/admin.conf:

<Directory "/Users/admin/Sites/">
        Options Indexes MultiViews
        AllowOverride All
        Order allow,deny
        Allow from all
</Directory>
share|improve this question
    
Does "~admin" exist? Does the user Apache is running as have permissions to it? –  techie007 Dec 8 '12 at 2:44
    
@techie007 admin exists. How do I check "the user Apache is running as have permissions to it?" –  Pavan Katepalli Dec 8 '12 at 2:57
    
Check this answer out. –  techie007 Dec 8 '12 at 2:59
    
Thanks. I went through that page. It's for 10.6. Didn't help. –  Pavan Katepalli Dec 8 '12 at 3:08
    
Just because he's using OSX 10.6 doesn't mean the answers provided don't apply. Did you look at Spiff's answer? From all the info there, what did you actually try? What were your results? –  techie007 Dec 8 '12 at 3:11
show 1 more comment

marked as duplicate by techie007, HackToHell, TFM, 8088, Simon Sheehan Dec 8 '12 at 18:15

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

This could be as simple as the directory listing option being turned off and there being no (configured) index file (index.html, etc)

1) Try changing the Options line to:

Options +Indexes MultiViews

If a parent directory (or the main apache.conf) has -Indexes (turned off) then without the "+" it won't force it on for the current directory.

2) You could just create a .htaccess file in the desired directory and add the one line:

Options +Indexes

3) Set the index file in admin.conf or .htaccess:

DirectoryIndex index.php,index.html,index.htm

4) Make sure the Apache user at least has read access to the index file. You can do this by checking the permissions. This can be done by pressing Control+I (or Get Info) and making sure Everybody has Read permissions.

These things are good to check if you're having the same problem under Linux with Apache, too.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.