Debian sarge 3.1\apache2 not surpport cgi

Need help with C, C++, perl, python, etc?

Debian sarge 3.1\apache2 not surpport cgi

Postby rockymaxsource » 2006-06-06 01:52

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
rockymaxsource
 
Posts: 12
Joined: 2006-05-26 07:35

Postby greenhat » 2006-06-07 16:06

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
greenhat
 
Posts: 170
Joined: 2006-06-03 17:32

Postby mark_grieveson » 2006-08-22 00:46

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
mark_grieveson
 
Posts: 21
Joined: 2006-02-27 15:54
Location: Toronto


Return to Programming

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable