XAMPP (Mac) Virtual host showing 403

后端 未结 6 1902
清酒与你
清酒与你 2020-12-09 18:06

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<

相关标签:
6条回答
  • 2020-12-09 18:44

    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.

    0 讨论(0)
  • 2020-12-09 18:44

    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
    
    0 讨论(0)
  • 2020-12-09 18:48

    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

    0 讨论(0)
  • 2020-12-09 18:52

    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 webmaster@site.com
        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!

    0 讨论(0)
  • 2020-12-09 19:03

    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/
    
    0 讨论(0)
  • 2020-12-09 19:06

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

    0 讨论(0)
提交回复
热议问题