Step 6: Integrate Squid and Web Safety ICAP

To integrate Squid and Web Safety ICAP server run the script from this archive.


# integrate with apache, enable virtual hosts
sed -i '' 's/\#Include etc\/apache24\/extra\/httpd-vhosts.conf/Include etc\/apache24\/extra\/httpd-vhosts.conf/' /usr/local/etc/apache24/httpd.conf

# enable wsgi
sed -i '' 's/\#LoadModule wsgi_module/LoadModule wsgi_module/' /usr/local/etc/apache24/modules.d/270_mod_wsgi.conf

# copy default and add our virtual host
if [ ! -f /usr/local/etc/apache24/extra/httpd-vhosts.conf.default ]; then
    cp -f /usr/local/etc/apache24/extra/httpd-vhosts.conf /usr/local/etc/apache24/extra/httpd-vhosts.conf.default
echo "Include /usr/local/etc/apache24/extra/websafety_virtual_host" > /usr/local/etc/apache24/extra/httpd-vhosts.conf

# replace the squid config
if [ ! -f /usr/local/etc/squid/squid.conf.default ]; then
    cp -f /usr/local/etc/squid/squid.conf /usr/local/etc/squid/squid.conf.default
cp -f squid.conf /usr/local/etc/squid/squid.conf

# create squid storage for mimicked ssl certificates
if [ -d $SSL_DB ]; then
    rm -Rf $SSL_DB

/usr/local/libexec/squid/ssl_crtd -c -s $SSL_DB
if [ $? -ne 0 ]; then
    echo "Error $? while initializing SSL certificate storage, exiting..."
    exit 1
chown -R squid:squid $SSL_DB

# reset owner of installation path
chown -R websafety:websafety /opt/websafety

# restart all daemons
service apache24 restart
service wsmgrd restart
service wsicapd restart
service squid restart

Press Next to continue to Step 6.