Tip of the day - APP_ROOT/config/httpd.conf

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.

No Comments, Comment or Ping

Reply to “Tip of the day - APP_ROOT/config/httpd.conf”

About

Rowan is a Director of Technology for a large marketing services company, specialising in architecting, developing and putting web applications into production - in particular Ruby on Rails based apps. He lives in Toronto, Canada but speaks in a funny accent as he's originally from New Zealand. He's been working in the software and web business for over a decade. This blog covers Web Application development and deployment in the real world, dealing with topics from business fundamentals to Ruby on Rails, Merb, PHP, Flex, MySQL, Apache and more.

Read more ...

 

 

View Rowan Hick's profile on LinkedIn

 

Subscribe to my RSS feed