LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Debian
User Name
Password
Debian This forum is for the discussion of Debian Linux.

Notices

Reply
 
Search this Thread
Old 12-07-2012, 03:27 AM   #1
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 591

Rep: Reputation: 31
no cgi-bin


Hi,
I installed the apache2 from the wheezy distro (debian),
apache2, php5 mysql everything ran correctly but cgi failed.
The module is loaded I mean the cgi.load
I added cgid.load and cgid.conf to mods-enabled

firstly no file : cgi.conf ?? in mods-available

secondly the directory /usr/lib/cgi-bin is empty ???!!!


in the apache sites I have a correct script:
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

I suppose I need to install the cgi program?? or what ?
thanks for help
regards
 
Old 12-07-2012, 06:53 AM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,885

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Hi,

To test if cgi scripts are working, create the following hello.cgi
Code:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "Hello world.";
in /usr/lib/cgi-bin, make it executable and see if it's parsed by apache

Regards
 
Old 12-09-2012, 02:16 AM   #3
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 591

Original Poster
Rep: Reputation: 31
thanks for reply
it worked with localhost/cgi-bin/hello.cgi !!!
so???

I am obliged to put the scripts in /usr/lib/cgi-bin ???
how to redirect link to /var/www/cgi-bin and for user count like ~bela/ ?

thanks
 
Old 12-09-2012, 03:49 AM   #4
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,885

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
Quote:
I am obliged to put the scripts in /usr/lib/cgi-bin ???
No you're not, but it's better to stick with your distro's defaults.

Quote:
how to redirect link to /var/www/cgi-bin and for user count like ~bela/ ?
You can change the relevant entry in apache config file(s) to read:
Code:
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
but I don't think it's a good idea, as /var/www is the default docroot, so the cgi-bin will be a subdirectory of that.
I don't understand what you mean by "for user count like ~bela/", so please clarify

Regards
 
Old 12-09-2012, 01:14 PM   #5
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 591

Original Poster
Rep: Reputation: 31
thanks a lot
I mean how to give for a user to create his own script
for example to access the the user count bela on the , we use
http://localhost/~bela, bela has a public_html directory.
How to access the cgi script in the bela'site.

thanks
regards
 
Old 12-09-2012, 04:02 PM   #6
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,885

Rep: Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322Reputation: 1322
You can create a /home/bela/public_html/cgi-bin directory and use
Code:
<Directory /home/*/public_html/cgi-bin>
Options +ExecCGI
AddHandler cgi-script .cgi .pl
Allow from all
</Directory>
 
Old 12-12-2012, 11:20 AM   #7
abd_bela
Member
 
Registered: Dec 2002
Location: algeria
Distribution: redhat 7.3, debian lenny
Posts: 591

Original Poster
Rep: Reputation: 31
Thanks a lot

it is OK

regards
bela
 
  


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
Not Found The requested URL /nagios/cgi-bin/tac.cgi was not found on this server. amanamu Linux - Server 5 02-07-2013 03:45 AM
could not execute bin folder of a package from cgi bin script using python ashish hasani Linux - Server 1 04-05-2012 12:18 AM
Cant seem to run any cgi scripts in cgi-bin folder, confused? j.smith1981 Linux - Server 5 02-14-2011 05:38 AM
CGI to work out side of cgi-bin? crashedspine Linux - Newbie 13 09-02-2004 08:49 PM
http://www.burstnet.com/cgi-bin/ads/ad7954a.cgi/3980/RETURN-CODE rverlander LQ Suggestions & Feedback 1 06-07-2002 07:35 AM


All times are GMT -5. The time now is 08:16 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration