Skip to content

Instantly share code, notes, and snippets.

@bezumkin bezumkin/
Last active Jun 16, 2018

What would you like to do?
Ubuntu 10.04 (nginx + php5-fpm): remove site including user & database
echo "Enter username to delete:"
mysql -uroot --password=$ROOTPASS -e "DROP USER $USERNAME@localhost"
mysql -uroot --password=$ROOTPASS -e "DROP DATABASE $USERNAME"
rm -f /etc/nginx/sites-enabled/$USERNAME.conf
rm -f /etc/nginx/sites-available/$USERNAME.conf
rm -f /etc/php5/fpm/pool.d/$USERNAME.conf
find /var/log/nginx/ -type f -name "$USERNAME-*" -exec rm '{}' \;
service nginx reload
service php5-fpm reload
userdel -rf $USERNAME
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.