Instalar Lighthttp
# apt-get install lighttpd
Reiniciar Lighthttp
# apt-get install lighttpd
Instalar PHP
# apt-get install php5-cgi
Habilitar fastcgi
# lighty-enable-mod fastcgi
# lighty-enable-mod fastcgi-php
Reiniciar Lighthttp
# service lighttpd force-reload
Editar fichero de configuración y completar con los datos en negrita:
$ /etc/lighttpd/lighttpd.conf
server.modules = (
"mod_access",
"mod_alias",
"mod_compress",
"mod_redirect",
# "mod_rewrite",
"mod_auth",
)
server.document-root = "/var/www/html"
server.upload-dirs = ( "/var/cache/lighttpd/uploads" )
server.errorlog = "/var/log/lighttpd/error.log"
server.pid-file = "/var/run/lighttpd.pid"
server.username = "www-data"
server.groupname = "www-data"
server.port = 80
auth.debug = 2
auth.backend = "plain"
auth.backend.plain.userfile="/home/pi/.lighttpdpassword"
auth.require = ( "" =>
(
"method" => "basic",
"realm" => "Password protected area",
"require" => "user=admin"
)
)
index-file.names = ( "index.php", "index.html", "index.lighttpd.html" )
url.access-deny = ( "~", ".inc" )
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi" )
Crear fichero con usuario y contraseña en la ruta indicada en auth.backend.plain.userfile y darle los permisos necesarios:
# echo "admin:admin" > /home/pi/.lighttpdpassword
# chown www-data:www-data .lighttpdpassword
Reiniciar Lighthttp
# service lighttpd force-reload
Comentarios