index.html から b1.cgiを起動しようとするとブラウザにINTERNAL SERVER ERROR と表示されます。
index.htmlは以下のコードです。
html
1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2 <html> 3 <head> 4 <title>Eurasia</title> 5 <meta http-equiv="content-type" content="text/html; charset=Shift_JIS"> 6 </head> 7 8 <body bgcolor="#000066" text="#000000" link="#0000ee" alink="#0000ee" vlink="#551a8b"> 9 <font color="#ff0000"><big><big><big>現在ウェブ店舗作成中<br>ご利用までにはしばらく<br>お待ちください。<br> 10 <br> 11 ユーラシア(TRM出版)</big></big></big></font><font color="#ff0000"><big><big><big><br> 12 </big></big></big></font><font color="#ffffff">年会費×,×××円で本(実物商品)がネットで販売できる!販売手数料は××%、××%割引販売、他CD・DVD・ソフトウェア・ビデオゲームも販売できます!電子ファイルは年会費○円で○○○○手数料だけいただきます。<br><br> 13 </font><a href="http:/trm7.mydns.jp/cgi-bin/b1.cgi"><img src="http://trm7.mydns.jp/buhin/btn056_09_4.gif" 14 alt="http://trm7.mydns.jp/cgi-bin/b1.cgi" width="180" height="30"> 15 <br> 16 </a><a href="http://trm7.mydns.jp/cgi-bin/b2.cgi"><img src="http://trm7.mydns.jp/buhin/btn056_09_5.gif" 17 alt="http://trm7.mydns.jp/cgi-bin/b2.cgi" width="180" height="30"> 18 <br> 19 </a><a href="http://trm7.mydns.jp/cgi-bin/60a11.cgi"><img src="http://trm7.mydns.jp/buhin/btn056_09_6.gif" 20 alt="http://trm7.mydns.jp/cgi-bin/60a11.cgi" width="180" height="30"> 21 <br> 22 </a><a href="http://trm7.mydns.jp/cgi-bin/c1.cgi"><img src="http://trm7.mydns.jp/buhin/btn056_09_7.gif" 23 alt="http://trm7.mydns.jp/cgi-bin/c1.cgi" width="180" height="30"> 24 <br> 25 </a> 26</body> 27</html>
b1.cgiは以下のコードです。
perl
1#!/usr/bin/perl 2use strict; 3use utf8; 4binmode(STDOUT,":utf8"); 5 6print "Content-type: text/html\n\n"; 7print <<"HTML"; 8<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 9<html> 10<head> 11 <title>ユーザーアカウント登録(お客様)</title> 12</head> 13<body> 14 15<form action="b2.cgi"> 16<table> 17 <tr> 18 <td>希望ユーザーID:</td> 19 <td><input type="text" name="kokyakuID" size="40" maxlength="30"></td> 20 </tr> 21 <tr> 22 <td>希望パスワード:</td> 23 <td><input type="password" name="kokyakupass" size="40" maxlength="30"></td> 24 </tr> 25 <tr> 26 <td>パスワード確認:</td> 27 <td><input type="password" name="kokyakupass2" size="40" maxlength="30"></td> 28 </tr> 29 <tr> 30 <td>氏名:</td> 31 <td><input type="text" name="kokyakushimei" size="40" maxlength="30"></td> 32 </tr> 33 <tr> 34 <td>〒:</td> 35 <td><input type="text" name="kokyakuyuubinbangou" size="40" maxlength="30"></td> 36 </tr> 37 <tr> 38 <td>住所:</td> 39 <td><input type="text" name="kokyakujuusyo" size="40" maxlength="30"></td> 40 </tr> 41 <tr> 42 <td>メールアドレス:</td> 43 <td><input type=""text"" name="kokyakumail" size="40" maxlength="30"></td> 44 </tr> 45<tr> 46<td><textarea name="kokyakumojijouhou" rows="4" cols="40" readonly></textarea><br></td> 47</tr> 48<tr> 49<th> 50<input type="submit" onclick="location.href'b2.cgi'" value="送信"> 51<input type="reset" value="リセット"></th><td></td> 52</tr> 53 54 55</table> 56</tbody> 57</form> 58<br> 59<br> 60</body> 61</html> 62HTML 63exit; 64 65 66 67 68 69 70# <tr> 71# <td>このサイトについてご意見を書いて下さい</td> 72# <td><textarea name="mess" cols="40" rows="5"></textarea></td> 73# </tr> 74#</table> 75#</form> 76#</body> 77#</html> 78#HTML 79# 80#exit;
CentOS7のエラーログは以下の通りです。
error_log
1[Wed Sep 26 07:53:45.819439 2018] [cgi:error] [pid 2596] [client 2400:4050:a1:6200:d253:49ff:fe36:e025:35307] AH01215: (2)No such file or directory: exec of '/var/www/cgi-bin/b1.cgi' failed, referer: http://trm7.mydns.jp/ 2[Wed Sep 26 07:53:45.831447 2018] [cgi:error] [pid 2596] [client 2400:4050:a1:6200:d253:49ff:fe36:e025:35307] End of script output before headers: b1.cgi, referer: http://trm7.mydns.jp/
どこが間違っているのかご指摘よろしくお願い致します。
httpd.confの内容は以下の通りです。
httpd.conf
1ServerRoot "/etc/httpd" 2Listen 80 3Include conf.modules.d/*.conf 4User apache 5Group apache 6ServerAdmin root@trm7.mydns.jp 7 8ServerName trm7.mydns.jp:80 9<Directory /> 10 AllowOverride all 11 Require all granted 12</Directory> 13DocumentRoot "/var/www/html" 14<Directory "/var/www"> 15 AllowOverride all 16 # Allow open access: 17 Require all granted 18</Directory> 19<Directory "/var/www/html"> 20 Options FollowSymLinks 21 AllowOverride all 22 Require all granted 23</Directory> 24<IfModule dir_module> 25 DirectoryIndex index.html 26</IfModule> 27<Files ".ht*"> 28 Require all denied 29</Files> 30<VirtualHost> 31<VirtualHost> 32ErrorLog "logs/error_log" 33LogLevel warn 34<IfModule log_config_module> 35 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined 36 LogFormat "%h %l %u %t \"%r\" %>s %b" common 37 38 <IfModule logio_module> 39 # You need to enable mod_logio.c to use %I and %O 40 LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio 41 </IfModule> 42 43<VirtualHost> 44 CustomLog "logs/access_log" combined 45</IfModule> 46 47<IfModule alias_module> 48 ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" 49</IfModule> 50<Directory "/var/www/cgi-bin"> 51 AllowOverride all 52 Options ExecCGI 53 Require all granted 54</Directory> 55<IfModule mime_module> 56 TypesConfig /etc/mime.types 57 AddType application/x-compress .Z 58 AddType application/x-gzip .gz .tgz 59 AddType text/html .shtml 60 AddOutputFilter INCLUDES .shtml 61</IfModule> 62AddDefaultCharset UTF-8 63<IfModule mime_magic_module> 64 MIMEMagicFile conf/magic 65</IfModule> 66EnableSendfile on 67IncludeOptional conf.d/*.conf

回答4件
あなたの回答
tips
プレビュー