Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get update -y
- # Shared storage
- ifconfig eth1 up
- ip addr add 192.168.0.1/24 dev eth1
- apt-get install nfs-kernel-server nfs-common -y
- mkdir /opt/share
- chown nobody:nogroup /opt/share
- chmod 755 /opt/share
- echo "/opt/share 192.168.0.2(rw,sync,no_subtree_check)" >> /etc/exports
- service nfs-kernel-server restart
- # install require package
- apt-get update -y
- apt-get install build-essential checkinstall -y
- apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev -y
- # download and install Python 3.5.2
- cd /usr/src
- wget "https://www.python.org/ftp/python/3.5.2/Python-3.5.2.tgz"
- tar xzf Python-3.5.2.tgz
- cd /usr/src/Python-3.5.2
- ./configure
- make altinstall
- python3.5 -V
- pip3.5 -V
- # Install git
- apt-get install git -y
- # Install node
- apt-get update
- apt-get install curl software-properties-common -y
- curl -sL https://deb.nodesource.com/setup_10.x | bash -
- apt-get install -y nodejs
- node -v
- # Install bower
- npm install pm2 -g --allow-root
- # Install pm2
- npm install pm2 -g
- pm2 list
- # Install mongodb
- apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 0C49F3730359A14518585931BC711F9BA15703C6
- echo "deb http://repo.mongodb.org/apt/debian jessie/mongodb-org/3.4 main" | tee /etc/apt/sources.list.d/mongodb-org-3.4.list
- apt-get update
- apt-get install -y mongodb-org
- service mongod start
- # Install Redis server
- apt-get update
- apt-get install build-essential -y
- apt-get install tcl8.5 -y
- wget http://download.redis.io/releases/redis-stable.tar.gz
- tar xzf redis-stable.tar.gz
- cd redis-stable
- make
- make test
- make install
- cd utils
- ./install_server.sh
- service redis_6379 start
- update-rc.d redis_6379 defaults
- cd ~
- # chown ubuntu:ubuntu /home/ubuntu/.pm2/rpc.sock /home/ubuntu/.pm2/pub.sock
- # Install laravel
- cd ~
- apt-get install curl -y
- export LANG=C.UTF-8
- apt-get install nginx php5-fpm -y
- apt-get install zip unzip -y
- apt-get install python-software-properties -y
- apt-get install php5 php5-mcrypt php5-gd apache2 libapache2-mod-php5 mysql-server php5-mysql -y
- curl -sS https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- # Install nginx
- apt-get install nginx
- mkdir /var/code
- # Init git hook GUI
- mkdir /var/code/medusa_gui.git -p
- mkdir /var/code/medusa_gui_src -p
- cd /var/code/medusa_gui.git
- git init --bare
- touch /var/code/medusa_gui.git/hooks/post-receive
- chmod 755 /var/code/medusa_gui.git/hooks/post-receive
- echo "#!/bin/bash" >> /var/code/medusa_gui.git/hooks/post-receive
- echo "echo 'post-receive: Triggered.'" >> /var/code/medusa_gui.git/hooks/post-receive
- echo "echo 'post-receive: git check out…'" >> /var/code/medusa_gui.git/hooks/post-receive
- echo "git --git-dir=/var/code/medusa_gui.git --work-tree=/var/code/medusa_gui_src checkout deploy-gui -f" >> /var/code/medusa_gui.git/hooks/post-receive
- echo "echo 'post-receive: install project…'" >> /var/code/medusa_gui.git/hooks/post-receive
- echo "cd /var/code/medusa_gui_src/GUI && npm install && bower install --allow-root && pm2 start index.js --name=GUI" >> /var/code/medusa_gui.git/hooks/post-receive
- # Init git hook master
- mkdir /var/code/medusa_master.git -p
- mkdir /var/code/medusa_master_src -p
- cd /var/code/medusa_master.git
- git init --bare
- touch /var/code/medusa_master.git/hooks/post-receive
- chmod 755 /var/code/medusa_master.git/hooks/post-receive
- echo "#!/bin/bash" >> /var/code/medusa_master.git/hooks/post-receive
- echo "echo 'post-receive: Triggered.'" >> /var/code/medusa_master.git/hooks/post-receive
- echo "echo 'post-receive: git check out…'" >> /var/code/medusa_master.git/hooks/post-receive
- echo "git --git-dir=/var/code/medusa_master.git --work-tree=/var/code/medusa_master_src checkout deploy-master -f" >> /var/code/medusa_master.git/hooks/post-receive
- echo "echo 'post-receive: install project…'" >> /var/code/medusa_master.git/hooks/post-receive
- echo "cd /var/code/medusa_master_src/Crawler && pip3.5 install --user -r requirement.txt && pm2 start master.py --interpreter=python3.5 --name=Master" >> /var/code/medusa_master.git/hooks/post-receive
- # Init git hook master
- mkdir /var/code/medusa_resource.git -p
- mkdir /var/code/medusa_resource_src -p
- cd /var/code/medusa_resource.git
- git init --bare
- touch /var/code/medusa_resource.git/hooks/post-receive
- chmod 755 /var/code/medusa_resource.git/hooks/post-receive
- echo "#!/bin/bash" >> /var/code/medusa_resource.git/hooks/post-receive
- echo "echo 'post-receive: Triggered.'" >> /var/code/medusa_resource.git/hooks/post-receive
- echo "echo 'post-receive: git check out…'" >> /var/code/medusa_resource.git/hooks/post-receive
- echo "git --git-dir=/var/code/medusa_resource.git --work-tree=/var/code/medusa_resource_src checkout deploy-resource -f" >> /var/code/medusa_resource.git/hooks/post-receive
- echo "echo 'post-receive: install project…'" >> /var/code/medusa_resource.git/hooks/post-receive
- echo "cd /var/code/medusa_resource_src/File && composer update && php artisan key:generate && pm2 start artisan --name Resource --interpreter php -- queue:work --daemon" >> /var/code/medusa_resource.git/hooks/post-receive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement