pidgin/old.pidgin.im

Parents 512a54c72888
Children eaf1fdb12737
Add an nginx config file and simple shell script to run a local
instance of nginx that is sufficient for testing the web site.

Seems to work pretty well to me. Feel free to improve upon it,
write better usage instructions, maybe add a script and config
file for other web servers, etc.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sandbox/nginx.conf Tue May 01 06:37:16 2012 +0000
@@ -0,0 +1,38 @@
+daemon off;
+error_log error.log;
+pid pid;
+
+events {
+ worker_connections 100;
+}
+
+http {
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ access_log access.log;
+
+ client_body_temp_path /tmp;
+ proxy_temp_path /tmp;
+ fastcgi_temp_path /tmp;
+
+ server {
+ listen 8080;
+
+ # I couldn't find a way to use a relative document root here and
+ # have it work with php. Instead, the "run" script writes the
+ # absolute doc root to a conf file and we include it here. If you
+ # can find a way to make the relative doc root, please get rid of
+ # this, because it's a little ugly. --Mark Doliner, 2012-04-28
+ include nginx_docroot.conf;
+
+ # Enable php
+ index index.php index.html;
+ location ~ \.php$ {
+ # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini?
+ include /etc/nginx/fastcgi_params;
+ fastcgi_intercept_errors on;
+ fastcgi_pass 127.0.0.1:9000;
+ }
+ }
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sandbox/run Tue May 01 06:37:16 2012 +0000
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+#
+# This script runs a local web server sandbox that serves the Pidgin web
+# site, so you can test your changes before committing them.
+#
+# The current version of this script uses nginx. pidgin.im is actually
+# served using lighttpd... but that shouldn't matter.
+#
+
+# Directions for using this on Ubuntu:
+# Note: These directions aren't very good. Feel free to correct/improve.
+# apt-get install nginx-light php5-common php5-fpm
+# TODO: disable nginx from starting at boot
+# /sbin/chkconfig nginx off?
+# insserv --remove nginx
+# /etc/init.d/nginx stop
+# /etc/init.d/php5-fpm start?
+# TODO: Configure php5-fpm to start at boot?
+
+MYDIR="$( cd "$( dirname "$0" )" && pwd )"
+
+# Write the absolute path of the document root to a file. See the note
+# about this file in nginx.conf for more information.
+echo "root "`readlink -f $MYDIR/../htdocs/`";" > $MYDIR/nginx_docroot.conf
+
+/usr/sbin/nginx -c $MYDIR/nginx.conf -p $MYDIR/