Lighttpd: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
| (6 intermediate revisions by the same user not shown) | |||
| Line 7: | Line 7: | ||
== Packages == | == Packages == | ||
{{ | {{Code|emerge lighttpd -pv| | ||
<pre> | <pre> | ||
[ebuild N ] www-servers/lighttpd-1.4. | [ebuild N ] www-servers/lighttpd-1.4.23 USE="bzip2 gdbm ipv6 pcre ssl -doc -fam -fastcgi -ldap -lua -memcache -minimal -mysql -php -rrdtool -test -webdav -xattr" 627 kB | ||
</pre> | </pre> | ||
}} | }} | ||
== Installation == | == Installation == | ||
{{ | {{Root|emerge lighttpd}} | ||
== Configuration == | == Configuration == | ||
{{ | |||
=== Setting up authentification === | |||
{{File|/etc/lighttpd/lighttpd.conf| | |||
<pre> | <pre> | ||
server.modules = ( | server.modules = ( | ||
"mod_auth", | "mod_auth", | ||
) | ) | ||
auth.backend = "plain" | auth.backend = "plain" | ||
| Line 39: | Line 39: | ||
}} | }} | ||
{{ | {{File|/var/www/localhost/lighttpd.user| | ||
<pre> | <pre> | ||
admin:xxxxx | admin:xxxxx | ||
</pre> | </pre> | ||
}} | }} | ||
=== Enabling CGI Support and rrd file processing === | |||
{{File|/etc/lighttpd/lighttpd.conf| | |||
<pre> | |||
server.modules = ( | |||
"mod_alias", | |||
) | |||
# uncomment for cgi support | |||
include "mod_cgi.conf" | |||
</pre> | |||
}} | |||
{{File|/etc/lighttpd/mod_cgi.conf| | |||
<pre> | |||
$HTTP["url"] =~ "^/cgi-bin/" { | |||
# disable directory listings | |||
dir-listing.activate = "enable" | |||
# only allow cgi's in this directory | |||
cgi.assign = ( | |||
".pl" => "/usr/bin/perl", | |||
".cgi" => "/usr/bin/perl", | |||
".rrd" => "/usr/bin/rrdcgi" | |||
) | |||
} | |||
</pre> | |||
}} | |||
{{Root|mkdir -p /var/www/localhost/cgi-bin}} | |||
{{Root|chown -R lighttpd:root /var/www/localhost/cgi-bin}} | |||
== Finalize == | == Finalize == | ||
{{ | {{Root|/etc/init.d/lighttpd start}} | ||
{{ | {{Root|rc-update add lighttpd default}} | ||
Latest revision as of 15:14, 27 July 2011
Description
Lightwight alternative to the allmighty Apache.
Dependencies
USE-Flags
Packages
| Code: emerge lighttpd -pv |
[ebuild N ] www-servers/lighttpd-1.4.23 USE="bzip2 gdbm ipv6 pcre ssl -doc -fam -fastcgi -ldap -lua -memcache -minimal -mysql -php -rrdtool -test -webdav -xattr" 627 kB |
Installation
# emerge lighttpd
Configuration
Setting up authentification
File: /etc/lighttpd/lighttpd.conf
server.modules = (
"mod_auth",
)
auth.backend = "plain"
auth.backend.plain.userfile = "/var/www/localhost/lighttpd.user"
auth.require = ( "/" =>
(
"method" => "basic",
"realm" => "Restricted Area",
"require" => "user=admin"
)
)
File: /var/www/localhost/lighttpd.user
admin:xxxxx
Enabling CGI Support and rrd file processing
File: /etc/lighttpd/lighttpd.conf
server.modules = (
"mod_alias",
)
# uncomment for cgi support
include "mod_cgi.conf"
File: /etc/lighttpd/mod_cgi.conf
$HTTP["url"] =~ "^/cgi-bin/" {
# disable directory listings
dir-listing.activate = "enable"
# only allow cgi's in this directory
cgi.assign = (
".pl" => "/usr/bin/perl",
".cgi" => "/usr/bin/perl",
".rrd" => "/usr/bin/rrdcgi"
)
}
# mkdir -p /var/www/localhost/cgi-bin
# chown -R lighttpd:root /var/www/localhost/cgi-bin
Finalize
# /etc/init.d/lighttpd start
# rc-update add lighttpd default