Skip to content

Manual Installation

kouhei edited this page Sep 15, 2022 · 7 revisions

Ubuntu20.04 LTS

Install squid

apt install squid apt install libmysqlclient-dev

# squid -v
Squid Cache: Version 5.2

Install Apache2 and MariaDB,PHP

apt install php8.1
apt install php8.1-gd php8.1-xml php8.1-mbstring php8.1-mysql php8.1-curl
apt install apache2
cd /var/www/
git clone -b v2.0 https://github.com/39ff/squid-db-auth-web
wget https://getcomposer.org/download/latest-stable/composer.phar
chmod +x composer.phar
./composer.phar install
curl -LsS https://r.mariadb.com/downloads/mariadb_repo_setup | sudo bash
apt install mariadb-server

Configure squid.conf

Add basic_db_auth

auth_param basic program /usr/lib/squid/basic_db_auth --dsn "DBI:mysql:host=172.17.0.1;port=3306;database=laravel;" --user phper --password secret --table squid_users --plaintext --persist
auth_param basic children 5
auth_param basic realm Web-Proxy
auth_param basic credentialsttl 1 minute
auth_param basic casesensitive off
acl db-auth proxy_auth REQUIRED

Add squid-db-auth-ip module

https://github.com/39ff/squid-db-auth-ip

external_acl_type ipdbauth ttl=60 children-startup=1 concurrency=100000 %>a /usr/bin/php /etc/squid/basic_db_ip_auth.php --dsn=mysql:dbname=test;host=127.0.0.1;charset=utf8mb4 --user=test --password=test
acl ipauth external ipdbauth
http_access allow ipauth

squidmin Setup

Create an Administrator

php artisan db:seed --class=CreateAdministratorSeeder