Apache "Forbidden" Error after Leopard Upgrade
apple Verified ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Hopefully this is really simple.
I have just upgraded from Tiger to Leopard and as part of that process Apache 2.2 was installed where before I had Apache 1.3. Interesting the upgrade turned Web Sharing OFF - nice - however that was easily overcome in System Preferences.
However, I know next to nothing about Apache so cannot easily solve the next problem. Now whenever I try to access http://localhost/~Username Apache returns "Forbidden - You do not have permission".
It would be much appreciated if anyone could let me know where I need to put the 'tick-in-the-box' or amend some configuration setting. Thanks in advance.
14 replies
Sign in or join Beachball Help to reply.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Choose Go to Folder from the Finder's Go menu, enter ~/Sites/ as the folder's location, and change the permissions on this folder so that all accounts have Read access to everything inside.
(25299)
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Thats not the solution... the problem is that the config file that Apache needs for each user account was deleted when it was upgraded and not re-generated. I've got a post here that explains how to fix it.
Jason
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Jason,
Brilliant, as you say in the linked post - boom! its working now.
Or .... at least for standard HTML. That has now just uncovered the fact PHP is not running on Apache even though I installed entropy 5.2.4 for Apache 2 after the leopard update.
I am going to re-read your linked post to see if that can provide help on the PHP issue. Cheers.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
In an attempt to get this working in my Leopard install, I mistakenly deleted /etc/apache2/httpd.conf. There is one under /etc/apache2/originals and I tried using that but it does not work. Can someone reply to this thread with the contents of /etc/apache2/httpd.conf? Thanks!!!
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
The post by Jason was excellent and solved the PHP issue as well.
However, for those that are interested, I then had a MySQL error where I could not connect to MySQL due to a socket issue (error 2002). It appears that the socket has changed from /tmp/mysql.sock to /var/mysql/mysql.sock. I do not pretend to understand how or why, however the following article on the apple web site did solve my issue:- http://docs.info.apple.com/article.html?artnum=301457
Note: I solved this via the my.cnf option and not the php.ini solution which I could not get to work by trying to set it to the original 'tmp' file even though the article indicates this is the preferred option.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I finally got my Leopard Apache configuration working with PHP5 and with MySQL. I also solved (finally) the forbidden errors I was seeing. Here are some of the changes I made.
1. My read permissions on my website files and directories were configured correctly so I suspected that something inside my httpd.conf file was amiss. Inside /etc/apache2/httpd.conf, I commented out two lines in the <Directory> block. This fixed the "forbidden" messages I was seeing for my virtual hosts. See below:
<Directory />
Options FollowSymLinks
AllowOverride None
# Order deny,allow
# Deny from all
</Directory>2. I used the system.log in Console to detect and fix httpd.conf syntax errors. If you have syntax errors in any of your httpd.conf files, apache2 under Leopard will not start.
3. I removed the comment character from the start of the line below inside httpd.conf:
LoadModule php5_module libexec/apache2/libphp5.soI am now back to where I was with Tiger.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
jkwuc89 has the ticket to getting ~user/Sites/ to work... although I had to use root to get permissions to edit the file. Not sure what the security implications of changing the deny,allow params. are however.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
My MacBook Pro where Apache is running is always behind some kind of firewall and therefore, it is not publicly accessible. So, I am reasonably comfortable with opening up the access the way that I did.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
You may want to leave the root protection in place.
I fixed the issue myself by making a similar change to the user dir config file.
You could add the following lines to the end of the /private/etc/apache2/extra/httpd-userdir.conf file.<Directory /Users/*/Sites>
Order Deny,Allow
Allow from all
</Directory> - 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Thank you mlhnet! I was having trouble accessing any of my virtual hosts (getting 403) after moving my server to 10.5/2.2.6, but your tip solved the issue.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I found that this was configured properly, but the file system permissions on ~username were set to prevent access. I had to change this to allow "Everyone" read-only access. This is probably not the best thing to do, but suggestions are welcome.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Interesting, Leopard made my ~username read-only for 'Everyone' from the beginning.
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
I too was having those 403 errors. I followed peoples' directions:
- I enabled PHP in the httpd.conf file
- I created a new file in apache2/users/shortusername.conf with the following contents:
<Directory "/Users/shortusername/Sites/">
Options Indexes MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
However, I now get a "Cannot connect to server" whenever I try to navigate to http://localhost/~shortusername/. I can still navigate to http://localhost/ and get the generic Apache page, though. Anyone have any idea as to what's up?Thanks
- 0
Apple Support Community member ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Open the Console application and see if you're getting an error message. Also, check the error log as specified in your httpd.conf file.