You can do 95% of this (excluding Apache configuration) automatically with Rails templates.
My example is here https://github.com/prognostikos/rails_templates/blob/master/... and if you search github you can find many more.
Use with 'rails new yourapp --template=path/to/template'