Last active
August 29, 2015 14:06
-
-
Save miya0001/cabf03ef768ba7f9ba7d to your computer and use it in GitHub Desktop.
amimotoのnginxまわりのユーザーとかをごにょごにょ
This file contains hidden or 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
#!/usr/bin/env bash | |
set -ex | |
service monit stop | |
sed -i -e "s/^user .*;$/user ec2-user ec2-user;/" /etc/nginx/nginx.conf | |
sed -i -e "s/^listen.owner .*$/listen.owner = ec2-user/" /etc/php-fpm.d/www.conf | |
sed -i -e "s/^listen.group .*$/listen.group = ec2-user/" /etc/php-fpm.d/www.conf | |
sed -i -e "s/nginx:nginx/ec2-user:ec2-user/g" /etc/monit.d/php-fpm | |
sed -i -e "s/nginx:nginx/ec2-user:ec2-user/g" /etc/monit.d/nginx | |
chown -R ec2-user:ec2-user /var/www/vhosts | |
chown -R ec2-user:ec2-user /var/tmp/php/session | |
service php-fpm restart | |
service nginx restart | |
service monit start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
AmimotoにインストールされたNginxまわりの権限をec2-userにして、SSHでファイルの書き換えができるようにする。
あくまでもオウンリスクで!
AmimotoにSSHでログイン後に、以下のコマンドをコピペしてください。