Posted by ezmobius
Fri, 11 Nov 2005 23:51:00 GMT
I have been setting up VPS servers at rimuhosting.com. These guys have really nice prices on Xen based virtual private servers. This blog runs on one of them. I am putting together some documentation on setting up your own debian sarge based VPS for rails/lighttpd development and deployment.
There is a need for rails hosting like this as rails does not lend itself very well to run on shared hosting plans. Textdrive is a great example of this. They are a great host and I like them in general but their uptime lately is dreadful. I have clients with lifetime accounts that are upset that its impossible to run a production site on TextDrive.
The two servers that I am familiar with are Gilford and Nelson. Both of these seem to go offline multiple times a week. Argg! Can’t have that and keep clients happy.
So the best solution I have come up with is to use either VPS or dedicated servers for raisl work. Xen performance is truly a thing of beauty. It comes close to a dedicated solution. And I have a great system for setting up a minimal debian system with just the essentials:
ruby, gems, rails, mysql or postgresql, postfix, subversion, lighttpd, fcgi and all the goodies to tie all those packages together. With this set up you end up with a lean and mean rails machine!
I have found that with this setup the $29 plan at rimu will happily run an install of typo and about 2 -3 other decent sized rails apps and some other static html sites or what-have-you. And it will do so very fast. Lighty really shines in this environment since it is so light on resources. So I don’t even install apache and all its bloat so it doesn’t sit there eating RAM.
Mysql or postgresql are the most memory intensive parts of the whole equation. So hand tuning these db engines to run well on a memory restrictive VPS is a little bit of a challenge but well worth the rewards.
Stay tuned for a detailed write up of the complete setup process of a rimu VPS from scratch. I will be taking notes on an install this weekend and will post them here shortly.
Posted in ruby, rails, debian | 7 comments
Posted by ezmobius
Tue, 08 Nov 2005 02:09:00 GMT
Here are some xml feed templates that work well for rails. These uses the great XML::Builder library that comes with rails. With these you use an .rxml file for your view instead of your normal .rhtml file.
Enjoy!
Read more...
Posted in ruby, rails | 15 comments
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 scgi_conf.inc. In the main lighty conf file it has an include directive to include the scgi_conf.inc file. This way you can regenerate the scgi_conf.inc 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.
lighttpd.tar.gz
Posted in ruby, rails | 6 comments
Posted by ezmobius
Sat, 05 Nov 2005 21:57:00 GMT
I have put together some crib notes about the install of the whole rails/lighttpd stack. These directions have worked on over 20 computers without a flaw. I have tested it on OS X, debian, fedora and FreeBSD and it works great.
Of course some people complain and say to use the package manager from your distro and this is usually the best practice. But I have found discepancies with how the various package managers break up the ruby install(debain) or have crappy package managers(OS X). When I install things this way I always get a know working stack of software tht is the same no matter what OS I am on at the moment.
These directions are especially good for OS X. That is where I have used these the most. So I hope these help some people. And if you have any questions just drop me a line( ez at brainspl dot at) or make a comment.
Installation Instructions
Posted in ruby, rails, OS X, debian, linux | 12 comments
Posted by ezmobius
Thu, 03 Nov 2005 11:55:00 GMT
My story:
Beginning in early 2005, we thought about how best to redesign the newspaper’s website. We needed to start completely from scratch in order to increase the usability and reduce the maintenance overhead with the newspaper’s website. This website brings together 4 separate data sources into one cohesive structure. With the old site there was way too much human interaction required to keep things up to date and it was costing the paper more money for staff than the revenue from the site. To accomplish this, I switched to developing full time with Ruby on Rails, referred to here as RoR) after four years of heavy PHP and a few years of Python development.
I hope this summary of the project provide sperspective on how someone coming from a PHP background rewrote 5,500 lines of PHP code with 1,800 lines of code in RoR. I was the only one coding on this project and I had one other person create some of the views.
What follows, tells the story of the developing a substantially sized RoR project at http://yakimaherald.com. (The old PHP site is here: http://legacy.yakimaherald.com.)
More after the jump…
Read more...
Posted in ruby, rails | 22 comments