<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/deprecated'
         s:name='knowledgebase/linux/misc/deprecated'
         s:cUser='retep'
         s:oUser=''
         s:mUser='kron'>
        <s:content>This page contains bliki posts that are now probably past their use by date and should probably not be followed.&#xD;&#xA;&#xD;&#xA;1 mod_jk&#xD;&#xA;&#xD;&#xA;This will set you up with Apache 2, Tomcat, mod_jk and a working /jsp-examples/ page.&#xD;&#xA;&#xD;&#xA;To compile mod_jk, you will need the httpd-devel package installed.&#xD;&#xA;&#xD;&#xA;Grab the source tarball, unpack it and then:&#xD;&#xA;{code:none}&#xD;&#xA;cd jakarta-tomcat-connectors-1.2.15-src/jk/native&#xD;&#xA;./configure --with-apxs=/usr/sbin/apxs --with-java-home=/usr/java/jdk&#xD;&#xA;make&#xD;&#xA;make install&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Create /etc/httpd/conf.d/mod_jk.conf with these settings:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;JkWorkersFile /etc/httpd/conf/workers.properties&#xD;&#xA;JkLogFile     /var/log/httpd/mod_jk.log&#xD;&#xA;# Set the jk log level [debug/error/info]&#xD;&#xA;JkLogLevel    info&#xD;&#xA;# Select the log format&#xD;&#xA;JkLogStampFormat &quot;[%a %b %d %H:%M:%S %Y] &quot;&#xD;&#xA;# JkOptions indicate to send SSL KEY SIZE,&#xD;&#xA;JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories&#xD;&#xA;# JkRequestLogFormat set the request format&#xD;&#xA;JkRequestLogFormat     &quot;%w %V %T&quot;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Create /etc/httpd/conf/workers.properties with these settings:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;# Define 1 real worker using ajp13&#xD;&#xA;worker.list=worker1&#xD;&#xA;# Set properties for worker1 (ajp13)&#xD;&#xA;worker.worker1.type=ajp13&#xD;&#xA;worker.worker1.host=localhost&#xD;&#xA;worker.worker1.port=8009&#xD;&#xA;worker.worker1.lbfactor=50&#xD;&#xA;worker.worker1.cachesize=10&#xD;&#xA;worker.worker1.cache_timeout=600&#xD;&#xA;worker.worker1.socket_keepalive=1&#xD;&#xA;worker.worker1.reclycle_timeout=300&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;And then in your httpd.conf, setup a JkMount inside a VirtualHost, e.g.&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;&lt;VirtualHost *:80&gt;&#xD;&#xA;    ServerName www.example.com&#xD;&#xA;      JkMount  /jsp-examples/* worker1&#xD;&#xA;&lt;/VirtualHost&gt;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;If you have mod_jk2 installed, remove /etc/httpd/conf.d/mod_jk2.conf. Then restart Apache. Also start up Tomcat if you haven&apos;t already.&#xD;&#xA;&#xD;&#xA;http://www.example.com/jsp-examples/ should then take you to the JSP Examples page.&#xD;&#xA;&#xD;&#xA;Documentation taken from http://tomcat.apache.org/connectors-doc/howto/quick.html&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;1 Postfix, Amavis, MySQL and per-user content filtering with ClamAV and SpamAssassin&#xD;&#xA;&#xD;&#xA;NOTE: This HOWTO may/may not work with later versions of Amavisd and/or may be incorrect in places. It is recommended you follow a more up-to-date HOWTO.&#xD;&#xA;&#xD;&#xA;These notes are intended to be used with the PostfixAdmin setup here: http://bliki.rimuhosting.com/space/knowledgebase/linux/mail/postfixadmin+on+debian+sarge&#xD;&#xA;&#xD;&#xA;It will allow you to have per-user spam and/or virus filtering for your virtual users with Postfix.&#xD;&#xA;&#xD;&#xA;It uses Postfix, MySQL, ClamAV, SpamAssassin and Amavis to do the work.&#xD;&#xA;&#xD;&#xA;Note that you don&apos;t need PostfixAdmin to be installed, but you will need the MySQL setup from the other howto.&#xD;&#xA;&#xD;&#xA;There is only one change to the MySQL setup. Change the postfix.mailbox table to the following:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;CREATE TABLE `mailbox` (&#xD;&#xA;  `id` bigint(20) unsigned NOT NULL auto_increment,&#xD;&#xA;  `username` varchar(255) NOT NULL default &apos;&apos;,&#xD;&#xA;  `password` varchar(255) NOT NULL default &apos;&apos;,&#xD;&#xA;  `name` varchar(255) NOT NULL default &apos;&apos;,&#xD;&#xA;  `maildir` varchar(255) NOT NULL default &apos;&apos;,&#xD;&#xA;  `quota` int(10) NOT NULL default &apos;0&apos;,&#xD;&#xA;  `domain` varchar(255) NOT NULL default &apos;&apos;,&#xD;&#xA;  `created` datetime NOT NULL default &apos;0000-00-00 00:00:00&apos;,&#xD;&#xA;  `modified` datetime NOT NULL default &apos;0000-00-00 00:00:00&apos;,&#xD;&#xA;  `active` tinyint(1) NOT NULL default &apos;1&apos;,&#xD;&#xA;  `bypass_virus_checks` char(1) default &apos;Y&apos;,&#xD;&#xA;  `bypass_spam_checks` char(1) default &apos;Y&apos;,&#xD;&#xA;  PRIMARY KEY  (`username`),&#xD;&#xA;  UNIQUE KEY `id` (`id`),&#xD;&#xA;  KEY `username` (`username`)&#xD;&#xA;) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT=&apos;Postfix Admin - Virtual Mailboxes&apos;;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Install amavis with ClamAV and SpamAssassin:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install amavisd-new clamav spamassassin&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Change amavis to use MySQL for its user lookups. In /etc/amavis/amavisd.conf, you will need two lines like these (changed to match your database setup):&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;@lookup_sql_dsn = ( [ &apos;DBI:mysql:database=postfix;host=127.0.0.1&apos;, &apos;postfix&apos;, &apos;postfix&apos; ] );&#xD;&#xA;$sql_select_policy = &apos;SELECT *, id as policy_id FROM mailbox WHERE username IN (%k)&apos;;&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Postfix needs to be told to deliver mail to amavis for content filtering before final delivery. Add the following to /etc/postfix/master.cf:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;amavis unix - - - - 2 smtp&#xD;&#xA;        -o smtp_data_done_timeout=1200&#xD;&#xA;        -o smtp_send_xforward_command=yes&#xD;&#xA;&#xD;&#xA;127.0.0.1:10025 inet n - - - - smtpd&#xD;&#xA;        -o content_filter=&#xD;&#xA;        -o local_recipient_maps=&#xD;&#xA;        -o relay_recipient_maps=&#xD;&#xA;        -o smtpd_restriction_classes=&#xD;&#xA;        -o smtpd_client_restrictions=&#xD;&#xA;        -o smtpd_helo_restrictions=&#xD;&#xA;        -o smtpd_sender_restrictions=&#xD;&#xA;        -o smtpd_recipient_restrictions=permit_mynetworks,reject&#xD;&#xA;        -o mynetworks=127.0.0.0/8&#xD;&#xA;        -o strict_rfc821_envelopes=yes&#xD;&#xA;        -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks&#xD;&#xA;        -o smtpd_bind_address=127.0.0.1&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;And this into /etc/postfix/main.cf:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;content_filter = amavis:[127.0.0.1]:10024&#xD;&#xA;receive_override_options = no_address_mappings&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;Start up amavis and restart Postfix. Postfix should now deliver mail to amavis, which will run it through SpamAssassin and ClamAV, before passing it back to Postfix for final delivery.&#xD;&#xA;&#xD;&#xA;You can still add users/domains/aliases via PostfixAdmin. By default all users will have spam and virus filtering off. Change the bypass_virus_checks and bypass_spam_checks to &apos;N&apos; to enable the checks. &#xD;&#xA;&#xD;&#xA;Some tips:&#xD;&#xA;&#xD;&#xA;If amavis isn&apos;t working properly, stop it, and run &apos;amavis debug&apos; instead.&#xD;&#xA;&#xD;&#xA;You can make amavis always put the SpamAssassin headers into emails it has checked by setting the following in /etc/amavis/amavisd.conf:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;$sa_tag_level_deflt  = -999; # add spam info headers if at, or above that level&#xD;&#xA;{code}</s:content>
        <s:mTime>2007-11-23 14:48:21.0</s:mTime>
        <s:cTime>2007-04-24 20:29:45.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/Security'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/auto-restart'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/dkfilter setup'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/Security/Securing Your Server'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/ajax autocomplete'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/rpm based php5.1 install'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/bugzilla'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/Security/Port Knocking'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/misc/where has my disk space gone'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
