#!/usr/bin/perl # *********************************************************************** # # * ErrorDocument 401 は http_error.pl?401 と渡します. * # # * ErrorDocument 403 は http_error.pl?403 と渡します. * # # * ErrorDocument 404 は http_error.pl?404 と渡します. * # # *********************************************************************** # #変数一覧 # # $remote_host リモートホスト # $IP_adr IPアドレス # $now サーバーの日本時間 # $errno サーバーエラーが出たときのエラーナンバー # $url リダイレクトURL # $ERRMESG1{$errno} エラーナンバーに対応させた英文メインタイトル # $ERRDESC1{$errno} エラーナンバーに対応させた英文サブタイトル # $ERRDESC2{$errno} エラーナンバーに対応させた日本文サブタイトル # #リモートホストの所得 $remote_host=$ENV{'REMOTE_HOST'}; ($part1,$part2,$part3,$part4)=split(/\./,$ENV{REMOTE_ADDR}); #IPアドレスの所得 $IP_adr=pack("C4",$part1,$part2,$part3,$part4); ($host_name)=(gethostbyaddr("$IP_adr", 2)); #サーバー日本時間の所得 sub set_now { $time = time(); ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time+0*60*60); if ($sec < 10) { $sec = "0$sec"; } if ($min < 10) { $min = "0$min"; } if ($hour < 10) { $hour = "0$hour"; } $month = ($mon + 1); $y0="日"; $y1="月"; $y2="火"; $y3="水"; $y4="木"; $y5="金"; $y6="土"; $youbi = ($y0,$y1,$y2,$y3,$y4,$y5,$y6) [$wday]; $now = "$month月$mday日($youbi)$hour:$min"; } &set_now; # *********************************************************************** # # * エラーメッセージ * # # * サーバーエラーの取り扱いなので英文でも書きます. * # # *********************************************************************** # # これより下は個人で設定すること.hogehuga.infoとかwebmaster@hogehuga.infoとか #エラーナンバーの所得 $errno = ($ENV{'REDIRECT_STATUS'} eq '') ? "404" : $ENV{'REDIRECT_STATUS'}; #リダイレクトURLの所得 $url = $ENV{'REDIRECT_URL'}; &set_now; $ERRMESG1{'401'} = "Unauthorized"; $ERRDESC1{'401'} = "User authentication failed."; $ERRMESG1{'403'} = "Forbidden"; $ERRDESC1{'403'} = "Sorry pal, you are not permitted to perform this request."; $ERRMESG1{'404'} = "File Not Found"; $ERRDESC1{'404'} = "The requested URL http://hogehuga.info${url} was not found on this server."; $ERRMESG1{'500'} = "Internal Server Error."; $ERRMESC1{'500'} = "We have some problem on this server."; $ERRDESC2{'401'} = "あなたのログインは許可されませんでした."; $ERRDESC2{'403'} = "あなたはこのファイル,もしくはディレクトリに許可がありません."; $ERRDESC2{'404'} = "要求された http://hogefuga.info${url} というURLはこのサーバに存在しません."; $ERRMESC2{'500'} = "サーバ内部エラーでエラーが発生しています."; print "Content-type: text/html\n\n"; print < $errno $ERRMESG1{$errno}

$errno $ERRMESG1{$errno}

$ERRDESC1{$errno}
$ERRDESC2{$errno}

To Main Page
メインページへ

Your IP Address is $remote_host .
あなたのIPアドレスは $remote_host です.
Your Host name is $host_name .
あなたのリモートホストは $host_name です.

Administrator:Nanashi-no Gonbe
管理者:Nanashi-no Gonbe

endOfPage