# dspam-web with mod_perl

## fixinko

Hello,

I'm trying to run dspam-web with mod_perl/2.0.3 (apache 2.2.9), but I've got this error

```

Error message:

Can't locate configure.pl in @INC (@INC contains: /home/httpd/perl /etc/perl /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux /usr/lib64/perl5/vendor_perl/5.8.8 /usr/lib64/perl5/vendor_perl /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux /usr/lib64/perl5/site_perl/5.8.8 /usr/lib64/perl5/site_perl /usr/lib64/perl5/5.8.8/x86_64-linux /usr/lib64/perl5/5.8.8 /usr/local/lib/site_perl . /usr/lib64/apache2) at /services/www/default/cgi-bin/dspam.cgi line 28. ,

```

my mod_perl.conf:

```

<IfDefine PERL>

  <IfModule !mod_perl.c>

    LoadModule perl_module    modules/mod_perl.so

  </IfModule>

</IfDefine>

<IfModule mod_perl.c>

    PerlRequire "/etc/apache2/modules.d/apache2-mod_perl-startup.pl"

    Alias /perl/ /services/www/default/cgi-bin/

    Alias /cgi-perl/ /services/www/default/cgi-bin/

    Alias /cgi-bin/ /services/www/default/cgi-bin/

    <Location /perl-status>

        SetHandler perl-script

        PerlResponseHandler Apache2::Status

        Order deny,allow

        Deny from all

        Allow from xxx.xxx.xxx.xxx

    </Location>

    PerlModule ModPerl::Registry

    <Files ~ "\.(pl|cgi)$">

        SetHandler perl-script

        PerlResponseHandler ModPerl::PerlRun

        Options +ExecCGI

        PerlSendHeader On

    </Files>

</ifModule>

```

and virtualhost definition:

```

<VirtualHost *:80>

        DocumentRoot /services/www/default/htdocs/dspam

        ServerAdmin webmaster@domain.tld

        ServerName dspam.domain.tld

        RewriteEngine On

        RewriteRule ^/?$ /cgi-bin/dspam.cgi [redirect,last]

        LogSQLTransferLogTable domain_tld_log

        ErrorLog /var/log/apache2/vh-domain.tld-error_log

        CustomLog /var/log/apache2/vh-domain.tld-access_log combined

 </VirtualHost>

```

I think that is something nasty with dspam-web and mod_perl, because awstats and mailgraph work fine. When I ran dspam.cgi (perl dspam.cgi)from shell, I've got this output

```
invalid command syntax.

syntax: dspam_admin [function] [arguments] [--profile=PROFILE]

        add preference [user] [attrib] [value]

        change preference [user] [attrib] [value]

        delete preference [user] [attrib] [value]

        list preference [user] [attrib] [value]

        aggregate preference [user]

Expires: now

Pragma: no-cache

Cache-control: no-cache

Content-type: text/html

<HTML>

<HEAD><TITLE>DSPAM v3 Control Center</TITLE>

<LINK REL="STYLESHEET" HREF="/services/www/default/htdocs/dspam-web/base.css">

</HEAD>

<BODY BGCOLOR=#FFFFFF TEXT=#000000 LINK=#000000 VLINK=#000000 ALINK=#000000>

<div id="header">

        <div id="logo">

                <a href="dspam.cgi" title="Home"><img src="/services/www/default/htdocs/dspam-web/dspam-logo-small.gif" alt="DSPAM Logo" /></a>

        </div>

        <div id="userinfo">

                Statistical SPAM Protection for <strong></strong>

        </div>

</div>

<br clear="left" />

<div id="navcontainer">

        <ul id="navlist">

                <li><a href="dspam.cgi?template=performance">Performance</a></li>

                <li><a href="dspam.cgi?template=preferences">Preferences</a></li>

                <li><a href="dspam.cgi?template=alerts">Alerts</a></li>

                <li><a href="dspam.cgi?template=quarantine">Quarantine ()</a></li>

                <li><a href="dspam.cgi?template=analysis">Analysis</a></li>

                <li><a href="dspam.cgi?template=history&history_page=1">History</a></li>

                

        </ul>

</div>

<div id="panel">

<H2>An Error Has Occured</H2>

The following error occured while trying to process your request: <BR>

<B>System Error. I was unable to determine your identity.</B><BR>

<BR>

If this problem persists, please contact your administrator.

</div>

<div id="footer">

<p>

<a href="http://dspam.nuclearelephant.com">DSPAM</a> is a registered trademark of <a href="http://www.nuclearelephant.com">Jonathan A. Zdziarski</a>. Copyright &copy; 2005, Jonathan A. Zdziarski

</p>

</div>

</BODY>

</HTML>

```

