Greg's Blog

helping me remember what I figure out

This Site Is Now Powered by Nginx

| Comments

I took the plunge this afternoon and switched from Apache 2 to NGinx. For the most part I followed the instructions posted here. Since I am now running Debian Squeeze there were a few things to note:
  1. spawn-fcgi: there’s a package for it so I just used that : [code]sudo apt-get install spawn-fcgi[/code]
  2. the stop/start script complained when adding it to the boot/shutdown cycle, but one posted in the comments worked: [code] #!/bin/bash ### BEGIN INIT INFO # Provides: php-fastcgi # Required-Start: $all # Required-Stop: $all # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: starts the php-fastcgi process # Description: starts php-fastcgi using start-stop-daemon ### END INIT INFO PHP_SCRIPT=/usr/bin/php-fastcgi FASTCGI_USER=www-data RETVAL=0 case “$1” in start) su - $FASTCGI_USER -c $PHP_SCRIPT RETVAL=$? ;; stop) killall -9 php5-cgi RETVAL=$? ;; restart) killall -9 php5-cgi su - $FASTCGI_USER -c $PHP_SCRIPT RETVAL=$? ;; *) echo “Usage: php-fastcgi {start|stop|restart}” exit 1 ;; esac exit $RETVAL [/code]
  3. Next to stop Apache from starting up run: [code]sudo update-rc.d -f apache2 remove[/code]
  4. On the rewrite front, I needed to add the following to my virtual host configuration to have those seo friendly urls up and running again: [code]try_files $uri $uri/ /index.php;[/code]

Comments