简体   繁体   中英

do I have to restart apache after updating ruby in order to make passenger restart?

I need to update ruby in the system. It is a minor update and I'll do that by installing a new ruby RPM that has a new patch on it.

My question is, do I have to restart apache after updating ruby in the system? Or is it another way to make passenger reload ruby?

I've tried running a page that outputs the RUBY_VERSION, RUBY_RELEASE_DATE, RUBY_PATCHLEVEL in order to check that, but it does not work for me because the update is a new patch in the RPM, not in ruby itself, so that those constants are the same for the old and new version.

thanks

No, you don't need to restart the whole Apache.
You need to restart your application though.

Passenger has an easy way to tell the application to restart : create a restart.txt file in the tmp directory inside your application.

The application will be restarted the next time a request is made to it.
So you might want to automatically request your application after deploying to force the restart.

I am pretty sure that, at least in passenger 3, you do need to restart apache.

After installing the new ruby, you need to re-install the passenger apache module, linked to your new ruby, ( passenger-install-apache2-module ), then you need to take the apache config lines that it shows you after installation, and edit your apache config file to include them (replacing the old lines pointing to your old ruby), then you need to restart apache.

Now, it's possible there's a different way to do this without restarting apache for Passenger 4 (still not official final release, but in RC). Passenger 4 has some features for a passenger running multiple rubies simultaneously that might end up allowing this sort of thing too; I'm not sure, I haven't looked into it much. But I think with Passenger 3 (the existing stable Passenger, that most are probably still using), you've got to do as above.

You can restart a specific app running under passenger with a restart.txt like Damien MATHIEU says in a different answer. But to change the version of ruby that passenger is running under and starting apps under -- I'm pretty sure you need to restart apache (after first reinstalling the apache passenger modules, and changing the passenger apache config)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM