Archive | Reliable Penguin RSS feed for this section

Spam Assassin

http://www.spamassassin.org 1. Download/unpack distribution cd /root/archive wget http://www.spamassassin.org/released/Mail-SpamAssassin-2.60.tar.gz tar -xvzf Mail-SpamAssassin-2.60.tar.gz cd Mail-SpamAssassin-2.60 2. Install perl -MCPAN -e shell o conf prerequisites_policy ask install Mail::SpamAssassin quit 3. Test > spamassassin -t < sample-nonspam.txt > nonspam.out examine nonspam.out – it should have a header that say the message is not spam X-Spam-Status: No … > spamassassin [...]

http://www.spamassassin.org

1. Download/unpack distribution

cd /root/archive
wget http://www.spamassassin.org/released/Mail-SpamAssassin-2.60.tar.gz
tar -xvzf Mail-SpamAssassin-2.60.tar.gz
cd Mail-SpamAssassin-2.60

2. Install

perl -MCPAN -e shell
o conf prerequisites_policy ask
install Mail::SpamAssassin
quit

3. Test

> spamassassin -t < sample-nonspam.txt > nonspam.out
examine nonspam.out - it should have a header that say the message is not spam
        X-Spam-Status: No ...

> spamassassin -t < sample-spam.txt > spam.out
examine spam.out
        X-Spam-Status: Yes

4. Spamd

cd spamd
cp cp redhat-rc-script.sh /etc/init.d/spamd
service spamd start

add startup symlinks

5. Integrate with qmail

cd /root/archive
wget http://www.gbnet.net/~jrg/qmail/ifspamh/ifspamh

edit ifspamh and set location of spamc to /usr/bin/spamc

http://cr.yp.to/mess822.html

wget http://cr.yp.to/software/mess822-0.58.tar.gz
tar -xvzf mess822-0.58.tar.gz
cd mess822-0.58
make
make setup check
View Comments Continue Reading →

Squid + NTLM

Setup working directory > mkdir /root/squid > cd /root/squid Download squid and samba > wget http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE3.tar.gz > wget http://us2.samba.org/samba/ftp/samba-latest.tar.gz Unpack squid and samba > tar -xvzf squid-2.5.STABLE3.tar.gz > tar -xvzf samba-latest.tar.gz Build samba > cd samba-2.2.8a/source > ./configure –with-winbind –with-winbind-auth-challenge > make > make install Configure samba > cd /root/samba-2.2.8.a/examples/simple > cp smb.conf /usr/local/samba/lib/ > [...]

Setup working directory

> mkdir /root/squid
> cd /root/squid

Download squid and samba

> wget http://www.squid-cache.org/Versions/v2/2.5/squid-2.5.STABLE3.tar.gz
> wget http://us2.samba.org/samba/ftp/samba-latest.tar.gz

Unpack squid and samba

> tar -xvzf squid-2.5.STABLE3.tar.gz
> tar -xvzf samba-latest.tar.gz

Build samba

> cd samba-2.2.8a/source
> ./configure --with-winbind --with-winbind-auth-challenge
> make
> make install

Configure samba

> cd /root/samba-2.2.8.a/examples/simple
> cp smb.conf /usr/local/samba/lib/
> emacs /usr/local/samba/lib/smb.conf

Add the following lines to the [global] section of the smb.conf file:

    encrypt passwords = true
    workgroup = RELIABLEPENGUIN
    password server = ADTEST
    security = domain
    winbind uid = 10000-20000
    winbind gid = 10000-20000
    winbind use default domain = yes

Replace RELIABLEPENGUIN and ADTEST with the name of the domain and pdc to
be used for this install. Press Ctrl-X Ctrl-C to save and exit emacs.

Comment out entirely the [homes] and [printers] sections.

Join the server to the windows domain.

> ./smbpasswd -j RELIABLEPENGUIN -r ADTEST -U Administrator

Start the samba services:

> /usr/local/samba/bin/nmbd
> /usr/local/samba/bin/winbindd

Test and verify proper operation:

> /usr/local/samba/bin/wbinfo -t
Secret is good

If wbinfo returns "Secret is bad" then run the above command to join the domain
again.

> /usr/local/samba/bin/wbinfo -a RELIABLEPENGUIN\\Administrator%testing
plaintext password authentication succeeded
challenge/response password authentication succeeded

If you get and error then there is something wrong with the domain membership.

Now build squid:

> cd /root/squid/squid-2.5.STABLE3
> ./configure --enable-auth="ntlm,basic" \
     --enable-basic-auth-helpers="winbind" \
     --enable-ntlm-auth-helpers="winbind" \
     --sysconfdir=/etc/squid \
     --sbindir=/usr/sbin \
     --bindir=/usr/sbin \
     --libexecdir=/usr/lib/squid \
     --datadir=/usr/share/squid \
     --localstatedir=/var/run \
     --mandir=/usr/share/man
> make
> make install

Test the winbind helper:

> /usr/lib/squid/wb_auth -d
/wb_auth[16936](wb_basic_auth.c:168): basic winbindd auth helper build Jun  3 2003, 12:03:17 starting up...
RELIABLEPENGUIN\Administrator testing
/wb_auth[16936](wb_basic_auth.c:129): Got 'RELIABLEPENGUIN\Administrator testing' from squid (length: 37).
/wb_auth[16936](wb_basic_auth.c:55): winbindd result: 1
/wb_auth[16936](wb_basic_auth.c:58): sending 'OK' to squid
OK

