Lighttpd.conf rails generator

Posted by ezmobius Sat, 05 Nov 2005 22:26:00 GMT

Here is a simple generator I wrote for generating lighttpd.conf filees for either fastcgi or scgi. It creates a lighttpd_fcgi.conf or lighttpd_scgi.conf in your config directory.

Untar the archive and put the lighttpd folder into ~/.rails/generators/lighttpd, and it will automatically be available as a generator for your rails projects.

If you are running fcgi then you use the generator like this:

$ script/generate lighttpd fcgi

If you already have Zed Shaw’s SCGI Rails Runner installed and you have already ran the scgi_ctrl command then you use the generator like this:

$ script/generate lighttpd scgi

When you generate a lighty config for scgi it reads in your config/scgi.yaml (that was generated when you ran scgi_ctrl) and creates the correct lighty config directives from that. It creates two files, lighttpd_scgi.conf and In the main lighty conf file it has an include directive to include the file. This way you can regenerate the file when your scgi configuration changes without the need to redo any changes to the main lighttpd_scgi.conf file.

Anyway, here is a linnk to the generator. If you have any questions or suggestions for more features let me know. I plan on adding scgi and fcgi clustering commands and also apache config files eventually as well.


Posted in ,  | 6 comments


  1. zem said 29 days later:
    should be in ~/.rails/generators/lighttpd, not ~/.rails/lighttpd
  2. Ezra Zygmuntowicz said 34 days later:
    Ahh thanks for catching that. I have updated the main post.
  3. Joel said 34 days later:
    I actually just wrote a Rails app that does this for a multiuser environment. My friend and I are still writing the scripts that will gracefully restart lighttpd. It allows for user login and management of projects and mappings complete with user password changes (which will be optionally attached to a bash script that will update MySQL, PostgreSQL, and shell account passwords). It's pretty sweet. I don't have it up anywhere yet, but if you're interested in seeing it I can hook you up. You can see some screenshots here:
  4. K said 117 days later:
    I put it in C:\ruby\lib\ruby\gems\1.8\gems\rails-1.0.0\lib\rails_generator\generators to make the generator availible. I also needed to delete this line: server.errorlog = "log/error.log" from the generated file to prevent lighty saying there where two entries for server.errorlog (which there are).
  5. miguelsan said 122 days later:
    In my Ubuntu 5.10, I did it like this:
    $ sudo mv ~/.rails/generators/lighttpd       /usr/local/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/rails_generator/generators/components/lighttpd/
    I had to add the full bin-path in the line referring to fastcgi.server in my lighttpd.conf file.

    Good work.
  6. we live together said 548 days later:
    Predicted values in template editing can be done through any PHP script?

(leave url/email »)

   Preview comment