Difference between revisions of "Lighttpd with mysql and php (LLMP)"
From NAS-Central Buffalo - The Linkstation Wiki
(Draft) |
(→Setup vhost for 2 urls in lighttpd.conf) |
||
(11 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Articles|Debian|Mediaserver}} | |
+ | = Lighttpd with php and mysql (LLMP)= | ||
+ | |||
+ | LLMP instead of LAMP ([[Apache w/ PHP and MySQL Support (MIPSel)]], [[Apache HTTP server, installing]]) | ||
apt-get install lighttpd php5-dev php5-cgi php5-sqlite php5-mysql mysql-client mysql-server | apt-get install lighttpd php5-dev php5-cgi php5-sqlite php5-mysql mysql-client mysql-server | ||
+ | |||
+ | ==Configure lighttpd to use PHP5-cgi == | ||
+ | |||
+ | pico /etc/lighttpd/conf-available/10-fastcgi.conf | ||
+ | change | ||
+ | "bin-path" => "/usr/bin/<font color=red><strike>php4-cgi</strike></font>", | ||
+ | to | ||
+ | "bin-path" => "/usr/bin/php5-cgi", | ||
== Enable cgi and fast-cgi for php usage == | == Enable cgi and fast-cgi for php usage == | ||
+ | |||
+ | cd /etc/lighttpd/conf-enabled | ||
+ | ln -s ../conf-available/10-cgi.conf 10-cgi.conf | ||
+ | ln -s ../conf-available/10-fastcgi.conf 10-fastcgi.conf | ||
== Setup vhost for 2 urls in lighttpd.conf == | == Setup vhost for 2 urls in lighttpd.conf == | ||
+ | |||
+ | Default location: | ||
+ | server.document-root "/media/www/" | ||
+ | |||
+ | Add this too: | ||
+ | $HTTP["host"] =~ "(^|\.)myhost1\.homelinux\.com$" { | ||
+ | server.document-root = "/media/www/myhost1" | ||
+ | server.errorlog = "/var/log/lighttpd/myhost1/error.log" | ||
+ | } | ||
+ | |||
+ | $HTTP["host"] =~ "(^|\.)myhost2\.hello\.com$" { | ||
+ | server.document-root = "/media/www/myhost2" | ||
+ | server.errorlog = "/var/log/lighttpd/myhost2/error.log" | ||
+ | } | ||
+ | |||
+ | The server sends blank sites unless I add server.network-backend = "writev" in the lighttpd.conf. | ||
== Enable url mod_rewrite in lighttpd.conf == | == Enable url mod_rewrite in lighttpd.conf == |
Latest revision as of 11:57, 27 February 2007
Contents
Lighttpd with php and mysql (LLMP)
LLMP instead of LAMP (Apache w/ PHP and MySQL Support (MIPSel), Apache HTTP server, installing)
apt-get install lighttpd php5-dev php5-cgi php5-sqlite php5-mysql mysql-client mysql-server
Configure lighttpd to use PHP5-cgi
pico /etc/lighttpd/conf-available/10-fastcgi.conf
change
"bin-path" => "/usr/bin/php4-cgi",
to
"bin-path" => "/usr/bin/php5-cgi",
Enable cgi and fast-cgi for php usage
cd /etc/lighttpd/conf-enabled ln -s ../conf-available/10-cgi.conf 10-cgi.conf ln -s ../conf-available/10-fastcgi.conf 10-fastcgi.conf
Setup vhost for 2 urls in lighttpd.conf
Default location:
server.document-root "/media/www/"
Add this too:
$HTTP["host"] =~ "(^|\.)myhost1\.homelinux\.com$" { server.document-root = "/media/www/myhost1" server.errorlog = "/var/log/lighttpd/myhost1/error.log" }
$HTTP["host"] =~ "(^|\.)myhost2\.hello\.com$" { server.document-root = "/media/www/myhost2" server.errorlog = "/var/log/lighttpd/myhost2/error.log" }
The server sends blank sites unless I add server.network-backend = "writev" in the lighttpd.conf.
Enable url mod_rewrite in lighttpd.conf
Php
Plug and play ! Nothing to do !
Mysql
mysqladmin -u root password 'mypass'