Nowadays OpenSUSE comes with almost all packages I need to run a fast and reliable webserver. As I have written before I use nginx and php-fpm for our podcast service.
You can get up-to-date packages of nginx through OpenSuSE’s build service. I have not yet found a RPM package of php-fpm though. Therefore I compile it myself. This works well and I have the advantage that I can customize by PHP package.
But there is also one disadvantage. There is no system runlevel script available this way. So you cannot make use of the rc stuff on OpenSuSE and start PHP at boot time. As I have quiet a few machines to administer I decided to write my own runlevel script to start php-fpm.
Looking closer into the stuff that is already delivered with the php-fpm package is a powerful start script. I took it as the basis of my script. I had to modify it only in a few places. Big thanks to the author(s)!
It will take a few easy steps to get php-fpm running after booting.
- Download my modified php-fpm script to your server’s runlevel directory (/etc/rc.d).
- Rename the file by removing the file extension (.txt)
- Give your superuser (root) rights to execute it.
- Open the file php-fpm in your favorite editor (Vim, emacs, joe, …).
- Modify the three lines (php_fpm_BIN=, php_fpm_CONF=, php_fpm_PID=) on top to match your installation directory of php-fpm.
- Save and close the file.
- Start yast with yast runlevel and switch to expert mode with Alt+x
- Activate php-fpm for runlevels 3 and 5 (or whatever suits you). Save your changes with Alt+o. That’s it!
Now your php-fpm installation starts on boot. If you ever have to reboot your machine you do not have to think about starting php-fpm manually as the system does it for you.
Let me know if this was helpful for you, if it works and if you have any questions!Google+