Created
April 20, 2012 21:00
-
-
Save zachbrowne/2431863 to your computer and use it in GitHub Desktop.
Fix Apache2 security on websites.
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
#!/bin/bash | |
########################################################## | |
# Fix Apache Security for Ubuntu 11.10 64bit Web Server # | |
# by Zach Browne - http://zachbrowne.com # | |
########################################################## | |
USERNAME=zach # Change to your username | |
USER_ID=www-data # Change if needed | |
USER_GROUP=www-data # Change if needed | |
find {/home/$USERNAME/domains/public_html,/home/$USERNAME/domains/logs} -type d -exec chmod 755 {} \; | |
find {/home/$USERNAME/domains/public_html,/home/$USERNAME/domains/logs} -type f -exec chmod 644 {} \; | |
chown -R $USER_ID:$GROUP_ID {/home/$USERNAME/domains/public_html,/home/$USERNAME/domains/logs}; | |
echo "Fixed!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment