nginx, php and perl, oh my!

Hey there:

I'm pretty much a n00b, but I have managed to get a server up and running with nginx/php and other fun services such as postfix/dovecot, etc. I'm using Ubuntu 8.10.

I'm using spawn-fcgi to manage php processes from nginx. And that works fine. However, I'm having a tremendously difficult time figuring out how to get perl scripts running from the web browser. The nginx end of things I can probably figure out; what I don't understand, though, is what process I should be running to receive the requests from nginx to execute perl scripts, and how I should get that process running, and under what permission. The most I've accomplished is compiling and installing fcgiwrap, but I'm now stuck.

I realize more details would probably be helpful to get an answer to my question, but I'm not sure what additional details are necessary! Thanks in advance.

  • geoff

2 Replies

As you discovered, nginx has no native support for plain old CGI. If fcgiwrap doesn't work for you (for whatever reason), you'll have to proxy the request to another server that does support CGI. Actually that might be a lot simpler than compiling an nginx module and trying to troubleshoot it.

I'd recommend that you run lighttpd on an internal port (e.g. and handle CGI requests with that. … ocs:ModCGI">

Thanks – I actually figured out how to initiate fcgiwrap and get nginx to send the requests over there, so I don't have to resort to your options.

From what I understand, the performance isn't going to rock, but my goal was just to be able to run a few one-off scripts that my wife and I made to do some odd tasks. Thanks for the suggestions, though.


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct