[ start | index | login ]
start > knowledgebase > linux > misc > deprecated

deprecated

Created by retep. Last edited by kron, 258 days ago. Viewed 925 times. #3
[diff] [history] [edit] [rdf]
labels
attachments
This page contains bliki posts that are now probably past their use by date and should probably not be followed.

mod_jk

This will set you up with Apache 2, Tomcat, mod_jk and a working /jsp-examples/ page.

To compile mod_jk, you will need the httpd-devel package installed.

Grab the source tarball, unpack it and then:

cd jakarta-tomcat-connectors-1.2.15-src/jk/native
./configure --with-apxs=/usr/sbin/apxs --with-java-home=/usr/java/jdk
make
make install

Create /etc/httpd/conf.d/mod_jk.conf with these settings:

JkWorkersFile /etc/httpd/conf/workers.properties
JkLogFile     /var/log/httpd/mod_jk.log
# Set the jk log level [debug/error/info]
JkLogLevel    info
# Select the log format
JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
# JkOptions indicate to send SSL KEY SIZE,
JkOptions     +ForwardKeySize +ForwardURICompat -ForwardDirectories
# JkRequestLogFormat set the request format
JkRequestLogFormat     "%w %V %T"

Create /etc/httpd/conf/workers.properties with these settings:

# Define 1 real worker using ajp13
worker.list=worker1
# Set properties for worker1 (ajp13)
worker.worker1.type=ajp13
worker.worker1.host=localhost
worker.worker1.port=8009
worker.worker1.lbfactor=50
worker.worker1.cachesize=10
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=1
worker.worker1.reclycle_timeout=300

And then in your httpd.conf, setup a JkMount inside a VirtualHost, e.g.

<VirtualHost *:80>
    ServerName www.example.com
      JkMount  /jsp-examples/* worker1
</VirtualHost>

If you have mod_jk2 installed, remove /etc/httpd/conf.d/mod_jk2.conf. Then restart Apache. Also start up Tomcat if you haven't already.

>>http://www.example.com/jsp-examples/ should then take you to the JSP Examples page.

Documentation taken from >>http://tomcat.apache.org/connectors-doc/howto/quick.html

Postfix, Amavis, MySQL and per-user content filtering with ClamAV and SpamAssassin

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.

These notes are intended to be used with the PostfixAdmin setup here: >>http://bliki.rimuhosting.com/space/knowledgebase/linux/mail/postfixadmin+on+debian+sarge

It will allow you to have per-user spam and/or virus filtering for your virtual users with Postfix.

It uses Postfix, MySQL, ClamAV, SpamAssassin and Amavis to do the work.

Note that you don't need PostfixAdmin to be installed, but you will need the MySQL setup from the other howto.

There is only one change to the MySQL setup. Change the postfix.mailbox table to the following:

CREATE TABLE `mailbox` (
  `id` bigint(20) unsigned NOT NULL auto_increment,
  `username` varchar(255) NOT NULL default '',
  `password` varchar(255) NOT NULL default '',
  `name` varchar(255) NOT NULL default '',
  `maildir` varchar(255) NOT NULL default '',
  `quota` int(10) NOT NULL default '0',
  `domain` varchar(255) NOT NULL default '',
  `created` datetime NOT NULL default '0000-00-00 00:00:00',
  `modified` datetime NOT NULL default '0000-00-00 00:00:00',
  `active` tinyint(1) NOT NULL default '1',
  `bypass_virus_checks` char(1) default 'Y',
  `bypass_spam_checks` char(1) default 'Y',
  PRIMARY KEY  (`username`),
  UNIQUE KEY `id` (`id`),
  KEY `username` (`username`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='Postfix Admin - Virtual Mailboxes';

Install amavis with ClamAV and SpamAssassin:

apt-get install amavisd-new clamav spamassassin

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):

@lookup_sql_dsn = ( [ 'DBI:mysql:database=postfix;host=127.0.0.1', 'postfix', 'postfix' ] );
$sql_select_policy = 'SELECT *, id as policy_id FROM mailbox WHERE username IN (%k)';

Postfix needs to be told to deliver mail to amavis for content filtering before final delivery. Add the following to /etc/postfix/master.cf:

amavis unix - - - - 2 smtp
        -o smtp_data_done_timeout=1200
        -o smtp_send_xforward_command=yes

127.0.0.1:10025 inet n - - - - smtpd -o content_filter= -o local_recipient_maps= -o relay_recipient_maps= -o smtpd_restriction_classes= -o smtpd_client_restrictions= -o smtpd_helo_restrictions= -o smtpd_sender_restrictions= -o smtpd_recipient_restrictions=permit_mynetworks,reject -o mynetworks=127.0.0.0/8 -o strict_rfc821_envelopes=yes -o receive_override_options=no_unknown_recipient_checks,no_header_body_checks -o smtpd_bind_address=127.0.0.1

And this into /etc/postfix/main.cf:

content_filter = amavis:[127.0.0.1]:10024
receive_override_options = no_address_mappings

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.

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 'N' to enable the checks.

Some tips:

If amavis isn't working properly, stop it, and run 'amavis debug' instead.

You can make amavis always put the SpamAssassin headers into emails it has checked by setting the following in /etc/amavis/amavisd.conf:

$sa_tag_level_deflt  = -999; # add spam info headers if at, or above that level
no comments | post comment
Powered by snipsnap.org Found a mistake in a howto? Let us know via an email to p.blikibugs at rimuhosting com.