Denoteone
Denoteone

Reputation: 4055

XAMPP (Mac) Virtual host showing 403

I keep getting Access Forbidden Error 403 when I try running my installation of XAMPP on my MAC

I am running the project outside of /Applications/XAMPP/htdocs. It's in my /Users/my_user_name/Projects/ directory.

Every time I try and go to my virtualhost I get a 403 error: Access forbidden.

I have edited my httpd-vhosts.conf file and I have allowed Virtual hosts in httpd.conf.

I have also set the User and Group to User my_user_name and Group Admin in httpd.conf

I even tried chmoding all my files and directory 777 but I still get Access forbidden.

I have also change Deny to Allow in the httpd-xampp.conf file in the new security settings.

The erro_log provided by XAMPP doesn't mention the 403 error I do see it in my access log as 127.0.0.1 - - [21/Aug/2013:14:45:20 -0400] "GET / HTTP/1.1" 403 1034

I turned on errors and I am seeing this [authz_core:error] [pid 52813] [client 127.0.0.1:57473] AH01630: client denied by server configuration:

Not sure what else to check or try. Please help lol.

Upvotes: 14

Views: 34210

Answers (6)

Douglas Akamine
Douglas Akamine

Reputation: 21

I solved that problem by removing the standard virtual host in httpd-vhosts.conf And leaving only the virtual host configuration that you want.

Upvotes: 2

digitalHound
digitalHound

Reputation: 4444

I got this error because I forgot to set my 'DocumentRoot' url and my 'Directory' url the same.

#dl local
<VirtualHost *:80>
    ServerName dl.local
    DocumentRoot "/Users/myuser/dl_live"               <<< ----- This URL has to match
    <Directory "/Users/myuser/dl_live">                <<< ----- this URL
        Options Indexes FollowSymLinks IncludesNoExec
        AllowOverride All
        Require all granted
    </Directory>
    ErrorLog "logs/dl.local_error_log"
</VirtualHost>

If you do this you may see an error like this in your error log file:

[Tue Feb 03 13:50:26.189944 2015] [authz_core:error] [pid 25254] [client 127.0.0.1:54841] AH01630: client denied by server configuration: /Users/myUsername/path/to_local/virtual_host/

Upvotes: 2

Evalds Urtans
Evalds Urtans

Reputation: 6704

In my case problem was with user definition in httpd.conf for Windows:

User daemon
Group daemon

Changed to

User myusername

And it worked

For linux:

User myusername
Group sudo

For OSX:

User myusername
Group admin

also you might have to set permissions on folder

sudo chown -R yourusername /Applications/XAMPP/xamppfiles/htdocs

Upvotes: 7

KnightHawk0811
KnightHawk0811

Reputation: 931

I kept having this 403 issue and could not find an answer UNTIL...

Curly (right and left) quotes where in my vhosts file.

If you see something like "xe2\x80\x9c" in your error log then this is your problem.

I opened the httpd-vhosts.conf file in a reliable editor (I used Dreamweaver) and noticed that the quotations are curly ones (left and right quotes). They need to be straight quotes. The regular text editor on my Mac would auto change any quotes I make to these curly ones and I wasn't noticing it.

Hopefully this answer will help someone.

Upvotes: 15

AvL
AvL

Reputation: 3093

Just to have the answer right here: You can permit access by adding Require all granted to each VirtualHost in your httpd-vhosts.conf:

# VirtualHost for my.site.com
<VirtualHost *:80>
    ServerAdmin [email protected]
    DocumentRoot "/Users/me/www/my.site.com/"
    ServerName my.site.com
    <Directory "/Users/me/www/my.site.com">
        ServerSignature Off
        Options Indexes FollowSymLinks IncludesNoExec
        AllowOverride All

        #Order allow,deny  <- You can remove this
        #Allow from all    <- and that

        # Insert the following:
        Require all granted

    </Directory>
</VirtualHost>

Good luck!

Upvotes: 26

Denoteone
Denoteone

Reputation: 4055

I found something that actually fixed my issue at the following link. I hope this saves someone hours of pulling out their hair. lol

http://www.apachefriends.org/f/viewtopic.php?p=198815&sid=35790f5d017f27c93c1fd4d260b35128

Upvotes: 2

Related Questions