So I've all files belongs to dspam.cgi in the same directory and in @INC path.

Output from perl -V command

```

Summary of my perl5 (revision 5 version 8 subversion 8) configuration:

  Platform:

    osname=linux, osvers=2.6.25-hardened-r2, archname=x86_64-linux

    uname='linux phoenix 2.6.25-hardened-r2 #1 smp mon jul 28 18:07:57 local time zone must be set--see zic x86_64 quad-core amd opteron(tm) processor 2354 authenticamd gnulinux '

    config_args='-des -Darchname=x86_64-linux -Dcccdlflags=-fPIC -Dccdlflags=-rdynamic -Dcc=x86_64-pc-linux-gnu-gcc -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr -Dlocincpth=  -Doptimize=-march=k8 -O2 -pipe -Duselargefiles -Dd_semctl_semun -Dscriptdir=/usr/bin -Dman1dir=/usr/share/man/man1 -Dman3dir=/usr/share/man/man3 -Dinstallman1dir=/usr/share/man/man1 -Dinstallman3dir=/usr/share/man/man3 -Dman1ext=1 -Dman3ext=3pm -Dinc_version_list=5.8.0 5.8.0/x86_64-linux 5.8.2 5.8.2/x86_64-linux 5.8.4 5.8.4/x86_64-linux 5.8.5 5.8.5/x86_64-linux 5.8.6 5.8.6/x86_64-linux 5.8.7 5.8.7/x86_64-linux  -Dcf_by=Gentoo -Ud_csh -Dusenm -Di_ndbm -Di_gdbm -Di_db -Dusrinc=/usr/include/gentoo-multilib/amd64 -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64'

    hint=recommended, useposix=true, d_sigaction=define

    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef

    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef

    use64bitint=define use64bitall=define uselongdouble=undef

    usemymalloc=n, bincompat5005=undef

  Compiler:

    cc='x86_64-pc-linux-gnu-gcc', ccflags ='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm',

    optimize='-march=k8 -O2 -pipe',

    cppflags='-fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/include/gdbm'

    ccversion='', gccversion='3.4.6 (Gentoo Hardened 3.4.6-r2 p1.5, ssp-3.4.6-1.0, pie-8.7.10)', gccosandvers=''

    intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678

    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16

    ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8

    alignbytes=8, prototype=define

  Linker and Libraries:

    ld='x86_64-pc-linux-gnu-gcc', ldflags =' -L/usr/local/lib64'

    libpth=/usr/local/lib64 /lib64 /usr/lib64

    libs=-lpthread -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lc

    perllibs=-lpthread -lnsl -ldl -lm -lcrypt -lutil -lc

    libc=/lib/libc-2.6.1.so, so=so, useshrplib=false, libperl=libperl.a

    gnulibc_version='2.6.1'

  Dynamic Linking:

    dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-rdynamic'

    cccdlflags='-fPIC', lddlflags='-shared -L/usr/local/lib64'

Characteristics of this binary (from libperl): 

  Compile-time options: PERL_MALLOC_WRAP USE_64_BIT_ALL USE_64_BIT_INT

                        USE_LARGE_FILES USE_PERLIO

  Built under linux

  Compiled at Jul 28 2008 19:54:02

  @INC:

    /etc/perl

    /usr/lib64/perl5/vendor_perl/5.8.8/x86_64-linux

    /usr/lib64/perl5/vendor_perl/5.8.8

    /usr/lib64/perl5/vendor_perl

    /usr/lib64/perl5/site_perl/5.8.8/x86_64-linux

    /usr/lib64/perl5/site_perl/5.8.8

    /usr/lib64/perl5/site_perl

    /usr/lib64/perl5/5.8.8/x86_64-linux

    /usr/lib64/perl5/5.8.8

    /usr/local/lib/site_perl

    .

```

----------

