LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   CGI in debian (https://www.linuxquestions.org/questions/linux-newbie-8/cgi-in-debian-680019/)

mahi 10-30-2008 09:56 AM

CGI in debian
 
hello people..
I've a problem in executing "CGI" programs through browser...
I've installed apache..
after this when i serached for /var/www/cgi-bin directory it was not at all created..
there was only /var/www/apache2-default..
then i tried by keeping my programs in it and when i opened through a browser like http://localhost/apache2-default/1.cgi, the file 1.cgi was not interpretted as cgi file at al..
it just displayed all the contents of that file....
this was initial problem..
then i created cgi-bin directory myself.. But now i'm not even gettin that..
it shows a warning "not safe to open cgi files.....," and gives an option to download or cancel..
if anyone know wat the problem is please help..

wernerz 10-30-2008 11:31 AM

I am assuming you are using apache2 on debian etch. I believe the cgi-bin directory is in /usr/lib/cgi-bin. If you want it in the /var/www directory, then create it as root with:

# mkdir /var/www/cgi-bin

Open the default apache config file in /etc/ apache2/sites-available/default or httpd.conf and find this line:

ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"

Change to ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

Then restart apache with /etc/init.d/apache2 restart

mahi 10-31-2008 03:20 AM

Quote:

Originally Posted by wernerz (Post 3326238)
I am assuming you are using apache2 on debian etch. I believe the cgi-bin directory is in /usr/lib/cgi-bin. If you want it in the /var/www directory, then create it as root with:

# mkdir /var/www/cgi-bin

Open the default apache config file in /etc/ apache2/sites-available/default or httpd.conf and find this line:

ScriptAlias /cgi-bin/ "/usr/lib/cgi-bin/"

Change to ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"

Then restart apache with /etc/init.d/apache2 restart

ok.. thanks a lot.... :)
Its working.... :)

mahi 10-31-2008 03:21 AM

thanks.. its workin,,...


All times are GMT -5. The time now is 10:41 AM.