bntjah / lancache

Improve download speeds and reduce strain on your Internet connection at LAN parties. Locally cache game installs and updates from the largest distributors: Steam, RIOT, Blizard, Hirez, Origin, Sony, Microsoft, Tera, GOG, ArenaNetworks, WarGaming, and Uplay. Super easy to setup with auto installer script!
175 stars 43 forks source link

A couple issues with manual install #89

Closed MadMage999 closed 6 years ago

MadMage999 commented 6 years ago

"7.1) Replace the proxy_bind variable with your primary IP address (not one of the virtual ones)"

Not sure which file you're referring to.

"10) Put it in the standard Boot: sudo update-rc.d lancache defaults"

This returns an error for me (on Debian 8.10) "update-rc.d: error: initscript does not exist: /etc/init.d/lancache"

nexusofdoom commented 6 years ago

not sure on 8.10. I am working on a manual install for 9.40 I can email it to you. It's not all done but it is what I used to get my Debian 9.40 Test box up and running.

MadMage999 commented 6 years ago

Thanks for the quick reply.

If you have an updated script for debian 9.40 that would be even better. I was only doing the manual install because the script didn't work for me.

nexusofdoom commented 6 years ago

Install how to for debian 9.40 64BIT

https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-9.4.0-amd64-xfce-CD-1.iso

login as root or get sudo working so you can putty in and install the other packages

you can install desktop version if you want to.

suggest installing ssh-server

install net-tools , sudo , screen , git

apt-get install locate apt-get install net-tools apt-get install sudo apt-get install screen apt-get install git

to get jemalloc compiled and installed

apt-get install checkinstall docbook-xsl docbook-xsl-ns docbook-xsl-doc-html xsltproc

network monitors

apt-get install nload iftop httpyr

needed to isntall to get sni to compiled and install

apt-get install autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev pkg-config software-properties-common autotools-dev cdbs debhelper dh-autoreconf dpkg-dev gettext libev-dev libpcre3-dev libudns-dev pkg-config fakeroot devscripts

Extra maybe the same Install the required utilities

apt-get install devscripts curl git unbound build-essential libpcre3 libpcre3-dev zlib1g-dev libreadline-dev libev4 libev-dev libncurses5-dev git libssl-dev httpry

enable sudo for normal user

http://milq.github.io/enable-sudo-user-account-debian/

adduser $username sudo

current version of debian 9.4 need to change network back to old names eth0 example

https://www.itzgeek.com/how-tos/linux/debian/change-default-network-name-ens33-to-old-eth0-on-debian-9.html

To regain the ethX back, edit the grub file.

sudo nano /etc/default/grub

Look for “GRUB_CMDLINE_LINUX” and add the following”net.ifnames=0 biosdevname=0“.

From:

GRUB_CMDLINE_LINUX=""

To:

GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"

git clone -b master --recursive http://github.com/bntjah/lc-installer/

Generate a new grub file using the “grub-mkconfig” command.

sudo grub-mkconfig -o /boot/grub/grub.cfg

DHCP or Static need to edit your /etc/network/interfaces file /DHCP example bellow

If your machine is on DHCP network, then:

sudo nano /etc/network/interfaces

Update below lines in interfaces files so that the network card can get an IP address from DHCP server.

FROM:

auto ens33 iface ens33 inet dhcp

TO:

auto eth0 iface eth0 inet dhcp


get jemalloc and build

git clone -b stable-4 --depth 1 https://github.com/jemalloc/jemalloc.git cd jemalloc ./autogen.sh make && make dist sudo checkinstall --pkgname=jemalloc --pkgversion="4-stable" --backup=no --deldoc=yes --fstrans=no --default make clean && make distclean cd ..

rm -rf jemalloc


get and build nginx curl http://nginx.org/download/nginx-1.13.9.tar.gz | tar zx cd ngnix-1.13.8 mkdir /usr/local/lib ./configure --with-http_slice_module --with-http_ssl_module --with-file-aio --with-threads --with-ld-opt="-lrt -ljemalloc -Wl,-z,relro -Wl,-rpath,/usr/local/lib" --with-cc-opt="-m64 -march=native -g -O3 -fstack-protector-strong --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wno-deprecated-declarations" --sbin-path=/usr/local/sbin/nginx --conf-path=/usr/local/nginx/conf/nginx.conf make sudo checkinstall --pkgname=nginx --pkgversion="1.13.8-custom" --backup=no --deldoc=yes --fstrans=no --default

