LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-30-2008, 10:56 AM   #1
mahi
LQ Newbie
 
Registered: Sep 2007
Location: mysore
Distribution: Debian
Posts: 16

Rep: Reputation: 0
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..
 
Old 10-30-2008, 12:31 PM   #2
wernerz
Member
 
Registered: Jun 2008
Location: Ottawa, Ontario, Canada
Distribution: debian, dsl-n
Posts: 55

Rep: Reputation: 15
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
 
Old 10-31-2008, 04:20 AM   #3
mahi
LQ Newbie
 
Registered: Sep 2007
Location: mysore
Distribution: Debian
Posts: 16

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wernerz View Post
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....
 
Old 10-31-2008, 04:21 AM   #4
mahi
LQ Newbie
 
Registered: Sep 2007
Location: mysore
Distribution: Debian
Posts: 16

Original Poster
Rep: Reputation: 0
thanks.. its workin,,...
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 and CGI problem on Debian Etch jwaters504 Linux - Server 2 09-19-2007 09:28 PM
Debian, apache2, CGI problem daviddutch1964 Linux - Networking 1 06-29-2007 04:19 PM
Debian, apache2, CGI problem daviddutch1964 Linux - Server 0 06-29-2007 03:14 PM
libapache-mod-cgi-debug in debian sarge rblampain Debian 1 11-04-2005 11:34 PM
Apache Cgi-Bin confguration on debian distro rjcmi Linux - Newbie 2 07-15-2004 09:11 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 04:11 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration