Last active
February 16, 2016 06:41
-
-
Save takahashiyuya/6362cc53f63ecb620748 to your computer and use it in GitHub Desktop.
Webサーバとコマンドラインの実行ユーザ異なっていても書き込みできるようにする
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1` | |
sudo chmod -R +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" storage | |
sudo chmod -R +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" storage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rm -rf app/cache/* | |
rm -rf app/logs/* | |
APACHEUSER=`ps aux | grep -E '[a]pache|[h]ttpd' | grep -v root | head -1 | cut -d\ -f1` | |
sudo chmod +a "$APACHEUSER allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs | |
sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit" app/cache app/logs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment