Tip of the day - APP_ROOT/config/httpd.conf
08 August, 2008
If there's one thing that's saved me no end of heartache it's including Apache conf settings for a Rails app or Merb/PHP/whatever, in the app's config folder. You get versioning for free. You don't forget your settings. You know where to find it every time. No other process can mess with it (not looking at anyone in particular CPanel...). Just make sure your web app can't mess with it :) i.e. create a file /var/rails/myrails/app/current/config/httpd.conf in which you place your host pointing to your rails app. Then in your apache conf file (normally /etc/httpd/conf/httpd.conf) ensure you include the file above. On my main app config file I try to pop in the top of the file the passenger config settings, as again it's easy to find, then any of the required vhost(s) that the app uses. Nice clean and in one place.