if necessary remove the above installed packaged with

dpkg -r jemalloc nginx


SNI Proxy

ref https://github.com/dlundquist/sniproxy

git clone https://github.com/dlundquist/sniproxy ./autogen.sh && dpkg-buildpackage sudo dpkg -i ../sniproxy.deb sudo curl https://raw.githubusercontent.com/OpenSourceLAN/origin-docker/master/sniproxy/sniproxy.conf -o /etc/sniproxy.conf


Get Lancache Files from github

git clone -b master http://github.com/bntjah/lancache


Make lancache user

Create the user lancache

sudo adduser --system --no-create-home lancache
sudo addgroup --system lancache
sudo usermod -aG lancache lancache

cd lanchace sudo cp limits.conf /etc/security/limits.conf

Replace the hostnames with the virtual IPs

move start up scripts to /etc/init.d/ folder

cd lancache/init.d/ sudo chmod+x * -rvf sudo cp nginx /etc/init.d/ sudo cp sniproxy /etc/init.d/

Launch Nginx on startup

sudo /usr/sbin/update-rc.d -f nginx defaults cd /etc/init.d/ sudo systemctl enable nginx


Make Needed Folders

Just create the folders:

sudo mkdir -p /srv/lancache/data/blizzard/
sudo mkdir -p /srv/lancache/data/microsoft/
sudo mkdir -p /srv/lancache/data/installs/
sudo mkdir -p /srv/lancache/data/other/
sudo mkdir -p /srv/lancache/data/tmp/
sudo mkdir -p /srv/lancache/data/hirez/
sudo mkdir -p /srv/lancache/data/origin/
sudo mkdir -p /srv/lancache/data/riot/
sudo mkdir -p /srv/lancache/data/gog/
sudo mkdir -p /srv/lancache/data/sony/
sudo mkdir -p /srv/lancache/data/steam/
sudo mkdir -p /srv/lancache/data/wargaming
sudo mkdir -p /srv/lancache/data/arenanetworks
sudo mkdir -p /srv/lancache/data/uplay
sudo mkdir -p /srv/lancache/data/glyph
sudo mkdir -p /srv/lancache/data/zenimax
sudo mkdir -p /srv/lancache/data/digitalextremes
sudo mkdir -p /srv/lancache/data/pearlabyss
sudo mkdir -p /srv/lancache/logs/Errors
sudo mkdir -p /srv/lancache/logs/Keys
sudo mkdir -p /srv/lancache/logs/Access

Change Ownership of folders

sudo chown -R lancache:lancache /srv/lancache

unbound setup


Copy Hosts file

sudo cp hosts to /etc/hosts

Replace the hostnames with the virtual IPs


Copy the conf folder and contents (where you originally git cloned it to in step 4) to /usr/local/nginx/conf/

sudo cp -R ~/lancache/conf /usr/local/nginx/

Replace the proxy_bind variable with your primary IP address (not one of the virtual ones)



Disable IPv6

sudo echo "net.ipv6.conf.all.disable_ipv6=1" >/etc/sysctl.d/disable-ipv6.conf sudo sysctl -p /etc/sysctl.d/disable-ipv6.conf


Network Interface Settings you will need to change to match your network settings.

Regular Host IP

auto eth0 iface eth0 inet static address 10.0.1.2 netmask 255.255.255.0 gateway 10.0.1.1 dns-nameservers 8.8.8.8 8.8.4.4

Ip used for STEAM caching

auto eth0:1 iface eth0:1 inet static address 10.0.1.11 netmask 255.255.0.0

Ip used for RIOT caching

auto eth0:2 iface eth0:2 inet static address 10.0.1.12 netmask 255.255.0.0

Ip used for Blizzard caching

auto eth0:3 iface eth0:3 inet static address 10.0.1.13 netmask 255.255.0.0

Ip used for Hirez caching

