Friday, September 6, 2013

Install SquidGuard Manager 1.12 on Red Hat X86_64

Persiapan:
1. Download file http://www.sourceforge.net/projects/squidguardmgr/
2. Kopi filenya ke direktori /usr/local/src/

Compile:
[root@tester src]# tar xfvz squidguardmgr-1.12.tar.gz
[root@tester src]# cd squidguardmgr-1.12
[root@tester squidguardmgr-1.12]# perl -v

This is perl, v5.8.8 built for x86_64-linux-thread-multi

Copyright 1987-2006, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

[root@tester squidguardmgr-1.12]# perl Makefile.PL
Path to squidGuard configuration file? [] /usr/local/squidGuard/squidGuard.conf
Do you use c-icap SquidClamav v6.x services? [no] no
Path to squidclamav program? [off] off
What is the user (uid) running Squid or SquidGuard? [squid] squid
Writing Makefile for squidguardmgr
Done...

Now type 'make && make install'

[root@tester squidguardmgr-1.12]# make && make install
cc -o squid_wrapper/squid_wrapper squid_wrapper/squid_wrapper.c
sh install_all.sh

-----------------------------------------------------------------------------

1. Modify Apache httpd.conf to change the running uid and gid to squid user.
2. Modify your httpd.conf to allow access to CGI scripts like follow:

        Alias /squidguardmgr /var/www/squidguardmgr/
       
            Options +ExecCGI
            AddHandler cgi-script .cgi
            DirectoryIndex squidguardmgr.cgi
            Order deny,allow
            Deny from all
            Allow from 192.168.1.24
       

3. If necessary, set additional grants to Squidguard Manager in httpd.conf.
   Restart and ensure that httpd is running.
4. Browse to http://proxy.host.dom/squidguardmgr/ to ensure that things are
   working properly.
For more information, see http://squidguardmgr.darold.net/.
-----------------------------------------------------------------------------


Thursday, September 5, 2013

Install SquidGuard 1.4 on Red Hat 6.4 X86_64

Persiapan:
1. Install Berkeley DB http://rijalbuntu.blogspot.com/2013/09/install-berkeley-db-4329-on-redhat-64.html
2. Download file http://www.squidguard.org/Downloads/squidGuard-1.4.tar.gz
3. Kopikan ke /usr/local/src

Compile:
[root@tester src]# tar xvfz squidGuard-1.4.tar.gz
[root@tester src]# cd squidGuard-1.4

[root@tester squidGuard-1.4]# ../configure --with-db=/usr/local/BerkeleyDB.4.3 --with-ldap
[root@tester squidGuard-1.4]# make
[root@tester squidGuard-1.4]# make install
Installing squidGuard
Done.
Installing configuration file
Created directory /usr/local/squidGuard
Assigned /usr/local/squidGuard to user squid
Created directory /usr/local/squidGuard/db
Assigned /usr/local/squidGuard/db to user squid
Created directory /usr/local/squidGuard/log
Assigned /usr/local/squidGuard/log to user squid
Copied sample squidGuard.conf
/usr/local/squidGuard/squidGuard.conf is now readable
The initial configuration is complete.

Congratulation. SquidGuard is sucessfully installed.

Pengecekan:
[root@tester local]# cd /usr/local/squidGuard
[root@tester squidGuard]# ls -l /usr/local/squidGuard
total 12
drwxr-xr-x 2 squid root 4096 Sep  5 11:19 db
drwxr-xr-x 2 squid root 4096 Sep  5 11:19 log
-rw-r--r-- 1 root  root 1240 Sep  5 11:19 squidGuard.conf

Convert textfile to db:
[root@tester squidGuard]# /usr/local/bin/squidGuard -C all

[root@tester squidGuard]# tail -f log/squidGuard.log
2013-09-05 11:31:58 [17227] New setting: dbhome: /usr/local/squidGuard/db
2013-09-05 11:31:58 [17227] New setting: logdir: /usr/local/squidGuard/log
2013-09-05 11:31:58 [17227] Added User: root
2013-09-05 11:31:58 [17227] Added User: foo
2013-09-05 11:31:58 [17227] Added User: bar
2013-09-05 11:31:58 [17227] destblock good missing active content, set inactive
2013-09-05 11:31:58 [17227] destblock local missing active content, set inactive
2013-09-05 11:31:58 [17227] init domainlist /usr/local/squidGuard/db/blacklists/adult/domains
2013-09-05 11:32:20 [17227] create new dbfile /usr/local/squidGuard/db/blacklists/adult/domains.db
2013-09-05 11:32:22 [17227] init urllist /usr/local/squidGuard/db/blacklists/adult/urls
2013-09-05 11:32:22 [17227] create new dbfile /usr/local/squidGuard/db/blacklists/adult/urls.db
2013-09-05 11:32:22 [17227] init expressionlist /usr/local/squidGuard/db/blacklists/adult/expressions
2013-09-05 11:32:22 [17227] squidGuard 1.4 started (1378355518.638)
2013-09-05 11:32:22 [17227] db update done
2013-09-05 11:32:22 [17227] squidGuard stopped (1378355542.671)

