withlogin

by novehui
57 deployments · 57 still active · last rev. 3 months ago

Compatible with: Ubuntu 16.04 LTS
						#!/bin/bash
# Ubuntu 16 LTS

set -v
sudo su
sudo apt-get install unzip -y

sudo add-apt-repository ppa:ondrej/php -y

sudo apt-get -y update

sudo apt-get -y install apache2 php5.6 php5.6-gd wget 

libapache2-mod-php5.6

service apache2 restart

sudo apt-get install -y ntpdate

sudo apt-get install squid apache2-utils -y

sudo touch /etc/squid/passwd

sudo htpasswd -b /etc/squid/passwd boosted 247f2413

cat << EOF > /etc/squid/squid.conf
#numofproxy 24
http_port 24000
http_port 24001
http_port 24002
http_port 24003
http_port 24004
http_port 24005
http_port 24006
http_port 24007
http_port 24008
http_port 24009
http_port 24010
http_port 24011
http_port 24012
http_port 24013
http_port 24014
http_port 24015
http_port 24016
http_port 24017
http_port 24018
http_port 24019
http_port 24020
http_port 24021
http_port 24022
http_port 24023
http_port 24024
http_port 24025
auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
auth_param basic realm proxy
acl dreamtmup proxy_auth REQUIRED
acl dreamtmip src 24.136.2.75 0.0.0.0
http_access allow dreamtmup
cache deny all
via off
forwarded_for delete
request_header_access Via deny all
request_header_access Allow allow all
request_header_access Authorization allow all
request_header_access WWW-Authenticate allow all
request_header_access Proxy-Authorization allow all
request_header_access Proxy-Authenticate allow all
request_header_access Cache-Control allow all
request_header_access Content-Encoding allow all
request_header_access Content-Length allow all
request_header_access Content-Type allow all
request_header_access Date allow all
request_header_access Expires allow all
request_header_access Host allow all
request_header_access If-Modified-Since allow all
request_header_access Last-Modified allow all
request_header_access Location allow all
request_header_access Pragma allow all
request_header_access Accept allow all
request_header_access Accept-Charset allow all
request_header_access Accept-Encoding allow all
request_header_access Accept-Language allow all
request_header_access Content-Language allow all
request_header_access Mime-Version allow all
request_header_access Retry-After allow all
request_header_access Title allow all
request_header_access Connection allow all
request_header_access Proxy-Connection allow all
request_header_access User-Agent allow all
request_header_access Cookie allow all
request_header_access All deny all
always_direct deny all
EOF

service squid restart

cat << EOF > /var/www/html/user.config
USERNAME="boosted@boosted.com"
PASSWORD="boosted1234"
EOF

wget https://github.com/novvvvvi/vnstat/archive/master.zip -O /tmp/master.zip && unzip /tmp/master.zip -d /tmp

sudo cp -a /tmp/vnstat-master/  /var/www/html/vnstat
sudo apt-get install vnstat -y
chown -R root:www-data /etc/squid/*
chown -R root:www-data /var/www/*
chown www-data:www-data /etc/squid
chown -R root:www-data /etc/init.d/squid
chmod 775 /etc/squid/passwd
touch /etc/squid/passwd
touch /etc/squid/squid.conf
echo \'www-data ALL=(root) NOPASSWD:/etc/init.d/squid restart\'>> /etc/sudoers
wget https://github.com/novvvvvi/fidy29d/archive/master.zip -O /tmp/master.zip && unzip /tmp/master.zip -d /tmp

find /tmp/fidy29d-master/ -type f -print0 | xargs -0 mv -t /var/www/html