Advertisement
soyuka

Ezseed2 autoInstall.sh

Oct 21st, 2013
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.65 KB | None | 0 0
  1. #!/bin/bash
  2. ###################################################
  3. #   ___  ___  ___  ___  ___  ___     _  _  ___    #
  4. #  (  _)(_  )/ __)(  _)(  _)(   \   ( )( )(__ \   #
  5. #   ) _) / / \__ \ ) _) ) _) ) ) )   \\// / __/   #
  6. #  (___)(___)(___/(___)(___)(___/    (__) \___)   #
  7. #                                      © soyuka   #
  8. ###################################################
  9.  
  10. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
  11.  
  12. # Adding mongodb source
  13. apt-key adv --keyserver keyserver.ubuntu.com --recv 7F0CEB10
  14. echo 'deb http://downloads-distro.mongodb.org/repo/debian-sysvinit dist 10gen' | tee /etc/apt/sources.list.d/10gen.list
  15.  
  16. apt-get update
  17. apt-get upgrade -y
  18.  
  19. #mongodb
  20. mkdir /data
  21. mkdir /data/db
  22.  
  23. # Dependecies
  24. # whois = mkpasswd
  25. apt-get install mongodb-10gen git-core curl build-essential openssl libssl-dev whois python inotify-tools nginx php5-fpm -y
  26.  
  27. #Certificat ssl
  28. openssl req -new -x509 -days 365 -nodes -out /usr/local/nginx/ezseed.pem -keyout /usr/local/nginx/ezseed.key -subj '/CN=ezseed/O=EzSeed/C=FR'
  29.  
  30. #Ajout de la config nginx
  31. cat $DIR/nginx.conf > /etc/nginx/nginx.conf
  32.  
  33. #Install node js
  34. git clone https://github.com/joyent/node.git
  35. cd node
  36.  
  37. # 'git tag' shows all available versions: select the latest stable.
  38. git checkout v0.10.20
  39.  
  40. # Configure seems not to find libssl by default so we give it an explicit pointer.
  41. # Optionally: you can isolate node by adding --prefix=/opt/node
  42. ./configure --openssl-libpath=/usr/lib/ssl
  43. make
  44. make test
  45.  
  46. make install
  47.  
  48. # it's alive ?
  49. if [ -z $(node -v) && -z $(npm -v) ]
  50. then
  51.     exit 0
  52. else
  53.     npm install pm2 -g
  54.     mv $DIR/../ezseed2/ /var/www
  55.     cd /var/www/ezseed2/
  56.     npm install --save
  57. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement