お知らせ

  • 利用規約を守って投稿してください。また、よくある質問および投稿の手引きも参照してください。
  • メッセージの投稿にはアカウントが必要です。未登録の方は、ユーザ登録ページからアカウントを作成することができます。

#1 2014-12-07 10:48:21

hotohoto
メンバ
登録日: 2009-07-04

14.04でapacheにCGIが動かない

hotohoto です。
32bit UBUNTU 14.04 32bit LXDE 環境で
apache2 を入れました。
CGIを設定しようとして
http://www.server-world.info/query?os=Ubuntu_14.04&p=httpd&f=2
を見て改築しました。
インストールは無事に行きました。
しかし 403Forbiddenが収まりません。
足りない何かがあるのでしょうか?


/etc/apache2/mods-enabled/dir.conf

コード:

<IfModule mod_dir.c>
DirectoryIndex index.html index.htm index.cgi
</IfModule>

/etc/apache2/mods-enabled/mime.conf

コード:

AddHandler cgi-script .pl .cgi

/etc/apache2/sites-enabled/000-default.conf

コード:

#13行目辺り
DocumentRoot /var/www/html
</Directory>
<Directory "/var/www/html">
 AllowOverride All
 Options +ExecCGI
 Require all granted
</Directory>

コード:

a2enmod cgi したら

Module cgi already enabled

コード:

・・・・・: /var/www/html$ sudo /etc/init.d/apache2 restart 
 * Restarting web server apache2                                         [ OK ]

コード:

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

index.cgi (END)

その後 
chmod 705 index.cgi
して
firefox index.cgi
すると
firefox の画面上にTEXT文が表示されます
こんな感じ↓

コード:

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html>\n<body>\n";
print "<div style=\"width: 100%; font-size: 40px; font-weight: bold; text-align: center;\">\n";
print "CGI Test Page";
print "\n</div>\n";
print "</body>\n</html>\n";

オフライン

 

#2 2014-12-07 10:54:29

hotohoto
メンバ
登録日: 2009-07-04

Re: 14.04でapacheにCGIが動かない

色々ほかも探しています。こういうのもありました。
http://qiita.com/Morikuma_Works/items/30abe1a68a3a4e8881ab

コード:

/var/www/html$ apache2 -v
Server version: Apache/2.4.7 (Ubuntu)
Server built:   Jul 22 2014 14:36:39

オフライン

 

Board footer

Powered by FluxBB