Advertisement
Guest User

script for lancache-newversion - unstable.

a guest
Dec 31st, 2015
418
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.44 KB | None | 0 0
  1. # actualizar ubuntu / repositorios.
  2. apt-get update && apt-get -y install software-properties-common python-software-properties
  3. add-apt-repository ppa:nginx/stable -y
  4. apt-get update && apt-get -y upgrade && apt-get -y install htop wget git nginx
  5. service nginx stop
  6.  
  7. # clonar lancache
  8. cd /vagrant && git clone https://github.com/multiplay/lancache.git
  9.  
  10. mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
  11. ln -s /vagrant/lancache/machines/lancache-single.conf /etc/nginx/nginx.conf
  12. ln -s /vagrant/lancache/lancache /etc/nginx/lancache
  13. ln -s /vagrant/lancache/machines /etc/nginx/machines
  14. ln -s /vagrant/lancache/sites /etc/nginx/sites
  15. ln -s /vagrant/lancache/scripts /etc/nginx/scripts
  16.  
  17. cat >> /etc/hosts <<EOF
  18. 10.253.253.21 lancache-steam lancache
  19. 10.253.253.22 lancache-riot
  20. 10.253.253.23 lancache-blizzard
  21. 10.253.253.24 lancache-hirez
  22. 10.253.253.25 lancache-origin
  23. 10.253.253.26 lancache-sony
  24. 10.253.253.27 lancache-turbine
  25. 10.253.253.28 lancache-microsoft
  26. 10.253.253.29 lancache-xbox
  27. EOF
  28.  
  29. cat >> /etc/network/interfaces <<EOF
  30. iface eth1 inet static
  31.   address 10.253.253.21
  32.   netmask 255.255.255.0
  33. iface eth1 inet static
  34.   address 10.253.253.22
  35.   netmask 255.255.255.0
  36. iface eth1 inet static
  37.   address 10.253.253.23
  38.   netmask 255.255.255.0
  39. iface eth1 inet static
  40.   address 10.253.253.24
  41.   netmask 255.255.255.0
  42. iface eth1 inet static
  43.   address 10.253.253.25
  44.   netmask 255.255.255.0
  45. iface eth1 inet static
  46.   address 10.253.253.26
  47.   netmask 255.255.255.0
  48. iface eth1 inet static
  49.   address 10.253.253.27
  50.   netmask 255.255.255.0
  51. iface eth1 inet static
  52.   address 10.253.253.28
  53.   netmask 255.255.255.0
  54. iface eth1 inet static
  55.   address 10.253.253.29
  56.   netmask 255.255.255.0
  57. EOF
  58.  
  59. # reiniciar configuracion
  60. service networking reload
  61.  
  62. # disable ipv6
  63. cat > /etc/nginx/lancache/resolver <<EOF
  64. resolver 8.8.8.8 4.2.2.2 ipv6=off;
  65. EOF
  66. #create user
  67. useradd www
  68. adduser --system --no-create-home www
  69. addgroup --system www
  70. usermod -aG www www
  71.  
  72. # create cache directories and assign permissions
  73. mkdir -p /data/www/cache/installs
  74. mkdir -p /data/www/cache/other
  75. mkdir -p /data/www/cache/tmp
  76. mkdir -p /data/www/logs
  77. chown -R www:www /data/www
  78.  
  79. # add users
  80. cd /etc/nginx && ln -s -f /home/vagrant/servers/nginx/*
  81.  
  82. # if everything is configured properly...
  83. service nginx configtest
  84. # ...you’ll see this: [ ok ] Testing nginx configuration:.
  85.  
  86. # and you can start your server
  87. service nginx start
  88. ln /data/www/logs/* /var/log/nginx/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement