[squid-users] Squid 3.5.x install problem

L.P.H. van Belle belle at bazuin.nl
Thu Mar 3 14:14:26 UTC 2016


Or if you cant wait use this script, works on debian Jessie so adapting it to ubuntu should be easy. 

Im using this for 3.5.10 to 3.5.15 

 

## PROGRAM BUILD SQUID for DEB PACKAGING

#!/bin/bash

#

## LAST TEST DATE : 01-02-2016. ( debian Jessie ) 

#

## to make squid 3.5.x from Debian SID work on Debian Jessie, the following ## is needed.

## 1) libecap dependes on GCC 5.2, this is changed to 4.9 (Jessie version) ## (debian/control)

## 2) we added --enable-ssl, --with-openssl, for ssl support

## 3) we changed : --enable-async-io=8 to --enable-async-io

## 4) the correct order of installing files is needed.

##

## !! first run must be with parameter : all !!

## !! if this is not done, the build wil fail !

 

# Build path, where the sources are downloaded to, we also add the build date to the folder

# normaly not needed to change.

YOURFILES=/home/build

 

# SET THE BUILDNAME HERE !

# your packages now look like :

#     squid_3.5.15-1custom1-ssl_amd64.deb

BUILDNAME="custom"

 

# where do created debs go.

# ! this wil result in /var/www/html/OS/OS_release 

# like : /var/www/html/debian/jessie

# not tested on ubuntu yet, but this should work. 

# The best is to keep this default

DEBLOCATION="/var/www/html"

 

# Repo-Type choose : local or web

# example : in /etc/apt/sources.list.d/localrepo.list you get:

#    deb file:/var/www/html/debian/jessie      (= local)

# or deb http://localhost/debian/jessie        (= web, localhost only)

# or deb http://hostname.fqdn/debian/jessie    (= web, network enabled)

# If you choose web, we check if there is a process LISTEN 80

# if not, apache2 is installed automaticly. 

# best it to keep web, but only apache2 is supported for now.

REPOTYPE="web"

 

# Optional

# set to no if you NEVER want apache to be installed.

INSTALL_APACHE=yes

 

 

########## CODE BELOW

 

if [ -z $1 ]; then

    echo "Please use one of the following parameters"

    echo "squid c-icap libecap all"

    echo "example. ./setup-squid.sh all"

    echo "example. ./setup-squid.sh squid"

    echo " !!! The first build MUST BE : ./setup-squid.sh all  !!!!"

    exit 0

fi

 

DATE_NOW=$(date +%Y-%m-%d)

CURRENT_DATE=$(date -R)

BUILDPATH=${YOURFILES}/${DATE_NOW}

 

if [ -e /etc/os-release ]; then

    source /etc/os-release

    ID_RELEASE=$(echo ${VERSION} | awk '{print $2}' | cut -c2-10| rev |cut -c2-10|rev)

    if [ ! -d /var/www/html/${ID}/${ID_RELEASE} ]; then

        mkdir -p /var/www/html/${ID}/${ID_RELEASE}

    fi

else

    echo "Error, able import settings from /etc/os-release file"

    echo "exiting now, unable to detect you running OS. "

    exit 0

fi

 

function update-debs () {

    cd ${BUILDPATH}

    mv *.deb ${DEBLOCATION}/${ID}/${ID_RELEASE}

    cd ${DEBLOCATION}

    dpkg-scanpackages ${ID}/${ID_RELEASE} /dev/null | gzip -9c > ${ID}/${ID_RELEASE}/Packages.gz

    echo "Running apt-get update, please wait."

    apt-get update 2> /dev/null

    sleep 1

    cd ${BUILDPATH}

}

 

function change-c-icap () {

    C_ICAP_VER=$(ls | grep c-icap | grep -v modules | grep tar.xz | tail -n1 | rev| cut -d"." -f4 | cut -d"-" -f1 | rev)

    C_ICAP_PKGVER=$(ls | grep c-icap | grep -v modules | grep orig.tar.gz | tail -n1|  cut -d"_" -f2 | cut -d"." -f1,2,3)

    C_ICAP_CUSTOMVER=$(ls | grep c-icap | grep -v modules | grep ${BUILDNAME} | wc -l)

    C_ICAP_COUNTER=$(expr $C_ICAP_CUSTOMVER + 1)

 

    cat << EOF >> c-icap-${C_ICAP_PKGVER}/debian/changelog.new

c-icap (1:${C_ICAP_PKGVER}-${C_ICAP_VER}-${BUILDNAME}${C_ICAP_COUNTER}) unstable; urgency=medium

 

  * Rebuilt for ${ID} ${ID_RELEASE}

 

 -- Unknown User <not at existing.tld>  ${CURRENT_DATE}

 

EOF

 

    cat c-icap-${C_ICAP_PKGVER}/debian/changelog >> c-icap-${C_ICAP_PKGVER}/debian/changelog.new

    mv c-icap-${C_ICAP_PKGVER}/debian/changelog c-icap-${C_ICAP_PKGVER}/debian/changelog.old

    mv c-icap-${C_ICAP_PKGVER}/debian/changelog.new c-icap-${C_ICAP_PKGVER}/debian/changelog

}

 

