how can i set up a folder to act as a cgi-bin so that all files in the folder are executed as cgi even without a .pl extension.

I will move away from this eventually but for now my legacy site has too many links to /cgi-bin/scriptName with no extensions and I just want to get them to run for now.


As Dreamhost runs under Su_Exec, you can name any directory you desire as cgi-bin, and execute your scripts from within that directory. As long as your scripts’ permissions are appropriately set to executable, and have the appropriate !shebang line at the top, they will not require a “type” to run.



doesn’t quite seem to work. Scripts work fine if i add .pl at the end, but they won’t work w/o any extension


Oh well, Textmate’s global find & replace in a project was a faster way to fix this after all. thanks for the help.




I wasn’t ignoring your report that my idea didn’t work :-(, I was casting about for another approach to take before I answered you. It seems you found the “best” way to attack the issue, and I’m glad you got it worked out. I’m sorry I was not able to be of more help.



no no, no worries at all. I really appreciate your help. I read somewhere on the wiki that they need to have .pl or .cgi so I just went ahead and made the change this way to make it work for now.

I still don’t like the .pl in there because it messes up my user-friendly URLs and the dozens of links floating around out there. So if you had found any other ideas let me know. Anyway, it’s just a temporary fix until my Rails version is up and runnning.


It seems to me you should be able to accomplish this with an .htaccess file and a addhandler line in it. But I can’t make it work. The idea is that
addhandler cgi-script .pl
would force any scripts with a .pl to be excuited by cgi. Obviously this already happens with dreamhost. by leaving the .pl off entirley it should run any file in that directory or sub-directories through cgi. But When I tested this all I got was 500 server errors. So I don’t know if you can do this, and I’ve just got somehting wrong, or if it doesn’t work for some inherant reason I don’t know about.

Anyways, just through I’d put that out there, maybe you can find some info on it and get things working. Or you could contact support and see if they can shed any light on things.

–Matttail - personal website


.htacess file in cgi-bin. Command: SetHandler cgi-script

That will make everything in /cgi-bin/ run as a CGI reguardless of file extension.

yerba# rm -rf /etc