Beranda | Obengkumana.Net
facebook twitter gplus
Breaking News
Loading...
Minggu, 30 Desember 2012

Multi Virtual Host-Lighttpd

07.09
Packages:
- lighttpd
- lighttpd-mod-simple-vhost
- lighttpd-mod-evhost
(optional)
- php5 and friends
- perl

config "/etc/lighttpd/lighttpd.conf" :
---------------------------------------------------------------------------
server.modules = (
"mod_cgi",
"mod_evhost",
"mod_simple_vhost"
)
server.network-backend = "write"
server.document-root = "/www"
server.errorlog = "/var/log/lighttpd/error.log"
index-file.names = ( "index.html", "default.html", "index.cgi", "index.htm", "index.php", "default.htm" )
mimetype.assign = (
".pdf" => "application/pdf",
".class" => "application/octet-stream",
".pac" => "application/x-ns-proxy-autoconfig",
".swf" => "application/x-shockwave-flash",
".wav" => "audio/x-wav",
".gif" => "image/gif",
".jpg" => "image/jpeg",
".jpeg" => "image/jpeg",
".png" => "image/png",
".svg" => "image/svg+xml",
".css" => "text/css",
".html" => "text/html",
".htm" => "text/html",
".js" => "text/javascript",
".txt" => "text/plain",
".dtd" => "text/xml",
".xml" => "text/xml"
)
$HTTP["url"] =~ "\.pdf$" {
server.range-requests = "disable"
}
static-file.exclude-extensions = ( ".php", ".pl", ".fcgi", ".sh", ".cgi" )
server.port = 80
server.pid-file = "/var/run/lighttpd.pid"
server.upload-dirs = ( "/tmp" )

cgi.assign = ( ".pl" => "/usr/bin/perl", ".cgi" => "/usr/bin/perl",
".php" => "/usr/bin/php-cgi", ".sh" => "/usr/bin/perl", "luci" => "/usr/bin/lua" )

$HTTP["host"] !~ "^(easyhotspot\.obengkumana\.net|modem\.obengkumana\.net|aria\.obengkumana\.net)$" {
simple-vhost.server-root = "/www"
simple-vhost.document-root = "/"
## the default host if no host is sent
simple-vhost.default-host = "obengkumana.net"
}

$HTTP["host"] == "modem.obengkumana.net" {
server.document-root = "/www/modem/"
accesslog.filename = "/var/log/lighttpd/modem.obengkumana.net.access.log"
}

$HTTP["host"] == "easyhotspot.obengkumana.net" {
server.document-root = "/www/easyhotspot"
accesslog.filename = "/var/log/lighttpd/easyhotspot.obengkumana.net.access.log"
}

$HTTP["host"] == "aria.obengkumana.net" {
server.document-root = "/www/aria2"
accesslog.filename = "/var/log/lighttpd/aria.obengkumana.net.access.log"
}
------------------------------------------------------------------------
command :
root@Obengkumana:~# /etc/init.d/uhttpd stop
root@Obengkumana:~# /etc/init.d/uhttpd disable
root@Obengkumana:~# /etc/init.d/lighttpd enable
root@Obengkumana:~# /etc/init.d/lighttpd start

Done....................................


0 komentar:

Posting Komentar

 
Toggle Footer