サーバー設定 · 3 min read · Feb 12, 2026

完璧なセットアップ - SUSE 9.2 - ページ 6

Proftpd

Proftpdを使用したいと思います。これは、私がこのサーバーにインストールする予定のコントロールパネルソフトウェア(ISPConfig)がSUSE 9.2でProftpdを必要とするためです(他のディストリビューションでは異なります)。ProftpdのSUSEパッケージがないため、手動でコンパイルする必要があります:

cd /tmp/
wget –passive-ftp ftp://ftp.proftpd.org/distrib/source/proftpd-1.2.10.tar.gz

tar xvfz proftpd-1.2.10.tar.gz
cd proftpd-1.2.10/
./configure –sysconfdir=/etc
make
make install

cd ../
rm -fr proftpd-1.2.10*

次に、ファイル/etc/init.d/proftpdを作成します:

| #! /bin/sh # Copyright (c) 2000-2001 SuSE GmbH Nuernberg, Germany. # All rights reserved. # # Original author: Marius Tomaschewski <[email protected]> # # Slightly modified in 2003 for use with SuSE Linux 8.1, # by http://www.learnlinux.co.uk/ # # Slightly modified in 2005 for use with SuSE Linux 9.2, # by Falko Timme # # /etc/init.d/proftpd # ### BEGIN INIT INFO # Provides: proftpd # Required-Start: $network $remote_fs $syslog $named # Required-Stop: # Default-Start: 3 5 # Default-Stop: 0 1 2 6 # Description: Starts ProFTPD server ### END INIT INFO # Determine the base and follow a runlevel link name. base=${0##*/} link=${base#*[SK][0-9][0-9]} # Force execution if not called by a runlevel directory. test $link = $base && START_PROFTPD=yes # Modified by learnlinux.co.uk test "$START_PROFTPD" = yes || exit 0 # Modified by learnlinux.co.uk # Return values acc. to LSB for all commands but # status (see below): # # 0 - success # 1 - generic or unspecified error # 2 - invalid or excess argument(s) # 3 - unimplemented feature (e.g. "reload") # 4 - insufficient privilege # 5 - program is not installed # 6 - program is not configured # 7 - program is not running proftpd_cfg="/etc/proftpd.conf" proftpd_bin="/usr/local/sbin/proftpd" proftpd_pid="/usr/local/var/proftpd.pid" [ -r $proftpd_cfg ] || exit 6 [ -x $proftpd_bin ] || exit 5 # Source status functions . /etc/rc.status # First reset status of this service rc_reset case "$1" in start) echo -n "Starting ProFTPD Server: " test -f /etc/shutmsg && rm -f /etc/shutmsg /sbin/startproc $proftpd_bin rc_status -v ;; stop) echo -n "Shutting down ProFTPD Server: " test -x /usr/local/sbin/ftpshut && /usr/local/sbin/ftpshut now && sleep 1 /sbin/killproc -TERM $proftpd_bin test -f /etc/shutmsg && rm -f /etc/shutmsg rc_status -v ;; restart) ## If first returns OK call the second, if first or ## second command fails, set echo return value. $0 stop $0 start rc_status ;; try-restart) ## Stop the service and if this succeeds (i.e. the ## service was running before), start it again. ## Note: not (yet) part of LSB (as of 0.7.5) $0 status >/dev/null && $0 restart rc_status ;; reload|force-reload) ## Exclusive possibility: Some services must be stopped ## and started to force a new load of the configuration. echo -n "Reload ProFTPD Server: " /sbin/killproc -HUP $proftpd_bin rc_status -v ;; status) # Status has a slightly different for the status command: # 0 - service running # 1 - service dead, but /var/run/ pid file exists # 2 - service dead, but /var/lock/ lock file exists # 3 - service not running echo -n "Checking for ProFTPD Server: " checkproc $proftpd_bin rc_status -v ;; probe) ## Optional: Probe for the necessity of a reload, ## give out the argument which is required for a reload. [ $proftpd_cfg -nt $proftpd_pid ] && echo reload ;; *) echo "Usage: $0 {start|stop|status|restart|reload|try-restart|probe}" exit 1 ;; esac # Set an exit status. rc_exit |

