You can follow this wiki to install lighttpd (
skip the section regarding
Ruby on Rails related)
https://wiki.archlinux.org/index.php/Fastcgi_and_lighttpdor this one (
skip the section regarding
SSL and
eAcceleration)
https://wiki.archlinux.org/index.php/Lighttpd_For_Both_SSL_And_Non-SSLthen edit a new
/etc/lighttpd/lighttpd.conf and insert the following lines:
$this->bbcode_second_pass_code('', '
# lighttpd configuration file
#
# use it as a base for lighttpd 1.0.0 and above
############ Options you really have to take care of ####################
## modules to load
server.modules = (
"mod_access",
"mod_fastcgi",
"mod_simple_vhost",
"mod_compress")
server.document-root = "/srv/http"
server.errorlog = "/var/log/lighttpd/error.log"
index-file.names = ( "index.php", "index.html",
"index.htm", "default.htm" )
# mimetype mapping
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",
# default mime type
"" => "application/octet-stream",
)
accesslog.filename = "/var/log/lighttpd/access.log"
url.access-deny = ( "~", ".inc" )
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
## bind to port (default: 80)
server.port = 80
server.pid-file = "/var/run/lighttpd/lighttpd.pid"
dir-listing.activate = "enable"
dir-listing.encoding = "utf-8"
server.username = "http"
server.groupname = "http"
compress.cache-dir = "/var/cache/lighttpd/compress/"
compress.filetype = ("text/plain", "text/html")
#### fastcgi module
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/var/run/lighttpd/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
server.follow-symlink="enable"
')
Then write a file called: "phpinfo.php" in "/srv/http", insert the following statements:
$this->bbcode_second_pass_code('', '
<?php
define('TESTING', 1);
phpinfo();
?>
')
Then modify the
doc_root of the file /etc/php/php.ini:
$this->bbcode_second_pass_code('', '
doc_root = /srv/http
')
then open your browser:
http://<plugbox_internal_ip>/phpinfo.phpIf display a page with a lot of informations you have php installed, if not your version of php doesn't work with lighttpd, install this version:
$this->bbcode_second_pass_code('', '
pacman -Uf http://myplugbox.com/php/php-5.3.3-4-arm.pkg.tar.xz
')
I hope this can help.
P.S.
To simplify the management of your server you can install
Webmin, see this wiki for the installation:
https://wiki.archlinux.org/index.php/Webmin