I'm currently running Apache2 with Passenger and a Rails 3.1.rc5 rails application. All is going well so far - however I have run into an issue where I need to start sunspot ("rake sunspot:solr:start RAILS_ENV=production") before I run the server (and since the server starts automagically when apache is started - I have no idea how to do this). Surely there must be some way to either:

a) Run a list of commands before the server starts b) Completely customise the start process so I have to also make it also run "rails server -e production"

Any help?

link|improve this question

Which distro are you running? – quanta Sep 5 '11 at 17:09
Ubuntu LTS 10.04 – Joesavage1 Sep 6 '11 at 8:59
feedback

1 Answer

up vote 0 down vote accepted

You can write a Upstart config (or install Solr with Tomcat) to start Solr use a stanza like below:

start on starting apache2

This makes Solr will be started before Apache.

link|improve this answer
How would I create on of these Upstart configs? – Joesavage1 Sep 7 '11 at 7:26
What do you mean? – quanta Sep 7 '11 at 7:32
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.