Old 27th May 2007, 21: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


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

Can you please tell me how to make it?



Last edited by bburn; 27th May 2007 at 21:31.
Reply With Quote
Sponsored Links
Old 28th May 2007, 18:16
falko falko is offline
Super Moderator
Join Date: Apr 2005
Location: Lneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,751 Times in 2,581 Posts

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

ScriptAlias  /cgi-bin/ /path/to/your/cgi-bin_directory/
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
Old 2nd June 2007, 22:53
bidevi bidevi is offline
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
Order allow,deny
Allow from all

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:


Add these lines in the httpd.conf file:

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

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)
Old 23rd April 2010, 20:34
bidevi bidevi is offline
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

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

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
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

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

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:

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 21:43. Reason: More details
Reply With Quote
Old 24th April 2010, 13:23
bidevi bidevi is offline
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 16:12. Reason: Partly solved
Reply With Quote


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 18:32
Perl and cgi script installation linuxuser1 General 30 27th April 2006 00:09
CGI issue (SUExec as well maybe) MathieuMa Installation/Configuration 4 11th April 2006 10:59
Internal Server Error 500 cgi script mphayesuk General 6 8th February 2006 23:53
Ispconfig cgi hosting Mahir General 6 21st November 2005 16:40

All times are GMT +2. The time now is 14:46.

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