2015-10-25 40 views
0

我想用一個Symfony項目使用「ubuntu/trusty64」來設置流浪漢。我有我的設置文件裏面以下流浪許可Symfony

echo "Installing acl" 

apt-get install acl 
mount -o remount,acl/

echo "Setting symfony log and cache permissions" 

HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` 

setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX /var/www/app/cache /var/www/app/logs 
setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX /var/www/app/cache /var/www/app/logs 

不過setfacl的與setfacl: /var/www/app/cache: Operation not supported

未能如果我跑mount | grep acl我可以看到這表明ACL是在根分區正確的設置根驅動器。

沒有這些權限設置我無法運行任何symfony生成器命令。

回答

-1

檢查鏈接:http://symfony.com/doc/current/book/installation.html

3的系統上使用ACL不支持使用chmod +一個

有些系統不支持使用chmod +一個,但支持所謂setfacl的其他實用程序。您可能需要在分區上啓用ACL支持,並在使用之前安裝setfacl(與Ubuntu相同)。它使用一個命令來嘗試確定您的Web服務器的用戶,並設置爲HTTPDUSER:

$ HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1` 
$ sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs 
$ sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX app/cache app/logs 
+0

這就是我正在做的事情(請參閱shell腳本中的代碼片段)。問題是導致「setfacl:/ var/www/app/cache:Operation not supported」 –

+0

2.在支持chmod + a的系統上使用ACL,解釋如何在/ var/www上設置新權限/應用/緩存 – Noproblem