Apache localhost 403 error with Yosemite

后端 未结 7 2006
旧巷少年郎
旧巷少年郎 2021-01-30 01:37

I\'ve just installed Mac OS X Yosemite fresh. I configured Apache and chmodded \"users/user/Sites\" to 755. When I hit localhost I receive a 403 Forbidden \"You don\'t hav

相关标签:
7条回答
  • 2021-01-30 02:19

    There are 2 possibility why your localhost is forbidden, first it may be because your apache setting is not correct and second, may be because you set vhost and you forget about set localhost too

    1. sudo nano /etc/apache2/extra/httpd-vhosts.conf
    2. Add this code

    `

    <VirtualHost *:80>
         ServerName localhost
         DocumentRoot "/Users/username/Sites"
         <Directory "Users/username/Sites">
            Options Indexes FollowSymLinks AllowOverride All Order allow,deny Allow from all
         </Directory>
     </VirtualHost>  
    
    1. Save it and restart your apache

    `

    sudo apachectl restart
    

    it should be works :)

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