auto eth0:4 iface eth0:4 inet static address 10.0.1.14 netmask 255.255.0.0

Ip used for Origin caching

auto eth0:5 iface eth0:5 inet static address 10.0.1.15 netmask 255.255.0.0

Ip used for Sony caching

auto eth0:6 iface eth0:6 inet static address 10.0.1.16 netmask 255.255.0.0

Ip used for Microsoft caching

auto eth0:7 iface eth0:7 inet static address 10.0.1.17 netmask 255.255.0.0

Ip used for Tera caching

auto eth0:8 iface eth0:8 inet static address 10.0.1.18 netmask 255.255.0.0

Ip used for GOG caching

auto eth0:9 iface eth0:9 inet static address 10.0.1.19 netmask 255.255.0.0

Ip used for ArenaNetworks caching

auto eth0:10 iface eth0:10 inet static address 10.0.1.20 netmask 255.255.0.0

IP used for Apple caching

auto eth0:11 iface eth0:11 inet static address 10.0.1.21 netmask 255.255.0.0

IP used for WarGaming caching

auto eth0:12 iface eth0:12 inet static address 10.0.1.22 netmask 255.255.0.0

IP used for Uplay caching

auto eth0:13 iface eth0:13 inet static address 10.0.1.23 netmask 255.255.0.0

Ip used for Glyph caching

auto eth0:14 iface eth0:14 inet static address 10.0.1.24 netmask 255.255.0.0

IP used for ZeniMax caching

auto eth0:15 iface eth0:15 inet static address 10.0.1.25 netmask 255.255.255.0

IP used for digitalextremes caching

auto eth0:16 iface eth0:16 inet static address 10.0.1.26 netmask 255.255.255.0

IP used for pearlabyss caching

auto eth0:17 iface eth0:17 inet static address 10.0.1.27 netmask 255.255.255.0


host file

/etc/hosts

127.0.0.1 localhost

Change this line from lancache-server to your-host-name-of-server

127.0.1.1 lancache-server

The following lines are desirable for IPv6 capable hosts

::1 localhost ip6-localhost ip6-loopback

ff02::1 ip6-allnodes

ff02::2 ip6-allrouters

127.1.0.1 lancache-origin-backend 127.1.0.2 lancache-blizzard-backend

This is the primary IP (of the network card / eth) that your Lancache is using

lc-host-proxybind lancache-eth

The Following are Virtual IP's used by Lancache

lc-host-steam lancache-steam lc-host-riot lancache-riot lc-host-blizzard lancache-blizzard lc-host-hirez lancache-hirez lc-host-origin lancache-origin lc-host-sony lancache-sony lc-host-microsoft lancache-microsoft lc-host-enmasse lancache-enmasse lc-host-gog lancache-gog lc-host-arena lancache-arenanetworks lc-host-apple lancache-apple lc-host-wargaming lancache-wargaming lc-host-uplay lancache-uplay lc-host-glyph lancache-glyph lc-host-zenimax lancache-zenimax lc-host-digitalextremes lancache-digitalextremes lc-host-perlabyss lancache-pearlabyss

------- netdata install ---------

For all Linux systems, you can use this one liner to install the git version of netdata:

basic netdata installation

sudo su bash <(curl -Ss https://my-netdata.io/kickstart.sh)

or

install required packages for all netdata plugins

sudo su bash <(curl -Ss https://my-netdata.io/kickstart.sh) all

MadMage999 commented 6 years ago

Awesome, thanks!

I got to the line that says "apt-get install nload iftop httpyr" and I'm getting "cannot locate package httpyr".

nexusofdoom commented 6 years ago

sorry its httpry

MadMage999 commented 6 years ago

Yes, thank you, I made it from there despite some typos (which I realize this is your working copy, not final), to the line that says: "sudo dpkg -i ../sniproxy__.deb"

Now I got the error "dpkg: error: cannot access archive 'sniproxy__.deb': No such file or directory".

nexusofdoom commented 6 years ago

if you have a email I can send you a link to the shared file.

MadMage999 commented 6 years ago

nunyaatall at gmail dot com

nexusofdoom commented 6 years ago

once you get all services installed and ip's all changed reboot and check status of services and you should be good to go.