NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
[resolved] You don't have permission to access /cgi-bin/...


Joined: 04 Jun 2004
Posts: 4
Location: Mumbai
Reply with quote
Hello,

I have just installed the nusphere in my local machine. I have cgi script which i wanted to execute in my local machine. I have kept wooden dir in nscgi-bin foler. When I am trying to exeute the wooden dir files..

i get You don't have permission to access /cgi-bin/wooden on this server.

How do i solve this problem. since i am executing files on local machine how do i set permission locally.



1) In the release not i found the following content about Nusphere
2) i have installed nusphere in my local computer and using the same for development.
3) my cgi code is in source form.. here is example

use CGI::Carp qw(fatalsToBrowser);

$test = $ENV{'HTTP_USER_AGENT'};
$test =~ s/\"//g;
$test =~ s/\)//g;
$test =~ s/\(//g;
$test =~ s/\;//g;
$test =~ s/\'//g;
$test =~ s/\///g;
$test =~ s/ //g;
$test =~ s/\.//g;



It's not showing even .html page in dir, if i tried instead of .p or .cgi





CD Contents
===========

The NuSphere Technology Platform installation CD contains the following
components:

- Apache 1.3.29 with mod_perl and mod_ssl
- PHP 4.3.4
- Perl 5.8.0
- CVS 1.11.6
- Sendmail (NusphereMail)
- Administration Web Site
- phpPgAdmin 3.1 UltraSQL/PostgreSQL Data Dictionary
- phpMyAdmin 2.5.4 MySQL Data Dictionary
- Sample Applications
- Professional Applications install files
- Portal and Search Engine install files
- WEBMIN 0.93 (UNIX only)





Please help. Please.

Best Regards.

Laxman Kande
----------------

laxman@aims-tech.com
View user's profileFind all posts by laxmanSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Quote:
It's not showing even .html page in dir, if i tried instead of .p or .cgi

cgi-bin is a special directory and will never show any htmls.
This directory is for keeping and running cgi scripts only. No source content can be shown.

Do replace #!/usr/bin/perl with #!perl
if doesn't help, make sure you can run

perl yourscriptname

and get adequate results.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
below is a sample script hellocgi.pl that should work:

Code:
#!perl


print "Content-type: text/html\n\n";
print "<html><body>\n";
$time = localtime();
print "<h2>cgi-bin test script</h2><br><br>\n";
print "<hr>local time is $time<br><br><hr>\n";

print "<b>Environment variables</b><br>\n";
foreach my $key (sort keys %ENV) {
   print "\"$key\" = \"$ENV{$key}\"<BR>\n";
}
print "</body></html>\n";

read(STDIN, $input, $ENV{'CONTENT_LENGTH'}) if ($ENV{'CONTENT_LENGTH'});


Code below (cgisamp.pl) shows how to use CGI module:

Code:
#!perl -w

use strict;
use CGI;


my $q = new CGI;
print $q->header;
print $q->start_html("Title");
print "This is the output from cgisamp.pl";
print $q->end_html;
View user's profileFind all posts by dmitriSend private messageVisit poster's website
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
regarding access rights, take a look at cgi-bin configuration settings to see
if they are somewhat like this:

Code:

    ScriptAlias /cgi-bin/ "C:/Program Files/NuSphere/TechPlat/apache/cgi-bin/"
    <Directory "C:/Program Files/NuSphere/TechPlat/apache/cgi-bin">
        AllowOverride None
        Options None
        Order allow,deny
        Allow from all
    </Directory>
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 4
Location: Mumbai
Reply with quote
yes. This the same thing i have in httpd.conf
View user's profileFind all posts by laxmanSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
what happens if you run your script from a console (command prompt) ?
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 4
Location: Mumbai
Reply with quote
it prints content of the file
View user's profileFind all posts by laxmanSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
run perl yourscriptfilename
and let me know what it showed in the console
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 04 Jun 2004
Posts: 4
Location: Mumbai
Reply with quote
I done c:\myperlfiles>perl hello.pl

it shows content of the file
<html>
etc
View user's profileFind all posts by laxmanSend private messageMSN Messenger
Site Admin

Joined: 13 Jul 2003
Posts: 8344
Reply with quote
Well...
actually it is the result of running perl script, not the content. Content as you stated before starts with #!perl.

what happens if you put hello.pl into cgi-bin directory and run it using apache ? like below
http://localhost/cgi-bin/hello.pl
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 11 Sep 2005
Posts: 45
Reply with quote
Latest version works, thanks.
View user's profileFind all posts by bendjSend private message
[resolved] You don't have permission to access /cgi-bin/...
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic