Skip to content

Instantly share code, notes, and snippets.

@simplyspoke
Created February 4, 2017 06:55
Show Gist options
  • Save simplyspoke/c1279b76edc3a51dade66f8e470d3ee7 to your computer and use it in GitHub Desktop.
Save simplyspoke/c1279b76edc3a51dade66f8e470d3ee7 to your computer and use it in GitHub Desktop.
Old AWS Scripts - (used in setting up a autoscaling env if I remember correctly)
perl -pi -e 's%(universe)$%$1 multiverse%' /etc/apt/sources.list
apt-get update && apt-get upgrade
apt-get install -y xfsprogs build-essential ec2-ami-tools ec2-api-tools euca2ools php5-cli php5-mysqli php5-mcrypt php5-dev php-pear php5-curl
dpkg-reconfigure tzdata
modprobe xfs
vi /etc/hostname
vi /etc/crontab
vi /etc/logrotate.conf
vi /etc/exports
vi /etc/fstab
ec2attvol {VOMULEID} -i INSTANCEID -d /dev/sdf
echo "/dev/sdf /vol xfs noatime 0 0" | tee -a /etc/fstab
mkdir -m 000 /vol
mount /vol
mkdir /etc/php5
mkdir /var/log
mkdir /var/www
rm -r /var/log
mkdir /var/log
echo "/vol/var/log /var/log none bind" | tee -a /etc/fstab
echo "/vol/var/www /var/www none bind" | tee -a /etc/fstab
echo "/vol/etc/apache2 /etc/apache2 none bind" | tee -a /etc/fstab
echo "/vol/etc/php5 /etc/php5 none bind" | tee -a /etc/fstab
mount /var/www
rsync -rv php5/ /etc/php5
chmod 755 -R /var/www/vhosts
ln -s /home/{USERNAME}/drush/drush /usr/local/bin/drush
chmod u+x /home/{USERNAME}/drush/drush
service nfs restart
/etc/init.d/nfs-kernel-server start
{VOLUMNID} in us-east-1a
/dev/sdf
# Setup new EBS Partition
apt-get install -y xfsprogs
modprobe xfs
mkfs.xfs sdf
echo "/dev/sdf /vol xfs noatime 0 0" | tee -a /etc/fstab
mkdir -m 000 /vol
mount /vol
#!/bin/bash
## Build Server
sudo apt-get update
sudo apt-get install apache2 php5 libapache2-mod-php5 php5-mcrypt php5-cgi php5-cli php5-common php5-curl php5-gd build-essential vim
a2enmod rewrite alias autoindex mime setenvif auth_basic cgi negotiation authn_file deflate php5
sudo nano /etc/apache2/mods-enabled/dir.conf
#<IfModule mod_dir.c>
# DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm
#</IfModule>
sudo service apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment