Feb 01, 2006

Apacheの設定

Apacheの設定は、「/etc/apache/httpd.conf」を書き換えることで行う。
○サーバの名前は「/etc/hosts」の名前と同じにする。たとえば「i.love.belle.cxm」。
○perl cgiを使うので、 #AddHandler cgi-script .cgi .pl
のシャープを外す。
○Directory /home/*/public_htmlの次の1行に、「Options」を追加する。
AllowOverride FileInfo AuthConfig Limit Options
となる。
このディレクティブの後に、
ScriptAlias /~*/cgi-bin/ "/home/*/public_html/cgi-bin/"
を追加。また、
<Directory /home/*/public_html/cgi-bin>
Options ExecCGI
Order allow,deny
Allow from all
</Directory>
を追加する。
○たいていのCGIスクリプトの実行を、「/usr/local/bin/perl」と書いているので、シンボリックリンクを作成する(rootで)
#ln -s /usr/bin/perl /usr/local/bin/perl
○「DefaultCharset」をoffにする。
○「AddLanguage」のところの、
AddCharset ISO-2022-JP .jis
の後に、
AddCharset EUC-JP .euc
AddCharset SHIFT_JIS .sjis
を追加する。
この2つをやらないと文字化けする。

SSHでHostbasedAuthenticationの再設定

rsyncのためのSSHでHostbasedAuthenticationの再設定で、2〜3日ハマった。
Vine3.0で設定してあった「sshd_config」とクライアントマシンである、Debian GNU/Linux sargeの「ssh_config」は共にプリントしてあったので、そのとおりにしたのに、HostbasedAuthenticationでパスワードなしの接続ができない。
バックアップのための肝心要のものなので、早めに解決しなければならない。
結論からいえば、rysnc設定のメモで書いた「.shosts」(ユーザのホームディレクトリに置く。アクセスモード644)の記述に、ホスト、サーバともに次のようにIPアドレスだけでなく名前も追加したら解決した。これを発見するまでにじたばたしたわけである。この記述法は、インターネットでは情報が載っていなくてぼくが試みたらうまくいったという事柄である。
192.168.0.5 shimirin
i.love.belle.cxm shimirin
前には上の1行だけ書けばうまくHostbasedAuthenticationができていたのに不思議である。なお、Debian GNU/Linux sargeの現在の状態だと、sshdの再起動のコマンドは「/etc/init.d/ssh restart」で「sshd restart」ではない。また「rsync」はデスクトップをインストールしたときに自動でインストールされないので「apt-get install rsync」としてインストールする必要がある。
SSHの再設定で、設定ファイルを見直した。要の部分を書いてみる。
「/etc/ssh/ssh_config」(クライアント側、双方向なら両方)。
HostbasedAuthentication yes
EnableSSHKeysign yes
PreferredAuthentications hostbased,publickey,password
IdentitiyFile ~/.ssh/id_rsa
真ん中の2行は書き加える。
「/etc/ssh/sshd_config」(要の部分だけ。ホスト側、双方向なら両方)。
PermitRootLogin no
StrictModes yes
RSAAuthentication no
PubkeyAuthentication yes(noでもいいが、設定を実験しているときは下のPasswordAuthenticationとともにyes)
RhostsRSAAuthentication no
HostbasedAuthentication yes
IgnoreRhosts no
IgnoreUserKnownHosts no
PasswordAuthentication yes(でもnoでもいいが、noが推奨かも。なぜなら、クライアント側の認証の試みの順序が最初にhostbaseになっていればうまくいけば関係ないから。hostbaseが失敗した場合、外部公開している場合はセキュリティ上、noのがいい)
PermitEmptyPasswords no
ChallengeResponseAuthentication no
UsePam no
全体的にいえば、上の設定でRSA1のバージョンでなく、RSA2を使い、認証にHostbasedAuthentication(RSA2のみ)を使うことを設定している。

April 2024
Sun Mon Tue Wed Thu Fri Sat
 
       

Search

Categories
Archives
Syndicate this site (XML)

Powered by
blosxomサイトの日本語訳
blosxom 2.0
and
modified by
blosxom starter kit

新規投稿

画像投稿BBS
灰皿町アルバム・掲示板
ぺこの植物写真・掲示板
人形の足跡
Photo-Room