Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # actualizar ubuntu / repositorios.
- apt-get update && apt-get -y install software-properties-common python-software-properties
- add-apt-repository ppa:nginx/stable -y
- apt-get update && apt-get -y upgrade && apt-get -y install htop wget git nginx
- service nginx stop
- # clonar lancache
- cd /vagrant && git clone https://github.com/multiplay/lancache.git
- mv /etc/nginx/nginx.conf /etc/nginx/nginx.conf.bak
- ln -s /vagrant/lancache/machines/lancache-single.conf /etc/nginx/nginx.conf
- ln -s /vagrant/lancache/lancache /etc/nginx/lancache
- ln -s /vagrant/lancache/machines /etc/nginx/machines
- ln -s /vagrant/lancache/sites /etc/nginx/sites
- ln -s /vagrant/lancache/scripts /etc/nginx/scripts
- cat >> /etc/hosts <<EOF
- 10.253.253.21 lancache-steam lancache
- 10.253.253.22 lancache-riot
- 10.253.253.23 lancache-blizzard
- 10.253.253.24 lancache-hirez
- 10.253.253.25 lancache-origin
- 10.253.253.26 lancache-sony
- 10.253.253.27 lancache-turbine
- 10.253.253.28 lancache-microsoft
- 10.253.253.29 lancache-xbox
- EOF
- cat >> /etc/network/interfaces <<EOF
- iface eth1 inet static
- address 10.253.253.21
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.22
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.23
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.24
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.25
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.26
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.27
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.28
- netmask 255.255.255.0
- iface eth1 inet static
- address 10.253.253.29
- netmask 255.255.255.0
- EOF
- # reiniciar configuracion
- service networking reload
- # disable ipv6
- cat > /etc/nginx/lancache/resolver <<EOF
- resolver 8.8.8.8 4.2.2.2 ipv6=off;
- EOF
- #create user
- useradd www
- adduser --system --no-create-home www
- addgroup --system www
- usermod -aG www www
- # create cache directories and assign permissions
- mkdir -p /data/www/cache/installs
- mkdir -p /data/www/cache/other
- mkdir -p /data/www/cache/tmp
- mkdir -p /data/www/logs
- chown -R www:www /data/www
- # add users
- cd /etc/nginx && ln -s -f /home/vagrant/servers/nginx/*
- # if everything is configured properly...
- service nginx configtest
- # ...you’ll see this: [ ok ] Testing nginx configuration:.
- # and you can start your server
- service nginx start
- ln /data/www/logs/* /var/log/nginx/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement