【发布时间】:2010-12-28 15:04:33
【问题描述】:
我在我的 Mac 上模拟 Ubuntu,并将其用作服务器。
我已经安装了 lighttpd + Drupal,并且以下配置部分需要一个域名才能使干净的 url 工作。
由于我使用的是本地服务器,所以我没有域名,我想知道如何使它工作,因为本地机器的 ip 通常会发生变化。
谢谢
$HTTP["host"] =~ "(^|\.)mywebsite\.com" {
server.document-root = "/var/www/sites/mywebsite"
server.errorlog = "/var/log/lighttpd/mywebsite/error.log"
server.name = "mywebsite.com"
accesslog.filename = "/var/log/lighttpd/mywebsite/access.log"
include_shell "./drupal-lua-conf.sh mywebsite.com"
url.access-deny += ( "~", ".inc", ".engine", ".install", ".info",
".module", ".sh", "sql", ".theme",
".tpl.php", ".xtmpl", "Entries",
"Repository", "Root" )
# "Fix" for Drupal SA-2006-006, requires lighttpd 1.4.13 or above
# Only serve .php files of the drupal base directory
$HTTP["url"] =~ "^/.*/.*\.php$" {
fastcgi.server = ()
url.access-deny = ("")
}
magnet.attract-physical-path-to = ("/etc/lighttpd/drupal-lua-scripts/p-.lua")
}
【问题讨论】: