Using index.cgi

I would like to use index.cgi on my page so when someone goes to mysite.com/app my WebApp runs.
I can access my app by doing mysite.com/cgi-bin/index/index.cgi and it works fine.
But when I do mysite.com/cgi-bin/index it give me a 403 Forbidden error.
Here is my .htaccess file

DirectoryIndex index.cgi Options +ExecCGI order allow,deny deny from all <Files *.cgi> allow from all </Files>
I am using Apache and CentOS.
Thanks

I had the same problem, my solution (just if you had PHP !!) is not the best, but it works:

In the /app/ directory (if you have a virtual o a directory in DocumentRoot) put index.php with this:

[code]

<?php header('Location: http://mysite.com/cgi-bin/index/index.cgi'); exit; ?> [/code]

I try with DirectoryIndex but doesn’t work for me. If anyone knows how configure that, please share!!.

William,

Sounds like Apache is ignoring your .htaccess file. Check your Apache config at /etc/httpd/conf/httpd.conf and you will probably see:

<Directory “/var/www/cgi-bin”>
AllowOverride None
Options None
Order allow,deny
Allow from all

You want ‘AllowOverride All’

Hi,

You should access it with:

mysite.com/cgi-bin/

There seems to be no “mysite.com/cgi-bin/index” on your Server…
So If DirectoryIndex is forbidden you get this error…

Marius

Ups, I didn’t see the double Index/index.cgi :wink:
You should have a look in your apache log/ error log.
You could define these configuration in Apache Config / virtual host config if you have access…

Marius

[quote=71044:@Phillip Zedalis]William,

Sounds like Apache is ignoring your .htaccess file. Check your Apache config at /etc/httpd/conf/httpd.conf and you will probably see:

<Directory “/var/www/cgi-bin”>
AllowOverride None
Options None
Order allow,deny
Allow from all

You want ‘AllowOverride All’[/quote]
Well I checked and it has AllowOverride All.
I was able to edit my .htaccess folder in another www folder and it worked when I set blah.htm as an index.

Theres usually one for each cgi-bin. You need to make sure its set for all of the appropriate directories.

I am using CentOS with Virtual Hosts. Where is the httpd.conf for the virtual hosts? I don’t see any entries in my httpd.conf.

Have you configured virtual hosting? Or is there just one?
You could search for Includes in httpd.conf, perhaps there is a dedicated file.

I found out…Somethings.
First I updated to Plesk 11.5.30 Update #36
Now I am trying to create a vhost.conf to have the AllowOverride All.
I don’t know if the vhost.conf is being processed.
Does anyone know if I could put a script in the .conf file to dump some text into a text file so I know if it is being processed or not?

Oh and this is what I am trying to do.
Tip of the day:avoiding cgi in the call to a web app

Do it in Plesk, i think it will override all you changes. You should be able to set manual configuration to virtualhost-config with webinterface.

Here is something found: http://support.hostgator.com/articles/plesk/plesk-10/plesk-10-client-side/directory-index-with-plesk

That’s but I am on CentOS.

I didn’t realize you were on plesk. Those types of control panels tend to move things around. It would be best to dig through Plesk documentation or contact them.

Well, now I put in a vhost.conf and set AllowOverride All. Still not working. I can put AllowOverride None and nothing works like it should. I put in a simple helloworld type cgi. That won’t work when I go to it. But if I type it out it works.

Try restarting Apache with the new config. Just a shot in the dark.

Restarted many times

Works
Does not work

Oh and to make sure I covered everything I put this as my vhost.conf

<Directory ></Directory> Options FollowSymLinks +ExecCGI AllowOverride All DirectoryIndex index.cgi </Directory>

I know this is vhost.conf is working because if I put in a setting to deny access it does what it is told.