Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm currently running Apache with Passenger and a Rails 3.1 application. In my environment setup, I need to start sunspot - rake sunspot:solr:start RAILS_ENV=production - before I run the server. Since the server starts auto-magically when Apache starts, I'm not entirely sure how to do this.

How can I run a list of commands before the Rails server starts?

share|improve this question
    
Which distro are you running? –  quanta Sep 5 '11 at 17:09
    
Ubuntu LTS 10.04 –  joesavage Sep 6 '11 at 8:59

1 Answer 1

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.

share|improve this answer
    
What do you mean? –  quanta Sep 7 '11 at 7:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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