Monthly Archives: October 2013

Tomcat hint – Debian

Download java: http://www.oracle.com/technetwork/java/javase/downloads/index.html
and save to /opt
cd /opt
wget http://apache.mirror.vu.lt/apache/tomcat/tomcat-8/v8.0.0-RC3/bin/embed/apache-tomcat-8.0.0-RC3-embed.tar.gz
tar -xvf apache-tomcat-8.0.0-RC3-src.tar.gz
ln -s apache-tomcat-8.0.0-RC3-src tomcat
mkdir /opt/tomcat/logs
groupadd tomcat
useradd -g tomcat -d /opt/tomcat tomcat
usermod -G www-data tomcat
chown tomcat:tomcat tomcat/ -R

vi /etc/init.d/tomcat
#!/bin/sh
CATALINA_HOME=/opt/tomcat
export CATALINA_HOME
JAVA_HOME=/opt/jdk1.6.0_25
export JAVA_HOME
TOMCAT_OWNER=tomcat
export TOMCAT_OWNER
JAVA_OPTS=”-Djava.awt.headless=true -Dfile.encoding=UTF-8
-server -Xms768m -Xmx768m
-XX:NewSize=256m -XX:MaxNewSize=256m -XX:PermSize=256m
-XX:MaxPermSize=256m -XX:+DisableExplicitGC”
export JAVA_OPTS

start() {
echo -n “Starting Tomcat: ”
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/startup.sh
}
stop() {
echo -n “Stopping Tomcat: ”
su $TOMCAT_OWNER -c $CATALINA_HOME/bin/shutdown.sh
}

case “$1″ in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo $”Usage: tomcat {start|stop|restart}”
exit
esac

update-rc.d – debian

Insert links using the defaults:
update-rc.d foobar defaults
Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .
Insert links for a service that should be running during multi-user
mode, but that does not need to be explicitly stopped on shutdown:
update-rc.d foobar multiuser
Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 1 .
More typical command using explicit argument sets:
update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 .
Remove all links for a script (assuming foobar has been deleted
already):
update-rc.d foobar remove
Example of disabling a service:
update-rc.d -f foobar remove
update-rc.d foobar stop 20 2 3 4 5 .
Example of a command for installing a system initialization-and-
shutdown script:
update-rc.d foobar start 45 S . start 31 0 6 .
Example of a command for disabling a system initialization-and-shutdown
script:
update-rc.d -f foobar remove
update-rc.d foobar stop 45 S .

amavis

Amavis is an open source content filter for electronic mail, implementing mail message transfer, decoding, some processing and checking, and interfacing with external content filters to provide protection against spam, viruses and other malware. It can be considered an interface between a mailer (MTA, Mail Transfer Agent) and one or more content filters.

simple ispconfig install debian

mkdir /opt/phpfcgi-5.4.12
mkdir /usr/local/src/php5-build
cd /usr/local/src/php5-build
wget http://de.php.net/get/php-5.4.12.tar.bz2/from/this/mirror -O php-5.4.12.tar.bz2
tar jxf php-5.4.12.tar.bz2

apt-get install build-essential
apt-get build-dep php5
apt-get install libfcgi-dev libfcgi0ldbl libjpeg62-dbg libmcrypt-dev libssl-dev libc-client2007e libc-client2007e-dev
ln -s /usr/lib/libc-client.a /usr/lib/x86_64-linux-gnu/libc-client.a

./configure \
–prefix=/opt/phpfcgi-5.4.12 \
–with-pdo-pgsql \
–with-zlib-dir \
–with-freetype-dir \
–enable-mbstring \
–with-libxml-dir=/usr \
–enable-soap \
–enable-calendar \
–with-curl \
–with-mcrypt \
–with-zlib \
–with-gd \
–with-pgsql \
–disable-rpath \
–enable-inline-optimization \
–with-bz2 \
–with-zlib \
–enable-sockets \
–enable-sysvsem \
–enable-sysvshm \
–enable-pcntl \
–enable-mbregex \
–with-mhash \
–enable-zip \
–with-pcre-regex \
–with-mysql \
–with-pdo-mysql \
–with-mysqli \
–with-jpeg-dir=/usr \
–with-png-dir=/usr \
–enable-gd-native-ttf \
–with-openssl \
–with-fpm-user=www-data \
–with-fpm-group=www-data \
–with-libdir=/lib/x86_64-linux-gnu \
–enable-ftp \
–with-imap \
–with-imap-ssl \
–with-kerberos \
–with-gettext \
–enable-cgi

make
make install

php.ini: cp -v /usr/local/src/php5-build/php-5.4.12/php.ini-production /opt/phpfcgi-5.4.12/lib/php.ini

cd /tmp
wget http://www.ispconfig.org/downloads/ISPConfig-3-stable.tar.gz
tar xvfz ISPConfig-3-stable.tar.gz
cd ispconfig3_install/install

/opt/php-5.3.22/bin/php -q install.php

apt-spy – debian

Apt-spy is a program used to test a series of Debian’s mirrors for bandwidth. Apt-spy will then generate a /etc/apt/sources.list file with the fasted server. You can select which of the Debian server’s to benchmark by geographical location.

apt-spy -d stable -s lt