2016-01-21 87 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配置文件中的路徑。