Skip to content

Instantly share code, notes, and snippets.

@random-robbie
Forked from maxlapshin/Vagrantfile
Last active September 19, 2016 08:57
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 random-robbie/c9392e30022f0a73f569353dedaec7c7 to your computer and use it in GitHub Desktop.
Save random-robbie/c9392e30022f0a73f569353dedaec7c7 to your computer and use it in GitHub Desktop.
Vagrant provisioning of Stalker Middleware
#!/bin/bash
apt-get update
export DEBIAN_FRONTEND=noninteractive
apt-get -y install apache2 nginx memcached mysql-server php5 php-soap php5-intl php-gettext php5-memcache php-pear nodejs php5-curl php5-mysql php5-tidy php5-imagick php5-geoip
pear channel-discover pear.phing.info
pear install phing/phing
cd /var/www
wget https://github.com/azhurb/stalker_portal/archive/v5.0.3.zip
apt-get -y install unzip
unzip v5.0.3.zip
mv stalker_portal-5.0.3 stalker_portal
mysql -u root mysql -e "GRANT ALL PRIVILEGES ON stalker_db.* TO stalker@localhost IDENTIFIED BY '1' WITH GRANT OPTION;"
cd /var/www/stalker_portal/deploy/
ln -sf /usr/bin/node /usr/local/bin/nodejs
phing
a2enmod rewrite
cat > /etc/apache2/ports.conf <<EOF
NameVirtualHost *:88
Listen 88
EOF
sed -i'' 's/:80/:88/' /etc/apache2/sites-available/default
cat > /etc/nginx/sites-available/default <<EOF
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://127.0.0.1:88/;
proxy_set_header Host \$host;
proxy_set_header X-Real-IP \$remote_addr;
}
location ~* \.(htm|html|jpeg|jpg|gif|png|css|js)$ {
root /var/www;
expires 30d;
}
}
EOF
/etc/init.d/apache2 restart
/etc/init.d/nginx start
`mkdir -p .vagrant_aptcache`
Vagrant::Config.run do |config|
config.vm.define :stalker do |conf|
conf.vm.box = "precise64"
conf.vm.box_url = "https://s3-us-west-2.amazonaws.com/squishy.vagrant-boxes/precise64_squishy_2013-02-09.box"
conf.vm.share_folder "v-apt", "/var/cache/apt/archives", ".vagrant_aptcache"
conf.vm.provision :shell, :path => "stalker.sh"
conf.vm.forward_port 80, 6050
conf.vm.forward_port 3306, 6056
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment