カテゴリー
SugiBlog Webデザイナー・プログラマーのためのお役立ちTips

Procmail レシピTips

Procmailにてレベルを定義し振り分けをおこなう方法と
ORによる条件判定の方法。

LEVEL=2

レベル2のとき適用

:0
* $LEVEL ?? 2
{
    # 逆引きできないホストを経由したメールの場合
    :0Hfw
    * ^Received: .*from.*unknown
    | formail -I "X-Spam-Flag: True"
}

続きを読む…»

2,664 views

CentOS6

http://kajuhome.com/centos6_inst.shtml

1,372 views

apache 起動スクリプト

#!/bin/sh
# httpd: /usr/local/apache2
. /etc/rc.d/init.d/functions

[ -f /usr/local/apache2/bin/apachectl ] || exit 0

case "$1" in
	start)

		# Start daemons.

		/usr/local/apache2/bin/apachectl start

		if [ $? = 0 ] ; then
			echo "httpd starting:" `echo_success`
		else
			echo "httpd starting:" `echo_failure`
		fi

		;;

	stop)

		# Stop daemons.

		/usr/local/apache2/bin/apachectl stop

		if [ $? = 0 ] ; then
			echo "stopping httpd:" `echo_success`
		else
			echo "stopping httpd:" `echo_failure`
		fi

		;;

	restart)

		$0 stop
		$0 start
		;;

	configtest)

		#httpd.conf test
		/usr/local/apache2/bin/apachectl configtest
		;;

	*)

		echo "Usage: `basename $0` {start|stop|restart}" >&2
		exit 64
		;;
esac

exit 0
2,744 views

qmailの起動スクリプト

#!/bin/sh
# qmail: /var/qmail
. /etc/rc.d/init.d/functions

[ -f /var/qmail/rc ] || exit 0

case "$1" in
	start)

		# Start daemons.

		echo "Starting qmail."
		csh -cf '/var/qmail/rc &'

		# Starting tcpserver with pop3d
		/usr/local/bin/tcpserver -R 0 110 /var/qmail/bin/qmail-popup \
		mail.example.jp \
		/home/vpopmail/bin/vchkpw /var/qmail/bin/qmail-pop3d Maildir 2&>1 \
		| /var/qmail/bin/splogger pop3d &

		if [ $? = 0 ] ; then
			echo "pop3d starting:" `echo_success`
		else
			echo "pop3d starting:" `echo_failure`
		fi

		# Starting tcpserver with smtpd
		/usr/local/bin/tcpserver -v -x /home/vpopmail/etc/tcp.smtp.cdb \
		-c 100 -u qmaild -g nofiles \
		0 smtp /var/qmail/bin/qmail-smtpd 2>&1 | /var/qmail/bin/splogger smtpd &

		/usr/local/bin/tcpserver -v -x /home/vpopmail/etc/tcp.smtp.cdb \
		-c 100 -u qmaild -g nofiles \
		0 587 /var/qmail/bin/qmail-smtpd 2>&1 | /var/qmail/bin/splogger smtpd &

		if [ $? = 0 ] ; then
			echo "smtpd starting:" `echo_success`
		else
			echo "smtpd starting:" `echo_failure`
		fi

		touch /var/lock/subsys/qmaild
		;;

	stop)

		# Stop daemons.
		echo "Shutting down qmail."

		killall -g qmail-send
		if [ $? = 0 ] ; then
			echo "stopping smtpd:" `echo_success`
		else
			echo "stopping smtpd:" `echo_failure`
		fi

		killall -g tcpserver

		if [ $? = 0 ] ; then
			echo "stopping pop3d:" `echo_success`
		else
			echo "stopping pop3d:" `echo_failure`
		fi

		rm -f /var/lock/subsys/qmaild
		;;

	restart)

		$0 stop
		$0 start
		;;

	*)

		echo "Usage: `basename $0` {start|stop|restart}" >&2
		exit 64
		;;
esac

exit 0
2,821 views

PHPインストール

PHPのインストール時に使用できるシェルスクリプトです。
Apache1.X系とApache2.x系の2種類作成したもののご紹介です。

#!/bin/sh

#=======================================
# php configure script
# php version 5
# for apache version 1
#=======================================

ARGV=$@

if [ -e $ARGV ] ; then

	echo "Please enter the option!"
	echo "[Options]:"
	echo "test - 設定されているコンフィグオプションを表示します。"
	echo "exec - php5をビルドします。"

elif [ "$ARGV" = "test" ] ; then

	echo "./configure \\"
	echo "--with-apxs=/usr/local/apache/bin/apxs \\"
	echo "--enable-mbstring \\"
	echo "--enable-mbstr-enc-trans \\"
	echo "--enable-mbregex \\"
	echo "--enable-trans-sid \\"
	echo "--with-mysql=/usr/bin \\"
	echo "--with-config-file-path=/usr/local/lib"

elif [ "$ARGV" = "exec" ] ; then

	./configure \
	--with-apxs=/usr/local/apache/bin/apxs \
	--enable-mbstring \
	--enable-mbstr-enc-trans \
	--enable-mbregex \
	--enable-trans-sid \
	--with-mysql=/usr/bin \
	--with-config-file-path=/usr/local/lib

	ERROR=$?
	if [ "$ERROR" = "0" ] ; then
		echo "ビルドが終了しました。"
	fi

else

	echo "error: unknown option!"
	echo "[Options]:"
	echo "test - 設定されているコンフィグオプションを表示します。"
	echo "exec - php5をビルドします。"

fi

続きを読む…»

2,490 views