Hi,
no problem. I first wrote this for Shindig. If the format is ok, i
will write one for Partuza, too:
=== BEGIN ===
Installing and Running The PHP Shindig Gadget Server
(with lighttpd)
============================================
Prequisites before building Shindig for PHP
============================================
In order to build and run Shindig for PHP, you must have the following:
- A Subversion client installed in order to checkout the code.
Instructions for downloading and installing Subversion can be found
here:
http://subversion.tigris.org/
- lighttpd with mod_rewrite enabled.
- PHP 5.2.x(cgi/fastcgi) with the json, simplexml, mcrypt and curl
extentions enabled.
Getting the code
============================================
Create a directory, e.g. /var/www/html/shindig and checkout the Shindig
code from its Subversion repository
mkdir /var/www/html/shindig
cd /var/www/html/shindig
svn co http://svn.apache.org/repos/asf/incubator/shindig/trunk/ .
Running Shindig
============================================
To run the code, you have several options:
a. Create a new virtual host (recommended)
Shindig relies on all requests being redirected to the index.php
script. In order to do that with lighttpd you need to use the
"url.rewrite-once" directive in the configuration files.
Point your lighttpd at the code by adding this to your lighttpd.conf:
$HTTP["host"] == "shindig" {
... other normal settings for virtual hosts...
server.document-root = "$YOURPATHHERE/shindig/php/"
server.name = "shindig"
url.rewrite-once = (
"^[^?]*(\??)(.*)$" => "index.php$1$2"
)
}
(Replace "shindig" and "$YOURPATHHERE" as required)
Restart lighttpd and make sure that you can resolve the new sub-host
(e.g. by adding it to your local hosts file).
Point your browser at:
http://shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
(replace shindig with the name of your virtual host)
you should see something like this:
http://shindig.chabotc.com/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
b. Run with an existing host
If you cannot/don't want to create a virtual host, check out the Shindig
code into a subdirectory of your document root and add this to your
lighttpd
configuration file:
url.rewrite-once = (
"^shindig/[^?]*(\??)(.*)$" => "shindig/php/index.php$1$2"
)
Restart lighttpd to apply the changes. You also need to edit the file
php/config.php and change the web_prefix setting to '/shindig'.
Point your browser at:
http://localhost/shindig/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
(replace localhost with the name of your host)
you should see something like this:
http://shindig.chabotc.com/gadgets/ifr?url=http://www.labpixies.com/campaigns/todo/todo.xml
====END===
Best Regards
Karsten Beyer
[EMAIL PROTECTED]
Am 04.06.2008 um 19:09 schrieb Chris Chabot:
Hey Karsten, thats some great info to have thanks!
I don't suppose you could write this up in a README style format
(with a bit of text explaining the steps required to make this work
with lighttpd), so i can add that to a README.lighttpd file?
Thanks in advance!
-- Chris
On Jun 4, 2008, at 1:28 PM, Karsten Beyer wrote:
Hi,
while trying to run Shindig and Partuza with the lighttpd server, i
ran into
some problems with the configuration,
As others may want to use a similar setup, i decided to share my
solution
with this list.
Here is the interesting part of the config file:
===============<==============<=====================
$HTTP["host"] == "shindig" {
cgi.assign = (
".php" => "/opt/local/bin/php-cgi"
)
server.document-root = "$YOURPATHHERE/shindig/php/"
server.name = "shindig"
url.rewrite-once = (
"^[^?]*(\??)(.*)$" => "index.php$1$2"
)
}
$HTTP["host"] == "partuza" {
cgi.assign = (
".php" => "/opt/local/bin/php-cgi"
)
server.document-root = "$YOURPATHHERE/partuza/html"
server.name = "partuza"
url.rewrite-once = (
"^\/(css|images|js|gadgets)(.*)$" => "$0",
"^[^?]*(\??)(.*)$" => "index.php$1$2"
)
}
================<================<=========================
Some annotation about this solution, as some of this may one day
apply to
Apache also.
There are some differences between Apache and lighttpd handling the
rewrite
rules. The first one is that when Apache rewrites a URL the $_GET
array
contains all original parameters even if they are no longer part of
the
request. Lighttpd only puts parameters into the $_GET which are
part of the
final request. I solved this (i hope) by simply appending the
parameters to
the index.php request.
The second one is that it is not possible(AFAIK) to make rules
depending on
the file type. Therefore for partuza all files which should be served
directly have to be put into the redirection rule.
Obviously if you have a different path to the php cgi or are using
fastcgi
you have to change that, too.
Best Regards
Karsten Beyer
[EMAIL PROTECTED]