chmod 755 /etc/init.d/proftpd
chkconfig –add proftpd

/etc/init.d/proftpd start

セキュリティ上の理由から、次の行を/etc/proftpd.confに追加することもできます:

| DefaultRoot ~ IdentLookups off ServerIdent on "FTP Server ready." |

ftpユーザーがCHMODできるようにするために、次の行をコメントアウトしてください:

| # Bar use of SITE CHMOD by default # # DenyAll # |

そしてProftpdを再起動します:

/etc/init.d/proftpd restart

Webalizer

webalizerをインストールするには、次のコマンドを実行します

apt-get install webalizer

システムクロックの同期

システムクロックをNTPサーバーと同期させたい場合は、次のようにします:

apt-get install netdate

netdate tcp time.nist.gov

/var/spool/cron/tabs/rootを作成します:

| # update time with ntp server 0 3,9,15,21 * * * /usr/sbin/netdate time.nist.gov |

その後、次のコマンドを実行します

chmod 600 /var/spool/cron/tabs/root
/etc/init.d/cron restart

SpamAssassinに必要なPerlモジュールのインストール(ISPConfigに付属)

Perlシェルを使用したインストール

rootとしてコマンドラインにログインし、次のコマンドを実行してPerlシェルを起動します:

perl -MCPAN -e shell

初めてPerlシェルを実行すると、いくつかの質問が表示されます。ほとんどの場合、デフォルトの回答で問題ありません。

注意:システムでファイアウォールを実行している場合、Perlシェルで作業している間はファイアウォールをオフにする必要があるかもしれません。そうしないと、必要なモジュールを遅延なく取得できません。その後、再度オンにできます。

Perlシェルの大きな利点は、ここで説明した他の2つの方法と比較して、新しいモジュールをインストールする際に依存関係を考慮することです。つまり、別のモジュールをインストールする際に前提条件のPerlモジュールが不足していることが判明した場合、Perlシェルはその前提条件モジュールをインストールするかどうかを尋ねます。その質問には「はい」と答えるべきです。

SpamAssassinに必要なモジュールをインストールするために、次のコマンドを実行します:

install HTML::Parser
install Net::DNS
(テストを有効にするように求められた場合は、いいえを選択)
install Digest::SHA1
install DB_File
q
(Perlシェルを終了するため)

モジュールがすでにシステムにインストールされている場合、次のようなメッセージが表示されます:

HTML::Parser is up to date.

モジュールのインストールが成功した場合、次のようになります:

/usr/bin/make install – OK

終わり
サーバーの設定は完了しました。必要に応じて、ISPConfigをインストールできます。

SuExecに関する注意

CGIスクリプトをsuExecで実行したい場合、ISPConfigによって作成されたウェブサイトのホームディレクトリとして/srv/www/htdocsを指定する必要があります。SUSEのsuExecは/srv/www/htdocsDoc_Rootとしてコンパイルされています。/usr/sbin/suexec2 -Vを実行すると、出力は次のようになります:

ISPConfigのインストール中にウェブサイトのホームディレクトリとして/srv/www/htdocsを選択するには、次のようにします:インストールモードを尋ねられたら、エキスパートモードを選択します。

インストール中に、デフォルトのディレクトリ/home/wwwがISPConfigがウェブサイトを作成するディレクトリであるべきかどうかを尋ねられます。nと答え、ウェブサイトのホームディレクトリとして/srv/www/htdocsを入力します。

リンク

Share: X/Twitter LinkedIn

新しい投稿を受信箱で受け取る

スパムはありません。いつでも購読を解除できます。