diff --git a/Lighttpd.md b/Lighttpd.md index fb35f80..b59ed3d 100644 --- a/Lighttpd.md +++ b/Lighttpd.md @@ -13,6 +13,8 @@ To install, just do ## Config +### FastCGI Setup + To use lighttpd with php-fpm, we'll need to modify `/etc/lighttpd/mod_fastcgi.conf` to look like so: @@ -26,6 +28,27 @@ to look like so: ) ) - - +### Sites To make adding/editing websites easier, I recommend creating a `/etc/lighttpd/sites.conf` file, and including it in the `/etc/lighttpd/lighttpd.conf` file. + +Each site can look something like this (this example has a rewrite for Codeigniter): + + $HTTP["host"] =~ "^timshomepage\.net" { + server.document-root = "timshomepage.net/web" + url.rewrite-if-not-file = ( + "^/(.*)$" => "/index.php/$1" + ) + } + +To proxy a site to a different port you'd have something like this: + + $HTTP["host"] =~"(^|\.)nodejs\.timshomepage.net$" { + proxy.server = ( "" => + ( + ( + "host" => "127.0.0.1", + "port" => "8124" + ) + ) + ) + } \ No newline at end of file diff --git a/PHP.md b/PHP.md index 0a63d9b..c5ecd14 100644 --- a/PHP.md +++ b/PHP.md @@ -6,7 +6,8 @@ In order for PHP to be most useful, it should have as many of the modules instal Here are some recommended flags: `mysql utf8 threads -readline libssh2 -cgi fpm xcache suhosin postgres -mysqlnd reflection session simplexml sockets spl pdo mbstring sqlite3 mysqli soap exif` +mysqlnd reflection session simplexml sockets spl pdo mbstring sqlite3 +mysqli soap exif` ## PHP_TARGETS @@ -16,4 +17,35 @@ As of the time this is written, php 5.3 is the latest version, so I would add th `PHP_TARGETS="php5-3"` +Please note that you can have multiple PHP_TARGETS: + +`PHP_TARGETS="php5-3 php5-4"` + As of this writing, PHP compiles with clang reliably. + +## php.ini and php-fpm.conf + +### php.ini + +This file is going to be under `/etc/php/[sapi]-php[version]/php.ini` + +So, if I'm running php 5.3, and I want to adjust cli settings, the file is `/etc/php/cli-php5.3/php.ini` + +#### Mandatory settings + +* `date.timezone` - set to your default timezone, for example, `America/Detroit` + +#### Recommended settings +* `short_open_tag = On` - Allow short tags `