Tiny Core Linux
Tiny Core Extensions => TCE Q&A Forum => Topic started by: blu on February 01, 2010, 07:26:37 AM
-
I've installed lighttpd and php5 and modified the lighthttpd.conf to
server.document-root = "/htdocs"
server.port = 80
server.username = "tc"
server.groupname = "nogroup"
server.chroot = "/www"
server.modules = (
"mod_access",
"mod_accesslog",
"mod_fastcgi",
"mod_rewrite",
"mod_auth"
)
fastcgi.server = (
".php" =>
(( "host" => "127.0.0.1",
"port" => 1026,
"bin-path" => "/usr/local/bin/php-cgi"
)))
When I run lighttpd I get 2010-02-01 14:20:35: (log.c.172) server started
2010-02-01 14:20:35: (mod_fastcgi.c.1087) the fastcgi-backend /usr/local/bin/php-cgi failed to start:
2010-02-01 14:20:35: (mod_fastcgi.c.1091) child exited with status 2 /usr/local/bin/php-cgi
2010-02-01 14:20:35: (mod_fastcgi.c.1094) If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
If this is PHP on Gentoo, add 'fastcgi' to the USE flags.
2010-02-01 14:20:35: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2010-02-01 14:20:35: (server.c.928) Configuration of plugins failed. Going down.
If i change the lighttpd.conf to fastcgi.server = (
".php" =>
(( "bin-path" => "/usr/local/bin/php-cgi",
"socket" => "/tmp/php.socket"
)))
I get 2010-02-01 14:24:58: (log.c.172) server started
2010-02-01 14:24:58: (mod_fastcgi.c.960) bind failed for: unix:/tmp/php.socket-0 No such file or directory
2010-02-01 14:24:58: (mod_fastcgi.c.1398) [ERROR]: spawning fcgi failed.
2010-02-01 14:24:58: (server.c.928) Configuration of plugins failed. Going down.
Any help is appreciated. Thanks.
-
Maybe support was not built in:
If you're trying to run your app as a FastCGI backend, make sure you're using the FastCGI-enabled version.
-
FCGI is enabled, I use it everyday. The http/php server needs to be started as root (or sudo) since the user doesn't have access to the socket device.
-
are you using lighttpd or apache2?
can you post some lines from lighttpd.conf? How do you start the server? I mean what do you type on terminal.
Thanks.
-
Here is a config file for lighttpd that works:
server.modules = (
"mod_rewrite",
"mod_redirect",
"mod_alias",
"mod_access",
"mod_auth",
"mod_setenv",
"mod_fastcgi",
"mod_cgi",
"mod_accesslog" )
server.document-root = "/home/htdocs/"
server.errorlog = "/dev/null"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
mimetype.assign = (
".pdf" => "application/pdf",
".sig" => "application/pgp-signature",
".spl" => "application/futuresplash",
".class" => "application/octet-stream",
".ps" => "application/postscript",
".torrent" => "application/x-bittorrent",
".dvi" => "application/x-dvi",
".gz" => "application/x-gzip",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".tar.gz" => "application/x-tgz",
".tgz" => "application/x-tgz",
".tar" => "application/x-tar",
".zip" => "application/zip",
".mp3" => "audio/mpeg",
".m3u" => "audio/x-mpegurl",
".wma" => "audio/x-ms-wma",
".wax" => "audio/x-ms-wax",
".ogg" => "application/ogg",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jar" => "application/x-java-archive",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".xbm" => "image/x-xbitmap",
".xpm" => "image/x-xpixmap",
".xwd" => "image/x-xwindowdump",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".asc" => "text/plain",
".c" => "text/plain",
".cpp" => "text/plain",
".log" => "text/plain",
".conf" => "text/plain",
".text" => "text/plain",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml",
".mpeg" => "video/mpeg",
".mpg" => "video/mpeg",
".mov" => "video/quicktime",
".qt" => "video/quicktime",
".avi" => "video/x-msvideo",
".asf" => "video/x-ms-asf",
".asx" => "video/x-ms-asf",
".wmv" => "video/x-ms-wmv",
".bz2" => "application/x-bzip",
".tbz" => "application/x-bzip-compressed-tar",
".tar.bz2" => "application/x-bzip-compressed-tar",
"" => "application/octet-stream",
)
$SERVER["socket"] == ":80" {
fastcgi.server = ( ".php" => ((
"bin-path" => "/usr/local/bin/php-cgi",
"socket" => "/tmp/php.socket"
))
)
fastcgi.map-extensions = ( ".html" => ".php" )
}
accesslog.filename = "/dev/null"
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
I use the command `sudo lighttpd -f /path/to/config/file`
-
Why map html to php? If I understand that correctly, it increases server load by having PHP process things it does nothing to.
-
this config file is for a server that only uses html files with php, so it is easier to have everything be handled by the php server since everything needs to anyway.
This config file is just a sample to change and/or build upon.
-
It works! Thank you very much. I think I'm going to try this on a 486 :).