Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dengn/f7eeb2e818f39e612840 to your computer and use it in GitHub Desktop.
Save dengn/f7eeb2e818f39e612840 to your computer and use it in GitHub Desktop.
#!/bin/bash
## fix the folder permissions for the html directory
sudo chown -R root:www /var/www
sudo chmod 2775 /var/www
find /var/www -type d -exec sudo chmod 2775 {} +
find /var/www -type f -exec sudo chmod 0664 {} +
## install drush
sudo pear channel-discover pear.drush.org
sudo pear install drush/drush-5.9.0
wget http://download.pear.php.net/package/Console_Table-1.1.3.tgz
sudo tar -xf Console_Table-1.1.3.tgz -C /usr/share/pear/drush/lib
## fix the httpd.conf so clean urls work
sudo sed -i '151s/.*/ AllowOverride All/' /etc/httpd/conf/httpd.conf
sudo service httpd restart
## create a test index.php file
touch /var/www/html/index.php
echo "<?php phpinfo(); ?>" >> /var/www/html/index.php
## put a little message saying where to view the phpinfo page
sudo yum -y install cloud-utils
echo "Take a look at the following IP to see your PHP config"
ec2-metadata --public-ipv4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment