More lighttpd and PHP info
This commit is contained in:
parent
8dd7f77903
commit
683cb42444
27
Lighttpd.md
27
Lighttpd.md
@ -13,6 +13,8 @@ To install, just do
|
|||||||
|
|
||||||
## Config
|
## Config
|
||||||
|
|
||||||
|
### FastCGI Setup
|
||||||
|
|
||||||
To use lighttpd with php-fpm, we'll need to modify `/etc/lighttpd/mod_fastcgi.conf`
|
To use lighttpd with php-fpm, we'll need to modify `/etc/lighttpd/mod_fastcgi.conf`
|
||||||
to look like so:
|
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.
|
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"
|
||||||
|
)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
}
|
34
PHP.md
34
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:
|
Here are some recommended flags:
|
||||||
`mysql utf8 threads -readline libssh2 -cgi fpm xcache suhosin postgres
|
`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
|
## 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"`
|
`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.
|
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 `<? and <?=`
|
||||||
|
* `expose_php = Off` - With this enabled, a pointless server header is sent out, and some magic urls are enabled. There's no reason to enable this.
|
||||||
|
|
||||||
|
### php-fpm.conf
|
||||||
|
|
||||||
|
When compiling PHP with FPM, there is another config file, `php-fpm.conf`.
|
||||||
|
|
||||||
|
When starting php, it will through an annoying message if you don't have the
|
||||||
|
`pm.start_servers` setting configured.
|
||||||
|
|
||||||
|
A good default is to set `pm.start_servers = 20`
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user