#1  
Old 27th May 2007, 20:10
bburn bburn is offline
Junior Member
 
Join Date: May 2007
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default .cgi script outside cgi-bin

Hello,

i try to run a cgi script outside of the cgi-bin dir.

Can you please tell me how to make it?

Regards,

Bjoern

Last edited by bburn; 27th May 2007 at 20:31.
Reply With Quote
Sponsored Links
  #2  
Old 28th May 2007, 17:16
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,741 Times in 2,575 Posts
Default

Add a line like this to your Apache Directives field in ISPConfig:

Code:
ScriptAlias  /cgi-bin/ /path/to/your/cgi-bin_directory/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 2nd June 2007, 21:53
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default This got cgi-scripts running outside the cgi-bin for me

To get cgi-scripts running somewhere outside the cgi-bin I did the following things.

In httpd.conf, somewhere halfway the file, I found a paragraph saying:

<Directory "/var/www/icons">
Options Indexes MultiViews
AllowOverride
Order allow,deny
Allow from all
</Directory>

The above isn't important for what you want, but I just chose this as a spot below which in my case I added some new lines.

Let's assume that you want to run a cgi-script inside the following directory:

/var/www/html/eggplant

Add these lines in the httpd.conf file:

<Directory "/var/www/html/eggplant">
Options Indexes MultiViews ExecCGI
</Directory>

Restart the Apache server:
/etc/init.d/httpd restart

Now you may run cgi-scripts inside the directory eggplant.

If necessary, repeat the permissions of your working scripts inside the cgi-bin.
Reply With Quote
The Following User Says Thank You to bidevi For This Useful Post:
falko (3rd June 2007)
  #4  
Old 23rd April 2010, 19:34
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
Default But now: how to do this in Lenny

Earlier I wrote how to execute perl scripts in Etch.

Now I use Lenny. A httpd.conf file does exist but it's empty. I assume one can configure either the file /etc/apache2/sites-available/default or a file like /etc/apache2/sites-available/example1.com.vhost.

I have tried to repeat the steps written in my earlier post in those files. Also, the permissions for files and folders are wide open (777) but I get either a Forbidden! or a misconfiguration message, depending on my different configuration attempts.

So I opened /etc/apache2/sites-available/default and found these lines:

<Directory /var/www/>
AllowOverride None
Order allow,deny
allow from all
</Directory>

I added Options Indexes FollowSymLinks ExecCGI to make it look like:

<Directory /var/www/>
Options Indexes FollowSymLinks ExecCGI
AllowOverride None
Order allow,deny
allow from all
</Directory>

I restarted the server: /etc/init.d/apache2 restart

I visited example1.com/test.pl

Result: ERROR 403 - Forbidden!
The following error occurred:
You are not permitted to access the reqested URL.
Please contact the webmaster with any queries.

I contacted the webmaster. That's me. And I don't know it.

Inside sites-enabled there is also configuration file example1.com.vhost, containing these lines:

# cgi enabled
<Directory /var/www/clients/client1/web1/cgi-bin>
Order allow,deny
Allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/clients/client1/web1/cgi-bin/
AddHandler cgi-script .cgi
AddHandler cgi-script .pl

Now, I told the webmaster not to be lazy and he couldn't refuse because it was me, and in the example1.com.vhost file I changed the lines:

<Directory /var/www/clients/client1/web1/web>
Options FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>

to look like (adding Indexes MultiViews ExecCGI):

<Directory /var/www/clients/client1/web1/web>
AddHandler cgi-script .cgi .pl
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>

And then: /etc/init.d/apache2 restart

After which www.example1.com/test.pl remained Forbidden! as ever.

And this is what the text.pl files contains:

#!/usr/bin/perl
print "Hello World.\n";

What a terrible day! Please, tell my what's good about Lenny.

Does anyone know how to run perl scripts in Lenny outside the cgi-bin?

Thanx in advance.

Last edited by bidevi; 23rd April 2010 at 20:43. Reason: More details
Reply With Quote
  #5  
Old 24th April 2010, 12:23
bidevi bidevi is offline
Member
 
Join Date: Jun 2007
Posts: 60
Thanks: 3
Thanked 2 Times in 2 Posts
 
Default CGI doesn't work at all

Thanks, Falco, for your suggestion (in april 2005). I'll try it out later. It took me some effort to figure out that the Apache directives field is under the Options tab of a given domain in ISPConfig3.

Something funny is going on. I'm using the tandem Lenny/ISPConfig3 now and perl doesn't work at all, not even in the cgi-bin. There was no such problem with my old Etch/ISPConfig combination.

Since the domain was created using the ISPConfig3 panel: is there something I could have done wrong while creating the site?

For your information: I checked all boxes except SSL, with Auto-Subdomain set to www. and PHP set to Mod-PHP (and Active checked). I use both PHP and perl.

If you want to see what happens, go to opstartpagina.nl/opstartmail.html, send me a message and see what comes out of that. The perl script is in the cgi-bin and permissions are wide open.

If I can't get the new tandem working (I'm configuring it from the top on another box), I'll have to return to the old tandem or resort to another Linux distro.

OK, perl in cgi-bin is working alright now. No luck yet outside the bin.

Last edited by bidevi; 24th April 2010 at 15:12. Reason: Partly solved
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

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 On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
apache2 problem laser144 Server Operation 8 15th March 2007 17:32
Perl and cgi script installation linuxuser1 General 30 26th April 2006 23:09
CGI issue (SUExec as well maybe) MathieuMa Installation/Configuration 4 11th April 2006 09:59
Internal Server Error 500 cgi script mphayesuk General 6 8th February 2006 22:53
Ispconfig cgi hosting Mahir General 6 21st November 2005 15:40


All times are GMT +2. The time now is 18:09.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.