Now configure squid to use the helper.
Edit /etc/squid/squid.conf and add the following lines:

  pid_filename /var/run/squid.pid

  ....

  cache_dir ufs /var/cache/squid 5000 16 256

  ....

  cache_access_log /var/log/squid/access.log

  ....

  cache_log /var/log/squid/cache.log

  ....

  cache_store_log /var/log/squid/store.log

  ....

  auth_param ntlm program /usr/lib/squid/wb_ntlmauth
  auth_param ntlm children 5
  auth_param ntlm max_challenge_reuses 0
  auth_param ntlm max_challenge_lifetime 2 minutes

  auth_param basic program /usr/lib/squid/wb_auth
  auth_param basic children 5
  auth_param basic realm Squid proxy-caching web server
  auth_param basic credentialsttl 2 hours

  ....

  acl localnetwork src 10.0.0.0/255.0.0.0
  acl password proxy_auth REQUIRED

  ....

  http_access allow password
  http_access allow localnetwork

Do squid cache setup:

> cd /var/cache
> mkdir squid
> chgrp squid squid
> chmod g+w squid
> squid -z

Do squid logs setup:

> cd /var/log
> mkdir squid
> chgrp squid squid
> chmod g+w squid

Setup squid and samba to start on boot:

The stock startup file distributed by redhat with squid is sufficient
for starting squid. This file is located at /etc/init.d/squid. If the file
does not exists on the target system then copy from another system or extract
from the redhat squid rpm.

A custom startup script is required for samba since we're not acting as a file
server - just nmbd and winbind. A suitable file is located at /etc/init.d/samba.
Copy this file to the target system.

Now symlink the startup scripts into the rc dirctories:

ln -s ../init.d/squid /etc/rc3.d/S25squid
ln -s ../init.d/samba /etc/rc3.d/S24samba
ln -s ../init.d/squid /etc/rc3.d/K25squid
ln -s ../init.d/samba /etc/rc3.d/K24samba

And that does it.
View Comments Continue Reading →

GNU WGet

ftp://ftp.gnu.org/pub/gnu/wget/wget-1.8.2.tar.gz > cd /root > ftp ftp.gnu.org >> cd /pub/gnu/wget/ >> bin >> get wget-1.8.2.tar.gz >> quit > tar -xvzf wget-1.8.2.tar.gz > cd wget-1.8.2 > ./configure > make > make install > cd /root > rm -rf wget-1.8.2 > mv wget-1.8.2.tar.gz archive Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share [...]

ftp://ftp.gnu.org/pub/gnu/wget/wget-1.8.2.tar.gz

> cd /root

> ftp ftp.gnu.org
>> cd /pub/gnu/wget/
>> bin
>> get wget-1.8.2.tar.gz
>> quit

> tar -xvzf wget-1.8.2.tar.gz
> cd wget-1.8.2
> ./configure
> make
> make install

> cd /root
> rm -rf wget-1.8.2
> mv wget-1.8.2.tar.gz archive
View Comments Continue Reading →

TFTPD Service Control Script

#!/bin/bash # tftp – tftp server # # chkconfig: – 50 50 # description: tftp server in standalone mode # # processname: /usr/sbin/in.tftpd # # source function library . /etc/init.d/functions # settings start ADDRESS=”192.168.2.1″ DIR=”/opt/tftproot” # settings end OPTIONS=”-v -l -a $ADDRESS -s $DIR” RETVAL=0 prog=”in.tftpd” start() { echo -n $”Starting $prog: ” if [ [...]

#!/bin/bash
# tftp - tftp server
#
# chkconfig: - 50 50
# description: tftp server in standalone mode
#
# processname: /usr/sbin/in.tftpd
#

# source function library
. /etc/init.d/functions

# settings start
ADDRESS="192.168.2.1"
DIR="/opt/tftproot"

# settings end

OPTIONS="-v -l -a $ADDRESS -s $DIR"
RETVAL=0
prog="in.tftpd"

start() {
        echo -n $"Starting $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                daemon /usr/sbin/in.tftpd $OPTIONS
                RETVAL=0
                [ $RETVAL -eq 0 ] && touch /var/lock/subsys/tftpd
        fi;
        echo
        return $RETVAL
}

stop() {
        echo -n $"Stopping $prog: "
        if [ $UID -ne 0 ]; then
                RETVAL=1
                failure
        else
                killproc /usr/sbin/in.tftpd
                RETVAL=$?
                [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/tftpd
        fi;
        echo
        return $RETVAL
}

reload(){
        stop
        start
}

restart(){
        stop
        start
}

condrestart(){
    [ -e /var/lock/subsys/tftpd ] && restart
    return 0
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        restart
        ;;
  reload)
        reload
        ;;
  condrestart)
        condrestart
        ;;
  status)
        status in.tftpd
        RETVAL=$?
        ;;
  *)
        echo $"Usage: $0 {start|stop|status|restart|condrestart|reload}"
        RETVAL=1
esac

exit $RETVAL
View Comments Continue Reading →

Webalizer

http://www.mrunix.net/webalizer/ cd /root/archive wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.01-10-src.tgz tar -xvzf webalizer-2.01-10-src.tgz cd webalizer-2.01-10 ./configure make make install Bookmark on Delicious Digg this post Recommend on Facebook share via Reddit Share with Stumblers Tweet about it Subscribe to the comments on this post Print for later Bookmark in Browser Tell a friend

http://www.mrunix.net/webalizer/

cd /root/archive
wget ftp://ftp.mrunix.net/pub/webalizer/webalizer-2.01-10-src.tgz
tar -xvzf webalizer-2.01-10-src.tgz
cd webalizer-2.01-10
./configure
make
make install
View Comments Continue Reading →