
Witam was 😉
Pokaże wam jak uruchomić CMS’a Drupal 6 i 7 na serwerze WWW lighttpd/1.4.35
W zasadzie nic trudnego więc do rzeczy:
1. Potrzebny pakiet do obsługi plików lua
apt-get install lighttpd-mod-magnet lighty-enable-mod magnet /etc/init.d/lighttpd force-reload
2. Konfiguracja lighttpd
echo 'include "/etc/lighttpd/v-drupal.conf"' >> /etc/lighttpd/lighttpd.conf
3. V-Host z Konkretną konfiguracją: (ja nazwałem v-drupal.conf i umieściłem go w /etc/lighttpd/v-drupal.conf )
$HTTP["host"] =~ "www.site.pl" {
url.redirect = ( "^/(.*)" => "http://%1" )
}
$HTTP["host"] =~ "site.pl" {
server.document-root = "/home/www/public_html/"
accesslog.filename = "/var/log/access.log"
index-file.names = ( "index.php" )
magnet.attract-physical-path-to = ( "/etc/lighttpd/drupal.lua" )
dir-listing.activate = "disable"
status.status-url = "/server-status"
server.error-handler-404 = "/index.php"
server.error-handler-403 = "/index.php"
url.access-deny = ( "~", ".inc", ".engine", ".install", ".module", ".sh", "sql", ".theme", ".tpl.php", ".xtmpl", "Entries", "Repository", "Root" )
url.rewrite-if-not-file = ( "^/(.*)$" => "/index.php?q=$1" )
## Drupal rules
url.rewrite-final = (
"^/system/test/(.*)$" => "/index.php?q=system/test/$1",
"^/([^.?]*)\?(.*)$" => "/index.php?q=$1&$2",
"^/([^.?]*)$" => "/index.php?q=$1",
"^/search/node/(.*)$" => "/index.php?q=search/node/$1",
"^/rss.xml" => "/index.php?q=rss.xml",
"^/([^.?]*\.html)$" => "/index.php?q=$1",
"^/([^.?]*\.htm)$" => "/index.php?q=$1"
)
}
Pobierz gotowca 😉 : (pamiętaj o edycji adresu WWW oraz katalogu z witryną)
wget http://pliki.linuxarz.pl/10-2015/v-drupal.conf -O /etc/lighttpd/v-drupal.conf
4. I teraz plik lua:
wget http://pliki.linuxarz.pl/10-2015/drupal.lua -O /etc/lighttpd/drupal.lua
4. Pamiętaj na końcu zrestartować serwer lighttpd i pamiętaj włączyć moduł “mod_rewrite” w pliku /etc/lighttpd/lighttpd.conf
/etc/init.d/lighttpd force-reload
Testowane na Drupalu 6 🙂 – bardzo fajne to działa z Varnishem.
Polecam – jako alternatywę dla plików .htaccess w ociężałym Apache/2
