2016-01-21 78 views
1

我使用apache与虚拟主机作为我的服务器。我也使用yeoman生成角度的应用程序模板。出于某种原因,当我启动我的网站时,我可以看到索引页面,但控制台给我403个禁止的错误,这些错误全部在诸如bootstrap,angular.js等的组件中。我不确定我做错了什么。有人可以帮忙吗?谢谢!403禁止在凉亭组件

我的V-host文件

<VirtualHost *:80> 
    ServerAdmin [email protected] 
    DocumentRoot "/Users/John/testproject/app" 
    ServerName testproject.localhost 
    ErrorLog "/private/var/log/apache2/testproject-error_log" 
    CustomLog "/private/var/log/apache2/testproject-access_log" common 
    <Directory "/Users/John/testproject/app"> 
     Options Indexes FollowSymLinks MultiViews 
     AllowOverride All 
     Order allow,deny 
     Allow from all 
     Require all granted 
    </Directory> 
</VirtualHost> 

我的项目结构。

testproject 
    app 
     bower_components <-symlink 
    bower_components 
     angular  <----403 error 
     bootstrap <----403 error 
     ...etc 
    Gruntfile.js 
    Bower.json 

我在浏览器的URL

testproject.localhost 

感谢您的帮助!

回答

0

您需要在/ var移动你的项目/网络/目录/用户目录是不是Apache2的动人文件夹检查许可 后访问并设置权限为777

sudo chmod -r 755 folder_path 

如果仍然不将其设置为

sudo chmod -r 777 folder path 

并重新启动apache2。另外不要忘记更改apache2配置文件中的路径。