Created
January 11, 2014 19:07
-
-
Save maxlapshin/8375324 to your computer and use it in GitHub Desktop.
Vagrant provisioning of Stalker Middleware
This file contains 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 | |
sed -i'' 's/us.archive.ubuntu.com/mirror.yandex.ru/' /etc/apt/sources.list | |
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/v4.8.73.zip | |
apt-get -y install unzip | |
unzip v4.8.73.zip | |
mv stalker_portal-4.8.73 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 | |
This file contains 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
`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