
Monthly Archives: January 2009
FedEx + Bad Weather == Woot Package Delayed
I just checked the status of my woot shipment and it turns out Fedex has pushed the delivery date to Feburary 3rd. The ice storm down south must have caused the delay, as its not to bad in Buffalo.

Random picture from the rings webcam
I haven’t seen activity in a while, I wonder what they are fixing…

Work being done at the Ring
Woot HD Camcorder
I have been tossing around the idea of getting a HD camcorder to record my races since the summer. The cost of entering the HD realm was a few hundred dollars, and I was iffy about spending the money. Today Chris pointed me at Woot, they had a decent HD camcorder for $129. Even if its not the best camcorder its a great entrance point into my own HD camcorder. Hopefully next week I will post some test video and unboxing pictures.
Ubuntu xcache
If you need to setup xcache for use in your nginx + php5 setup this tutorials will show you how.
Installation
- Update apt:
sudo apt-get update - Install xcache:
sudo apt-get install php5-xcache
Configuration of xcache
- Edit the xcache config file:
sudo vim /etc/php5/conf.d/xcache.iniand update the values for
- xcache.size (set to desired memory size)
- xcache.var_size (set to desired memory size)
- xcache.cacher (set to On)
- xcache.optimizer (set to On)
If you don’t want admin access then set
xcache.admin.auth = Off
Finishing Up
- Now that the configuration is complete we need to restart php:
sudo /etc/init.d/init-fastcgi stop
sudo /etc/init.d/init-fastcgi start - Enjoy your xcached php goodness…
Great Zed Shaw Talk
I stumbled across a talk by Zed Shaw at a conference that I thought I would share. After watching the talk I agree with a large percentage of what he has to say. Actually I can’t think of anything I didn’t agree with, and his discussion about corp coding and home coding was spot on. That is a topic that I need to work on…
Ubuntu Nginx and PHP5
This post will go over the steps you need to get nginx running with php5. I am going to use a list to show the steps to take, please leave a comment if you see something that needs to be corrected or just want to leave feedback.
Installation
- Update apt:
sudo apt-get update
- Install nginx:
sudo apt-get install nginx
- Install php-cgi for use with mysql:
sudo apt-get install php5-cgi php5-mysql
- We need a binary that comes with lighttpd to launch the php5 cgi:
sudo apt-get install lighttpd
- Now remove lighttpd from startup since we will be using nginx:
sudo update-rc.d -f lighttpd remove
Configuration of nginx,startup scripts,fastcgi
- Create a bash script that will spawn the php fcgi handlers:
sudo vim /usr/bin/php-fastcgi
- and enter the following:
#!/bin/bash
/usr/bin/spawn-fcgi -a 127.0.0.1 -p 10005 -u www-data -g www-data -f /usr/bin/php-cgiMake sure to set www-data to the user and group that you want php running as.
- Make the script executable:
sudo chmod +x /usr/bin/php-fastcgi
- Now lets at create an init script that will execute the above script on boot (this script is from a blog that I can’t remember the name of):
sudo vim /etc/init.d/init-fastcgiand enter the following
#!/bin/bash
PHP_SCRIPT=/usr/bin/php-fastcgi
RETVAL=0
case "$1" in
start)
$PHP_SCRIPT
RETVAL=$?
;;
stop)
killall -9 php-cgi
RETVAL=$?
;;
restart)
killall -9 php-cgi
$PHP_SCRIPT
RETVAL=$?
;;
*)
echo "Usage: php-fastcgi {start|stop|restart}"
exit 1
;;
esac
exit $RETVAL
- Make the script executable:
sudo chmod +x /etc/init.d/init-fastcgi
- Add the script to run at bootup:
sudo update-rc.d init-fastcgi defaults
- Now we will begin configuring nginx to proxy php request. First we need to setup a include file that will hold some fastcgi_param’s.
sudo vim /etc/nginx/fastcgi.confand enter
#fastcgi.conf
fastcgi_param GATEWAY_INTERFACE CGI/1.1;
fastcgi_param SERVER_SOFTWARE nginx;
fastcgi_param QUERY_STRING $query_string;
fastcgi_param REQUEST_METHOD $request_method;
fastcgi_param CONTENT_TYPE $content_type;
fastcgi_param CONTENT_LENGTH $content_length;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;#To use Nginx + Virtual Host + PHP you should ommit the SCRIPT_NAME
#variable in order for PHP to choose the correct DOCUMENT_ROOT
#fastcgi_param SCRIPT_NAME $fastcgi_script_name;fastcgi_param REQUEST_URI $request_uri;
fastcgi_param DOCUMENT_URI $document_uri;
fastcgi_param DOCUMENT_ROOT $document_root;
fastcgi_param SERVER_PROTOCOL $server_protocol;
fastcgi_param REMOTE_ADDR $remote_addr;
fastcgi_param REMOTE_PORT $remote_port;
fastcgi_param SERVER_ADDR $server_addr;
fastcgi_param SERVER_PORT $server_port;
fastcgi_param SERVER_NAME $server_name;
# PHP only, required if PHP was built with --enable-force-cgi-redirect
#fastcgi_param REDIRECT_STATUS 200; - Edit the server conf and tell it where to proxy requests to:
sudo vim /etc/nginx/sites-enabled/default
- In the server section add the following:
location ~ .*\.php$ {
include /etc/nginx/fastcgi.conf;
fastcgi_pass 127.0.0.1:10005;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME /home/xxx/public_html/domian/public/$fastcgi_script_name;
}
*Update SCRIPT_FILENAME to point to your doc root* - Update index list to enable index.php: *Thanks Brian*
index index.html index.htm index.php;
- Restart nginx and start the php cgi handlers:
sudo /etc/init.d/nginx restart
sudo /etc/init.d/init-fastcgi start