function change-c-icap-modules () {

    C_ICAP_MODVER=$(ls | grep c-icap | grep modules | grep tar.xz | tail -n1 | rev| cut -d"." -f4 | cut -d"-" -f1 | rev)

    C_ICAP_MODPKGVER=$(ls | grep c-icap | grep modules | grep orig.tar.gz | tail -n1|  cut -d"_" -f2 | cut -d"." -f1,2,3)

    C_ICAP_MODCUSTOMVER=$(ls | grep c-icap | grep modules | grep ${BUILDNAME} | wc -l)

    C_ICAP_MODCOUNTER=$(expr $C_ICAP_MODCUSTOMVER + 1)

 

    cat << EOF >> c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog.new

c-icap-modules (1:${C_ICAP_MODPKGVER}-${C_ICAP_MODVER}-${BUILDNAME}${C_ICAP_MODCOUNTER}) unstable; urgency=medium

 

  * Rebuilt for ${ID} ${ID_RELEASE}

 

 -- Unknown User <not at existing.tld>  ${CURRENT_DATE}

 

EOF

 

    cat c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog >> c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog.new

    mv c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog.old

    mv c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog.new c-icap-modules-${C_ICAP_MODPKGVER}/debian/changelog

}

 

function change-libecap () {

    LIBECAPVER=$(ls | grep libecap| grep tar.xz | tail -n1 | cut -d"_" -f2 | cut -d"." -f1,2,3 | cut -d"-" -f2)

    LIBECAPPKGVER=$(ls | grep libecap| grep orig.tar.gz | tail -n1| cut -d"_" -f2 | cut -d"." -f1,2,3)

    LIBECAPCUSTOMVER=$(ls | grep libecap| grep ${BUILDNAME} | wc -l)

    LIBECAPCOUNTER=$(expr $LIBECAPCUSTOMVER + 1)

 

    cat << EOF >> libecap-${LIBECAPPKGVER}/debian/changelog.new

libecap (${LIBECAPPKGVER}-${LIBECAPVER}-${BUILDNAME}${LIBECAPCOUNTER}) unstable; urgency=medium

 

  * debian/control changed G++ 5.2 to G++ 4.9 ${ID_RELEASE}

    - Rebuilt for ${ID} ${ID_RELEASE}

 

 -- Unknown User <not at existing.tld>  ${CURRENT_DATE}

 

EOF

 

    sed -i 's/g++ (>= 4:5.2)/g++ (>= 4:4.9)/g' libecap-${LIBECAPPKGVER}/debian/control

    cat libecap-${LIBECAPPKGVER}/debian/changelog >> libecap-${LIBECAPPKGVER}/debian/changelog.new

    mv libecap-${LIBECAPPKGVER}/debian/changelog libecap-${LIBECAPPKGVER}/debian/changelog.old

    mv libecap-${LIBECAPPKGVER}/debian/changelog.new libecap-${LIBECAPPKGVER}/debian/changelog

}

 

