Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian sarge 3.1\apache2 not surpport cgi

Programming languages, Coding, Executables, Package Creation, and Scripting.
Post Reply
Message
Author
rockymaxsource
Posts: 12
Joined: 2006-05-26 07:35

Debian sarge 3.1\apache2 not surpport cgi

#1 Post by rockymaxsource »

Hey,

I net installed debian sarge 3.1 with apache 2 on it.

below is the files in /etc/apache2/mods-enabled

###############
lrwxrwxrwx 1 root root 36 May 30 12:42 cgi.load -> /etc/apache2/mods-available/cgi.load
lrwxrwxrwx 1 root root 33 May 30 12:42 mod_python.load -> ../mods-available/mod_python.load
lrwxrwxrwx 1 root root 37 May 30 12:47 perl.conf -> /etc/apache2/mods-available/perl.conf
lrwxrwxrwx 1 root root 37 May 30 12:47 perl.load -> /etc/apache2/mods-available/perl.load
lrwxrwxrwx 1 root root 37 May 30 12:42 php4.conf -> /etc/apache2/mods-available/php4.conf
lrwxrwxrwx 1 root root 37 May 30 12:42 php4.load -> /etc/apache2/mods-available/php4.load
lrwxrwxrwx 1 root root 40 May 30 12:42 userdir.conf -> /etc/apache2/mods-available/userdir.conf
lrwxrwxrwx 1 root root 40 May 30 12:42 userdir.load -> /etc/apache2/mods-available/userdir.load
lrwxrwxrwx 1 root root 41 Jun 1 16:51 zembperl.conf -> /etc/apache2/mods-available/zembperl.conf
lrwxrwxrwx 1 root root 41 Jun 1 16:51 zembperl.load -> /etc/apache2/mods-available/zembperl.load
############

The result of which perl is "/usr/bin/perl"

I wrote the following cgi script for testing

###########
#!/usr/bin/perl
print "Content-type: test/html\n\n";
print "Show Me the monkey";
############

When I browser to the file by going to http://localhost/~lover/test.cgi
the screen shows me the source code.

Well uploading the script to remote server the result is "Show Me the monkey"

Can any of you give me a hint how to make my machine support the cgi please ? Any hint will be highly appreciated!

Thanks a lot in advance
:)

Rocky

greenhat
Posts: 170
Joined: 2006-06-03 17:32

#2 Post by greenhat »

hi, try adding this code to your /etc/apache2/sites-available/default file...

Code: Select all

        <Directory /home/*/public_html/cgi-bin>
        Options ExecCGI
        </Directory>
then restart apache2...

Code: Select all

/etc/init.d/apache2 restart
and see if it makes a difference. I'm assuming you've created a ~/public_html directory and ~/public_html/cgi-bin subdirectory under your user account.

And don't forget to make the cgi script executable "chmod 755 test.cgi"

It's working fine for me under Debian/Etch, though it took me quite a lot of hacking and experimenting the first time I did it. Good luck

mark_grieveson
Posts: 21
Joined: 2006-02-27 15:54
Location: Toronto

#3 Post by mark_grieveson »

Perhaps putting the file in the directory /usr/lib/cgi-bin/ (ie, /usr/lib/cgi-bin/test.cgi), and then, running it with http://localhost/cgi-bin/test.cgi

Post Reply