Starting Redmine with Apache/Passenger on reboots
I'd like to make sure Redmine application starts upon reboots. I followed these procedures to install Redmine on Ubuntu with success:
At the bottom, it recommends to add this in crontab:
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d
However, my Redmine application is on /usr/share/redmine. Also, its running Apache port 80/443, with Passenger. site is SSL enabled.
When I connect to the site, it takes a few seconds to load. Would be nice to have it startup automatically upon reboot. Is there a recommended command? Thank you.
I have the same problem, cause it takes some time for the site to render the first time after the boot.
I have two advices, the first is to use memcached with your apache installation:
$ sudo apt-get install memcached libmemcached6 curl
$ sudo a2enmod mem_cache
$ sudo service apache2 restart
And the second, change a bit script at the crontab @reboot:
@reboot cd /opt/redmine/redmine-0.8.6 ; rm -f log/mongrel.pid ; mongrel_rails start -e production -p 3000 -d ; sleep 10 ; nice -n 19 ionice -c2 -n7 curl http://localhost:3000/ > /dev/null 2>&1
This will force the site to render the first time, so when your users logon, it will be ready for use.
One thing I did not fully understood is why do you run mongrel at all since you are using passenger + apache (as it says in your title description)... apache should be able to handle redmine alone via the passenger module (there is no standalone mongrel start up script at my server).
If you are still experiencing delay a delay after no one has been visiting your site for a while, you can try to keep the rendered state on cache simply by forcing the curl every now and then... you could try adding another line to your crontab, like this:
*/45 * * * * nice -n 19 ionice -c2 -n7 curl http://localhost:3000/ > /dev/null 2>&1
This will have your site "refreshed" in the cache every 45 minutes, but it might be a little too much... test if you really need this, or try changing the amount of time between each "refresh" to a better value that might be perfect for your case.