[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

TTY-Linux i486 / i686 Squid Proxy Server



Good day all,

I would just like to say to Douglas, thank you for maintaining this Linux distro and keeping it current.
We have found a variety of uses for this little Linux outside of what it was designed for.

One of those uses is creating a small Squid Proxy server that would run on very old hardware.

Our requirement was to put a small Linux in place to provide Caching Proxy service to 10 clients and this is still running very smoothly on a Pentium 4 3ghz 128mb ram.

Herewith the script to enable Squid to run on TTY-Linux, please feel free to update.

File attached to this discussion.

I have made a tbz for pacman, so no installs of perl required to compile squid, the package have been attached.

I hope you can find a use for this little distro as I have.

regards

#!/bin/bash
#############################################################
# TTY-Linux 16.1 Squid Server Setup                         #
# Script created by CypherBl8ke for the TTY-Linux community #
# This script is free without any warranty of any sort      #
# If you want to make changes, please feel free to do so,   #
# Please update the script with a versioning number and     #
# upload to the community.                                  #
#############################################################
# Start Script
# Check network config and proxy configuration
echo ""
echo "TTY-Linux 16.1 Squid Server setup script."
echo "Please follow the on screen prompts"
echo ""
echo "This script will fetch a few items from the internet"
echo "Do you have any internet connectivity?"
echo -n "[y] yes / [n] no :"
read -e internet
if [ $internet == "n" ]; then
echo "You require internet to run this script"
echo "Stopping script"
exit
else
echo "Do you have a proxy server?"
echo -n "[y] yes / [n] no :"
read -e proxy
fi
if [ $proxy == "y" ]; then
echo "Please enter your details:"
echo "example:http://username:[email protected]:port";
echo -n "server:"
read -e proxyserv
export http_proxy=$proxyserv
export https_proxy=$proxyserv
export ftp_proxy=$proxyserv
echo ""
else
echo "No Proxy server specified"
echo ""
fi

# Grab sources #
echo "We are going to fetch a few items such as:"
echo "* Active Perl"
echo "* Squid Web Proxy Binaries"
echo ""
wget -P /tmp http://download.activestate.com/ActivePerl/releases/5.16.3.1604/ActivePerl-5.16.3.1604-i686-linux-glibc-2.3.6-298023.tar.gz
wget -P /tmp http://www.squid-cache.org/Versions/v2/2.7/squid-2.7.STABLE9.tar.gz
echo ""

# extract contents of the sources #
echo ""
echo "extracting contents of packages"
echo "Extracting squid..."
cd /tmp && tar zxvf squid-2.7.STABLE9.tar.gz >nul
echo "Extracting ActivePerl..."
cd /tmp && tar zxvf ActivePerl-5.16.3.1604-i686-linux-glibc-2.3.6-298023.tar.gz >nul

# Create preliminary directories to work in #
echo ""
echo "Creating directories..."
mkdir /opt >Nul
mkdir /opt/perl >nul
echo "Setting up ActivePerl..."
cp -Rdpl /tmp/ActivePerl-5.16.3.1604-i686-linux-glibc-2.3.6-298023/perl/. /opt/perl >nul

# Set environment settings #
echo ""
echo "Appending PATH..."
export PATH=$PATH:/opt/perl/bin >nul

# Set permissions to allow binaries to execute #
echo ""
echo "Setting ActivePerl permissions..."
chmod -R 777 /opt >nul
chown -R 777 /opt >nul

# Configure Squid #
echo ""
echo "Getting Squid ready for setup..."
echo "Checking for packages to compile..."
cd /tmp/squid-2.7.STABLE9 && ./configure --prefix=/opt/squid >nul
echo "Compiling squid binaries..."
cd /tmp/squid-2.7.STABLE9 && make >nul
echo "Installing squid..."
cd /tmp/squid-2.7.STABLE9 && make install >nul
echo ""
echo "Installation complete."
echo ""


# Perform cleanup #
echo "Cleanup..."
echo "Perl"
rm -f -r /opt/perl >nul
echo "ActivePerl temp"
rm -f -r /tmp/ActivePerl-5.16.3.1604-i686-linux-glibc-2.3.6-298023.tar.gz >nul
rm -f -r /tmp/ActivePerl-5.16.3.1604-i686-linux-glibc-2.3.6-298023 >nul
echo "Squid temp"
rm -f -r /tmp/squid-2.7.STABLE9.tar.gz >nul
rm -f -r /tmp/squid-2.7.STABLE9 >nul
echo ""

# Create Squid Cache #
echo "Finalizing Squid setup"
mkdir -p /opt/squid/var/cache
chown -R 777 /opt/squid/var/cache
chmod -R 777 /opt/squid/var/cache
/opt/squid/sbin/squid -z
echo ""
echo "Installation completed"
echo "Please edit the config file /opt/squid/etc/squid.conf"
echo ""