function change-squid () {

    SQUIDVER=`ls | grep squid | grep tar.xz | cut -d"_" -f2 | cut -d"." -f1,2,3 | cut -d"-" -f2`

    SQUIDPKGVER=`ls | grep squid | grep orig.tar.gz | cut -d"_" -f2 | cut -d"." -f1,2,3`

    SQUIDCUSTOMVER=$(ls | grep squid | grep ${BUILDNAME} | wc -l)

    SQUIDCOUNTER=$(expr $SQUIDCUSTOMVER + 1)

if [ `cat squid3-${SQUIDPKGVER}/debian/rules | grep "with-openssl" | wc -l` -ge 1 ]; then

    echo "squid rules already changed"

else

    sed -i 's/--with-default-user=proxy/--with-default-user=proxy \\/g' squid3-${SQUIDPKGVER}/debian/rules

    sed -i '/with-default-user=proxy/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ --enable-ssl \\'  squid3-${SQUIDPKGVER}/debian/rules

    sed -i '/enable-ssl/a \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ --with-openssl \\'  squid3-${SQUIDPKGVER}/debian/rules

    sed -i 's/--enable-async-io=8/--enable-async-io/g' squid3-${SQUIDPKGVER}/debian/rules

 

    cat << EOF >> squid3-${SQUIDPKGVER}/debian/changelog.new

squid3 (${SQUIDPKGVER}-${SQUIDVER}-${BUILDNAME}${SQUIDCOUNTER}-ssl) unstable; urgency=medium

 

  * rebuild from Debian Sid to ${ID_RELEASE}

    - rebuild against G++ 4.9

    - added parameters debian/rules

        --enable-ssl-crtd

        --with-open-ssl

    - changed parameters debian/rules

        --enable-async-io=8 to --enable-async-io

 

 -- Unknown User <not at existing.tld>  ${CURRENT_DATE}

 

EOF

        cat squid3-${SQUIDPKGVER}/debian/changelog >> squid3-${SQUIDPKGVER}/debian/changelog.new

        mv squid3-${SQUIDPKGVER}/debian/changelog squid3-${SQUIDPKGVER}/debian/changelog.old

        mv squid3-${SQUIDPKGVER}/debian/changelog.new squid3-${SQUIDPKGVER}/debian/changelog

 

fi

}

 

function setup-repo () {

if [ ! -e ${DEBLOCATION}/${ID}/${ID_RELEASE} ]; then

    mkdir -p  ${DEBLOCATION}/${ID}/${ID_RELEASE}

    apt-get install dpkg-dev cdbs -y

else

    echo "setup of ${DEBLOCATION} already done"

fi

 

if [ ! -e ${BUILDPATH} ]; then

    mkdir -p  ${BUILDPATH}

else

    echo "setup of ${BUILDPATH} already done"

fi

 

if [ ! -e /etc/apt/sources.list.d/sid.list ]; then

    # adding sid repo

    cat << EOF >> /etc/apt/sources.list.d/sid.list

#

#deb http://ftp.nl.debian.org/debian/ sid main non-free contrib

deb-src http://ftp.nl.debian.org/debian/ sid main non-free contrib

EOF

else

    echo "sid repo already setup"

fi

 

echo "Updating apt-repo, please wait"

apt-get update >/dev/null

 

if [ ! -e /etc/apt/sources.list.d/localrepo.list ]; then

    cat << EOF >> /etc/apt/sources.list.d/localrepo.list

#

# change to your needs.

EOF

 

if [ ${REPOTYPE} = "local" ]; then

    cat << EOF >> /etc/apt/sources.list.d/localrepo.list

deb file:${DEBLOCATION}/${ID}/ ${ID_RELEASE}/

#deb http://localhost/${ID}/ ${ID_RELEASE}/

EOF

fi

if [ ${REPOTYPE} = "web" ]; then

    if [ `netstat -tan | grep tcp | grep ":80" | wc -l` -ge 0 ]; then

        if [ ${INSTALL_APACHE} = "yes" ]; then

            apt-get install apache2 -y --no-install-recommends

        fi

    fi

    cat << EOF >> /etc/apt/sources.list.d/localrepo.list

#deb file:${DEBLOCATION}/${ID}/ ${ID_RELEASE}/

deb http://localhost/${ID}/ ${ID_RELEASE}/

EOF

    fi

 

else

    echo "local repo already setup"

fi

 

    cd ${BUILDPATH}

 

}

## Program start

## setup the repo, 

## its needed to make below happen because of depends of packages.

setup-repo

 

if [ "${1}" = "all" ]; then

### AGAIN,!! ORDER IS IMPORTANT BECAUSE OF THE DEPENDS.. 

## C-icap

apt-get source c-icap

change-c-icap

apt-get build-dep c-icap

apt-get source c-icap -b

update-debs

 

## C-icap-modules

apt-get source c-icap-modules

change-c-icap-modules

apt-get build-dep c-icap-modules

apt-get source c-icap-modules -b

update-debs

 

## Libecap

apt-get source libecap

change-libecap

apt-get build-dep libecap

apt-get source libecap -b

update-debs

 

## Squid

apt-get source squid

change-squid

apt-get build-dep squid