Cek hasilnya:
[root@tester squidGuard]# ls -l db/blacklists/adult/*.db
-rw-r--r-- 1 root root 44257280 Sep  5 11:32 db/blacklists/adult/domains.db
-rw-r--r-- 1 root root  3444736 Sep  5 11:32 db/blacklists/adult/urls.db


Install Berkeley DB 4.3.29 on Redhat 6.4 X86_64

Persiapan:
1. Download file http://download.oracle.com/berkeley-db/db-4.3.29.tar.gz
2. Kopikan ke /usr/local/src

Compile:
[root@tester src]# tar xvfz db-4.3.29.tar.gz
[root@tester src]# cd /usr/local/src/db-4.3.29/
[root@tester db-4.3.29]# cd build_unix

[root@tester build_unix]# ../dist/configure
[root@tester build_unix]# make clean
[root@tester build_unix]# make

[root@tester build_unix]# make install
Installing DB include files: /usr/local/BerkeleyDB.4.3/include ...
Installing DB library: /usr/local/BerkeleyDB.4.3/lib ...
cp -p .libs/libdb-4.3.so /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.so
cp -p .libs/libdb-4.3.lai /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.la
cp -p .libs/libdb-4.3.a /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
ranlib /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
chmod 644 /usr/local/BerkeleyDB.4.3/lib/libdb-4.3.a
cp -p libdb.a /usr/local/BerkeleyDB.4.3/lib/libdb.a
ranlib /usr/local/BerkeleyDB.4.3/lib/libdb.a
chmod 644 /usr/local/BerkeleyDB.4.3/lib/libdb.a
PATH="$PATH:/sbin" ldconfig -n /usr/local/BerkeleyDB.4.3/lib
----------------------------------------------------------------------
Libraries have been installed in:
   /usr/local/BerkeleyDB.4.3/lib

If you ever happen to want to link against installed libraries
in a given directory, LIBDIR, you must either use libtool, and
specify the full pathname of the library, or use the `-LLIBDIR'
flag during linking and do at least one of the following:
   - add LIBDIR to the `LD_LIBRARY_PATH' environment variable
     during execution
   - add LIBDIR to the `LD_RUN_PATH' environment variable
     during linking
   - use the `-Wl,--rpath -Wl,LIBDIR' linker flag
   - have your system administrator add LIBDIR to `/etc/ld.so.conf'

See any operating system documentation about shared libraries for
more information, such as the ld(1) and ld.so(8) manual pages.
----------------------------------------------------------------------
Installing DB utilities: /usr/local/BerkeleyDB.4.3/bin ...
cp -p .libs/db_archive /usr/local/BerkeleyDB.4.3/bin/db_archive
cp -p .libs/db_checkpoint /usr/local/BerkeleyDB.4.3/bin/db_checkpoint
cp -p .libs/db_deadlock /usr/local/BerkeleyDB.4.3/bin/db_deadlock
cp -p .libs/db_dump /usr/local/BerkeleyDB.4.3/bin/db_dump
cp -p .libs/db_load /usr/local/BerkeleyDB.4.3/bin/db_load
cp -p .libs/db_printlog /usr/local/BerkeleyDB.4.3/bin/db_printlog
cp -p .libs/db_recover /usr/local/BerkeleyDB.4.3/bin/db_recover
cp -p .libs/db_stat /usr/local/BerkeleyDB.4.3/bin/db_stat
cp -p .libs/db_upgrade /usr/local/BerkeleyDB.4.3/bin/db_upgrade
cp -p .libs/db_verify /usr/local/BerkeleyDB.4.3/bin/db_verify
Installing documentation: /usr/local/BerkeleyDB.4.3/docs ...

Install to System:
[root@tester BerkeleyDB.4.3]# vim /etc/ld.so.conf.d/BerkeleyDB.conf
Masukkan "/usr/local/BerkeleyDB.4.3/lib"

[root@tester BerkeleyDB.4.3]# ldconfig

[root@tester BerkeleyDB.4.3]# ldconfig -v | grep libdb-4
ldconfig: /etc/ld.so.conf.d/kernelcap-2.6.18-348.el5.conf:6: duplicate hwcap 0 nosegneg
        libdb-4.3.so -> libdb.so
        libdb-4.2.so -> libdb-4.2.so
        libdb-4.3.so -> libdb-4.3.so
        libdb-4.1.so -> libdb-4.1.so
        libdb-4.2.so -> libdb-4.2.so
        libdb-4.3.so -> libdb-4.3.so
        libdb-4.1.so -> libdb-4.1.so

        libdb-4.3.so -> libdb.so

Pengecekan:
[root@tester src]# cd /usr/local/BerkeleyDB.4.3/
[root@tester BerkeleyDB.4.3]# ls -l /usr/local/BerkeleyDB.4.3/
total 16
drwxr-xr-x  2 root root 4096 Sep  5 10:27 bin
drwxr-xr-x 12 root root 4096 Sep  5 10:27 docs
drwxr-xr-x  2 root root 4096 Sep  5 10:27 include
drwxr-xr-x  2 root root 4096 Sep  5 10:27 lib