CentOS7でPerlを実行しようとしても実行できません。CGIは/var/www/cgi-bin/ で実行可能であるということでそこに置きましたが、実行すると、
「Not Found The requested URL /var/www/cgi-bin/60a11.cgi was not found on this server.」とエラー表示されます。/var/www/cgi-bin/60a11.cgiが存在するにも関わらずです。Apacheも起動し chmod 700 /var/www/cgi-bin/60a11.cgi も実行しました。
実行方法は、まずはFireFoxで /var/www/html/index.htmlを「http://127.0.0.1/」とURLを指定して開きindex.html内にあるボタンを押し“http://127.0.0.1/var/www/cgi-bin/60a11.cgi”を開こうとすると「60a11.cgi」は表示されずにエラーメッセージが出る、というところです。ドキュメントルートは /var/www/html です。
ご回答がありました、ありがとうございました。しかし、cgi-bin を html配下に置いても問題は解決されませんでした。
httpd.confの設定は以下の通りです。
httpd.conf
1<Directory "/var/www/cgi-bin"> 2Options FollowSymLinks 3Options +ExecCGI 4AddHandler cgi-script .cgi 5 AllowOverride None 6# Options None 7 Require all granted 8</Directory> 9 10#<Directory "/var/www/html/cgi-bin"> 11#Options FollowSymLinks 12#Options +ExecCGI 13#AddHandler cgi-script .cgi 14# AllowOverride None 15# Options None 16# Require all granted 17#</Directory>
そこで気がかりなのが「Not Found The requested URL /var/www/cgi-bin/60a11.cgi was not found on this server.」というエラーメッセージが出るところです。じっさいには60a11.cgiは存在するのにこの表示が出ます。
perlの次に実行しようとしている「60a11.cgi」のコードです。
perl
1#!/usr/bin/perl 2use strict; 3use utf8; 4 5print "Content-type: text/html\n\n"; 6print <<"HTML"; 7<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 8<html> 9<head> 10<title>ユーザーアカウント登録</title> 11</head> 12<body bgcolor="#000066" text="#000000" link="#0000ee" alink="#0000ee" 13vlink="#551a8b"> 14<form method="post" form action="67b32.cgi" ENCTYPE="multipart/form-data"> 15<form> 16<table border="0"> 17<tbody> 18<table> 19<tr> 20<td><font color="#ff0000"><label for="ID">希望ユーザーID</label></font></td> 21<td><input type="text" name="ID" size="40" maxlength="30"><br></td> 22</tr><tr> 23<td><font color="#ff0000"><label for="pass">希望パスワード</label></font></td> 24<td><input type="password" name="pass" size="40" maxlength="30"><br></td> 25</tr><tr> 26<td><font color="#ff0000"><label for="pass2">パスワード確認</label></font></td> 27<td><input type="password" name="pass2" size="40" maxlength="30"><br></td> 28</tr><tr> 29<td><font color="#ff0000"><label for="shimei">氏名</label></font></td> 30<td><input type="text" name="shimei" size="40" maxlength="30"><br></td> 31</tr><tr> 32<td><font color="#ff0000"><label for="kaisyamei">会社名</label></font></td> 33<td><input type="text" name="kaisyamei" size="40" maxlength="30"><br></td> 34</tr><tr> 35<td><font color="#ff0000"><label for="mail">メールアドレス</label></font></td> 36<td><input type=""text"" name="mail" size="40" maxlength="30"><br></td> 37</tr><tr> 38<td><font color="#ff0000"><label for="syouhinmei">商品名</label></font></td> 39<td><input type="text" name="syouhinmei" size="40" maxlength="30"><br></td> 40</tr><tr> 41<td><font color="#ff0000"><label for="nedan">商品値段</label></font></td> 42<td><input type="text" name="nedan" size="40" maxlength="30"><br></td> 43</tr><tr> 44<td><font color="#ff0000"><label for="q1">商品カテゴリー</label></font></td> 45<td><input type="radio" name="q1" value="【書籍(実物商品)】"><font color="#ff0000">書籍</font> 46<input type="radio" name="q1" value="【CD(実物商品)】"><font color="#ff0000">CD</font> 47<input type="radio" name="q1" value="【DVD(実物商品)】"><font color="#ff0000">DVD</font> 48<input type="radio" name="q1" value="【ソフトウェア(実物商品)】"><font color="#ff0000"> 49ソフトウェア(実物)</font> 50<input type="radio" name="q1" value="【ビデオゲーム(実物商品)】"><font color="#ff0000">ビデオゲーム(実物)</font> 51<input type="radio" name="q1" value="【電子書籍(電子ファイル)】"><font color="#ff0000">電子書籍</font> 52<input type="radio" name="q1" value="【ソフトウェア(電子ファイル)】"><font color="#ff0000">ソフトウェア(電子ファイル)</font> 53<input type="radio" name="q1" value="【音楽(電子ファイル)】"><font color="#ff0000">音楽(電子ファイル)</font> 54<input type="radio" name="q1" value="【ビデオゲーム(電子ファイル)】"><font color="#ff0000">ビデオゲーム(電子ファイル)</font> 55<input type="radio" name="q1" value="【動画(電子ファイル)】"><font color="#ff0000">動画(電子ファイル)</font><br></td> 56</tr><tr> 57<td><font color="#ff0000">ファイル1:画像ファイル(jpg/gif/png/bmpファイル)<br>ファイル2:中身立ち読みファイル(pdfファイル)(無い人はアップロードする必要はありません)<br>ファイル3:売り物となるコンテンツ(実物商品を扱う場合はアップロードする必要はありません)をアップロードしてください</font><br></td> 58</tr><tr> 59<td><font color="#ff0000">ファイル1を選択:</font></td> 60<td><font color="#ff0000"><input type="file" name="file1"></font><br></td> 61</tr><tr> 62<td><font color="#ff0000">ファイル2を選択:</font></td> 63<td><font color="#ff0000"><input type="file" name="file2"></font><br></td> 64</tr><tr> 65<td><font color="#ff0000">ファイル3を選択:</font></td> 66<td><font color="#ff0000"><input type="file" name="file3"></font><br></td> 67</tr><tr> 68<td><textarea name="mojijouhou" rows="4" cols="40">商品情報をご記入ください。</textarea><br></td> 69</tr><tr> 70<td><input type="submit" onclick="location.href'67b32.cgi'" value="送信"> 71<input type="reset" value="リセット"></td> 72</tr> 73</table> 74</tbody> 75</form> 76<br> 77<br> 78</body> 79</html> 80HTML 81exit;
実行したときのerror_logです。
error_log
1 2[Tue Jul 03 02:52:49.352453 2018] [core:error] [pid 4850] (13)Permission denied: [client 127.0.0.1:60556] AH00035: access to /buhin/btn056_09_6.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 3[Tue Jul 03 02:52:49.394916 2018] [core:error] [pid 4846] (13)Permission denied: [client 127.0.0.1:60555] AH00035: access to /buhin/btn056_09_5.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 4[Tue Jul 03 02:52:49.384311 2018] [core:error] [pid 4880] (13)Permission denied: [client 127.0.0.1:60554] AH00035: access to /buhin/btn056_09_4.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 5[Tue Jul 03 02:52:49.407106 2018] [core:error] [pid 4852] (13)Permission denied: [client 127.0.0.1:60557] AH00035: access to /buhin/btn056_09_7.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 6[Tue Jul 03 02:52:55.165134 2018] [mime_magic:error] [pid 4882] [client 127.0.0.1:60558] AH01512: mod_mime_magic: can't read `/var/www/cgi-bin/60a11.cgi', referer: http://127.0.0.1/ 7[Tue Jul 03 02:52:55.301730 2018] [cgi:error] [pid 4882] [client 127.0.0.1:60558] AH01215: (13)Permission denied: exec of '/var/www/cgi-bin/60a11.cgi' failed, referer: http://127.0.0.1/ 8[Tue Jul 03 02:52:55.316256 2018] [cgi:error] [pid 4882] [client 127.0.0.1:60558] End of script output before headers: 60a11.cgi, referer: http://127.0.0.1/ 9[Tue Jul 03 02:56:58.496028 2018] [core:error] [pid 4881] (13)Permission denied: [client 127.0.0.1:60571] AH00035: access to /buhin/btn056_09_6.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 10[Tue Jul 03 02:56:58.539093 2018] [core:error] [pid 4848] (13)Permission denied: [client 127.0.0.1:60570] AH00035: access to /buhin/btn056_09_5.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 11[Tue Jul 03 02:56:58.553854 2018] [core:error] [pid 4885] (13)Permission denied: [client 127.0.0.1:60569] AH00035: access to /buhin/btn056_09_4.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 12[Tue Jul 03 02:56:58.892290 2018] [core:error] [pid 4883] (13)Permission denied: [client 127.0.0.1:60572] AH00035: access to /buhin/btn056_09_7.gif denied (filesystem path '/var/www/html/buhin') because search permissions are missing on a component of the path, referer: http://127.0.0.1/ 13[Tue Jul 03 02:57:06.890120 2018] [mime_magic:error] [pid 4884] [client 127.0.0.1:60573] AH01512: mod_mime_magic: can't read `/var/www/cgi-bin/60a11.cgi', referer: http://127.0.0.1/ 14[Tue Jul 03 02:57:06.914866 2018] [cgi:error] [pid 4884] [client 127.0.0.1:60573] AH01215: (13)Permission denied: exec of '/var/www/cgi-bin/60a11.cgi' failed, referer: http://127.0.0.1/ 15[Tue Jul 03 02:57:06.920432 2018] [cgi:error] [pid 4884] [client 127.0.0.1:60573] End of script output before headers: 60a11.cgi, referer: http://127.0.0.1/
解決策よろしくお願い致します。

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