Last active
December 28, 2016 15:22
-
-
Save benbowler/441796ff25c0b7ea2c68145403233439 to your computer and use it in GitHub Desktop.
How to setup Apache and PHP on Amazon Linux (AWS)
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/sh | |
# Based on http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/CHAP_Tutorials.WebServerDB.CreateWebServer.html | |
if [ "`/usr/bin/whoami`" != "root" ]; then | |
echo "You need to execute this script as root." | |
exit 1 | |
fi | |
yum update -y | |
yum install -y httpd24 php56 # php56-mysqlnd | |
service httpd start | |
chkconfig httpd on | |
groupadd www | |
usermod -a -G www ec2-user | |
chown -R root:www /var/www | |
chmod 2775 /var/www | |
find /var/www -type d -exec sudo chmod 2775 {} + | |
find /var/www -type f -exec sudo chmod 0664 {} + | |
service httpd restart | |
groups |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment