Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- apt-get update -y
- # Setting SSH
- mkdir ~/.ssh/
- echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCYfyLsgLrESZn8qyJq65RXdV9DVXpYd2IYmQAX5Vz7RlVJ7ttL0O35yz2uMGe+WA1UqmROxBMHtwVyfBFn30/izwyu1lTWFLhjzmC4WzMKMdNPsUHnRXnUmb4quvA5IXWjd1/NZ7oD0+3men8OR0awQi4duVB4yGeCVYAuoQ3HVgkXZ25udJ9Kh5jynx/3YFVk6rjmSgW73epViPRnrZ9IqLtCG55qHbPJAh4y4DpZZBM7TFaqCoaCnL8diDs7uer5kfk8Y1b1zeNvMER+6meI+/7PCcmMz634FgcN7JRJKAGHssMN+AdvLodT69XyQn38cPUq5vThQckgpGKWxxU9SQ2oXBtKlmNiRUq9fEJn2UETEAN9nx3+ceTlXpNfkM7VP1xHr+zI1oQnhmi4K2jd999ErBvZYCu3jYZ9Ud5iBH/5dzailUPNQCVR6EF82JzA6rLQsYKiCWRl687BERriXcwV+Ajaaq7bztvyHaFj2el4hZSMD2oHbtRbATpNZX3a1l8yOA1Q9eUDdAiK8JNsOCsqbRSab8DvfQ5LDuRwSECBljyZnLB/xNJOYAajiI/jm4zEvkDhnKQYimWrmmn2nrCrwOCsa5kVQZku9JROoshrs5f5rowM8UaXzLs5tZN5qnOjw3jRVcq9dlDuDNAh3lt8fgtR8UPsGe9uiFn8VQ== thonh.it@gmail.com" >> ~/.ssh/authorized_keys
- echo "PubkeyAuthentication yes" >> /etc/ssh/sshd_config
- echo "AuthorizedKeysFile .ssh/authorized_keys" >> /etc/ssh/sshd_config
- service sshd restart
- # Shared storage
- ifconfig eth1 up
- ip addr add 10.40.96.4/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 10.40.96.5(rw,sync,no_subtree_check)" >> /etc/exports
- echo "/opt/share 10.40.96.6(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 bower -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
- update-rc.d mongod defaults
- # 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 nginx
- apt-get install nginx -y
- # Install laravel
- cd ~
- apt-get install mysql-server -y
- apt-get install curl -y
- export LANG=C.UTF-8
- apt-get install zip unzip -y
- apt-get install python-software-properties -y
- apt-get install ca-certificates apt-transport-https -y
- wget -q https://packages.sury.org/php/apt.gpg -O- | apt-key add -
- echo "deb https://packages.sury.org/php/ jessie main" | tee /etc/apt/sources.list.d/php.list
- apt update -y
- apt install php7.2 -y
- apt install php7.2-cli php7.2-common php7.2-curl php7.2-gd php7.2-json php7.2-mbstring php7.2-mysql php7.2-xml php7.2-fpm
- curl -sS https://getcomposer.org/installer | php
- mv composer.phar /usr/local/bin/composer
- 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-crawler -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 del Master --silent && 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" >> /var/code/medusa_resource.git/hooks/post-receive
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement