Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jaysridhar/6d3267e155a34e833332760985e9dcbb to your computer and use it in GitHub Desktop.
Save jaysridhar/6d3267e155a34e833332760985e9dcbb to your computer and use it in GitHub Desktop.
Installing Squid proxy on Ubuntu 18.04 by building from source

Installing prequisites

apt install g++
apt install make
apt install libssl1.0-dev

Building package

./configure --with-openssl \
  --prefix=/usr/local/squid \
  --sysconfdir=/etc/squid \
  --with-default-user=proxy \
  --with-logdir=/var/log/squid \
  --with-pidfile=/var/run/squid.pid \
  --enable-ssl-crtd
make
make install

Make logdir

mkdir -p /var/log/squid
chown -R proxy:proxy /var/log/squid

Initialize ssl_db

/usr/local/squid/libexec/ssl_crtd -c -s /var/lib/ssl_db

Start Squid Server

/usr/local/squid/sbin/squid

In case things stop working

  • Remove /var/lib/ssl_db directory and recreate as above.
@jaysridhar
Copy link
Author

jaysridhar commented Jun 21, 2023

A mess to compile the latest version 4.0.25.

  1. An error '__builtin___snprintf_chk’ output between ? and ?? bytes into a destination of size ??? which google tells me is a bug in GCC and can be ignored.
  2. Some warning about _REENTRANT not being defined.

And a host of other issues. Finally got it to compile with the following command.

make CFLAGS="-Wall -g -O2 -Wno-error=stringop-truncation -Wno-unknown-warning -Wno-cpp" SQUID_CXXFLAGS=""

At different points during the compilation, you may have to remove the last part of the command:

make CFLAGS="-Wall -g -O2 -Wno-error=stringop-truncation -Wno-unknown-warning -Wno-cpp"

Note: gcc --version shows gcc (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment