[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

how to setup OBSD to run CGI



Hi,

I want to run CGI in the apache server, I tried from
OBSD 3.0 to now, I still can't let it run.

I installed BASE system without X system, and the http
server is configured to run, I can use web browser to
visit the HTML page from other machine.
then I try to access perl script. I make a script like
this:


#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "<html>\n";
print "<head>\n";
print "<title>test cgi program</title>\n";
print "</head>\n";
print "<body>\n";
print "<h1>Hello World</h1>\n";
print "</body>\n";
print "</html>\n";

I saved it as prn.pl, I set its attribute to 777,
owner is root:daemon

I modified /var/www/conf/httpd.conf

<Directory "/var/www/htdocs">
    Options Indexes FollowSymLinks ExecCGI
    AllowOverride None
    Order allow,deny      
    Allow from all    
</Directory>

<Directory "/var/www/cgi-bin">
    AllowOverride None   
    Options ExecCGI
    Order allow,deny
    Allow from all
</Directory>

AddHandler cgi-script .cgi .pl


I use httpd -l find out it supports CGI
web# httpd -l
Compiled-in modules:
  http_core.c
  mod_env.c
  mod_log_config.c
  mod_mime.c
  mod_negotiation.c
  mod_status.c
  mod_include.c
  mod_autoindex.c
  mod_dir.c
  mod_cgi.c
  mod_asis.c
  mod_imap.c
  mod_actions.c
  mod_userdir.c
  mod_alias.c
  mod_access.c
  mod_auth.c
  mod_so.c
  mod_setenvif.c
  mod_keynote.c
  mod_ssl.c
suexec: disabled; invalid wrapper /usr/sbin/suexec
web# 


I reboot the web server machine

I goto other machine type
http://192.168.1.2/cgi-bin/prn.pl in web browser
I got this message:
Internal Server Error
The server encountered an internal error or
misconfiguration and was unable to complete your
request.
Please contact the server administrator,
you@your.address and inform them of the time the error
occurred, and anything you might have done that may
have caused the error.

More information about this error may be available in
the server error log.



--------------------------------------------------------------------------------

Apache/1.3.27 Server at web.home.net Port 80

I checked logs/access_log
192.168.1.11 - - [21/Feb/2004:17:55:39 -0500] "GET
/cgi-bin/prn.pl HTTP/1.1" 500 605

I checked logs/error_log
[Sat Feb 21 17:55:39 2004] [error] (2)No such file or
directory: exec of /cgi-bin/prn.pl failed
[Sat Feb 21 17:55:39 2004] [error] [client
192.168.1.11] Premature end of script headers:
/cgi-bin/prn.pl


I really need help to setup it running, please give me
some help.

Thanks.

__________________________________
Do you Yahoo!?
Yahoo! Mail SpamGuard - Read only the mail you want.
http://antispam.yahoo.com/tools