apt-get source squid -b

update-debs

 

fi

 

if [ "${1}" = "squid" ]; then

## Squid

apt-get source squid

change-squid

apt-get build-dep squid

apt-get source squid -b

update-debs

 

fi

 

if [ "${1}" = "c-icap" ]; then

apt-get source c-icap

change-c-icap

apt-get build-dep c-icap

apt-get source c-icap -b

update-debs

 

## C-icap-modules

apt-get source c-icap-modules

change-c-icap-modules

apt-get build-dep c-icap-modules

apt-get source c-icap-modules -b

update-debs

fi

 

if [ "${1}" = "libecap" ]; then

## Libecap

apt-get source libecap

change-libecap

apt-get build-dep libecap

apt-get source libecap -b

update-debs

fi

 

 

## PROGRAM END ### 

 

 

> -----Oorspronkelijk bericht-----

> Van: squid-users [mailto:squid-users-bounces at lists.squid-cache.org] Namens

> Rafael Akchurin

> Verzonden: donderdag 3 maart 2016 14:55

> Aan: squid-users at lists.squid-cache.org

> Onderwerp: Re: [squid-users] Squid 3.5.x install problem

> 

> And if you donot mind waiting a week or so - we plan to have ready to

> sslbump + ecap squid3 for ubuntu 14.04 at ubuntu.diladele.com repo.

> 

> Best regards,

> Rafael

> 

> > Op 3 mrt. 2016 om 13:06 heeft Amos Jeffries <squid3 at treenet.co.nz> het

> volgende geschreven:

> >

> >> On 3/03/2016 10:45 p.m., secoonder wrote:

> >> Hello

> >> i used debian(ubuntu 14.04)

> >> I read  a lot of articles on the Internet for squid 443 enable

> redirection.

> >> As i learned,if port 443 is active from squid,The installed needs by

> the

> >> compiled squid.is it true ?

> >

> > Yes, The Debian and Ubuntu binary packages do not come with OpenSSL

> support.

> >

> >

> >> am i installed apt-get install squid for 443 redirect?(80.ports

> redirect

> >> wasno problem,it works.the problem is 443 port)

> >>

> >> i installed squid 3.5.8 package from squid-cache.And then i went to

> >> squid.3.5.8 folder.

> >> and then ,

> >> ./configure --with-openssl --enable-ssl-crtd

> >> make

> >> make install

> >> When it was finished, i wanted to go /etc/squid folder.

> >>

> >> But the /etc/squid or /etc/squid3 folder does not exit.

> >> What can i do?

> >> am i find step by step squid 3.5.x SSL (80 and 443 port) installation?

> >> Thank you very Much

> >

> > Are you aware of how to use alternative repositories with apt-get ?

> >

> > There is now a 3.5 package in the Ubuntu xenial repository. You will

> > need to add that repository to your sources.list for deb and deb-src.

> >

> > If you want/need eCAP you will need to build a new libecap3 and

> > libecap3-dev package for your old Ubuntu system and install those before

> > starting to build Squid:

> >  apt-get -t trusty build-dep libecap

> >  apt-get -t xenial -b source libecap3

> >  apt-get -t xenial -b source libecap3-ev

> >

> > Otherwise you will need to remove the --enable-ecap line when eiting the

> > squid package debian/rules file.

> >

> > To build squid:

> > apt-get -t trusty install libssl-dev

> > apt-get -t trusty build-dep squid

> > apt-get -t xenial -b source squid

> >

> > the first time you run the build of 'squid' package should fail.

> >

> > Go into the folder it creates and then the debian/ sub-folder and edit

> > the file called 'rules'.

> >

> > What you are doing is adding --with-openssl to the list of Squid

> > features to build. And maybe removing the --enable-ecap if you dont want

> > do the above ecap steps.

> >

> >

> > Then go back out to th directory you started in and run this command

> again:

> >  apt-get -t xenial -b source squid

> >

> > this should succeed, and the resulting package will have OpenSSL

> support.

> >

> > Amos

> >

> > _______________________________________________

> > squid-users mailing list

> > squid-users at lists.squid-cache.org

> > http://lists.squid-cache.org/listinfo/squid-users

> _______________________________________________

> squid-users mailing list

> squid-users at lists.squid-cache.org

> http://lists.squid-cache.org/listinfo/squid-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.squid-cache.org/pipermail/squid-users/attachments/20160303/3940d90b/attachment-0001.html>


More information about the squid-users mailing list