www: 0fb254c4: Add an nginx config file and simple shel...

markdoliner at pidgin.im markdoliner at pidgin.im
Tue May 1 02:42:16 EDT 2012


----------------------------------------------------------------------
Revision: 0fb254c433f349aeb9d3d46335c83117d2401c2b
Parent:   ff901b27876686273e95728c17f05d2c2b88485b
Author:   markdoliner at pidgin.im
Date:     05/01/12 02:37:16
Branch:   im.pidgin.www
URL: http://d.pidgin.im/viewmtn/revision/info/0fb254c433f349aeb9d3d46335c83117d2401c2b

Changelog: 

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.

Changes against parent ff901b27876686273e95728c17f05d2c2b88485b

  added    sandbox
  added    sandbox/nginx.conf
  added    sandbox/run
  attr on  sandbox/run
      set  mtn:execute
       to  true

-------------- next part --------------
============================================================
--- /dev/null	
+++ sandbox/nginx.conf	b5fc09949cfba8dee9c8f46c4ca76deea3e7c62f
@@ -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	
+++ sandbox/run	0d3e7fd4cb2c19cabaf21a85bd393c472952f4ab
@@ -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/


More information about the Commits mailing list