From: Sean Chittenden Date: 2002-04-08T11:12:22+09:00 Subject: Re: Apache & Ruby - for a newbie > I've seen the recent posts about using Apache with Ruby. > Unfortunately, I'm still a step away from being able to make sense > of them... Let's see if we can sort things out then. > I'm about to set up my first dedicated web-server, and I'd like to > use Ruby as my CGI scripting language. It seems from the > conversation on this list that Apache is the way to go to achieve > this. Congrats and a fine choice of languages, if I do say so myself. :) > My problem - I know nothing about how to configure Apache to use > Ruby. Are you going to configure Apache to use mod_ruby, or are you going to use CGI's? If this is your 1st webserver and if you have no prior experience with web technologies, I'd recommend CGI for now, but would try to quickly move to mod_ruby and eRuby when you begin to get comfortable. CGI is an old web-technology that's a good 8 years old... but if 'ya want to fly, why not start at the beginning? There's not much of a difference between mod_ruby and CGI really, but there are a few important quirks that I'm sure you've heard mentioned. > Are there any good documentary web-pages on setting up Apache to use > Ruby as the scripting language for CGI? This is pretty simple: uncomment the lines for .cgi's (should be labeled), and turn on +ExecCGI for the directory that you want to have your CGI's in. If you're running with a cgi-bin directory, make sure that you're writing your scripts in the write place. Anyway, after configuring and restarting apache, end your ruby scripts with ".cgi", make sure that they're executable (a+x or 755), and have the appropriate "#!/usr/local/bin/ruby -w" at the top. There is documentation about how to do this though, I'm sure what I just said doesn't make any sense unless you have some familiarity with Apache. The configuration file and the following URL are your friends. http://httpd.apache.org/ > Or, if folk are willing to answer my naive questions, I'm very happy > to condense all the answers into a clear, straight-forward 'how-to' > in return. That sounds excellent. If you have questions about anything that you may run across along the lines, please feel free to shoot me an email: a HOW-TO on this would probably be useful to people like yourself who are new to this. -sc -- Sean Chittenden