
我需要更新我的 dns 和 lighthtpd conf 中的子網域,我嘗試將 dns 作為
example.test.org IN A (my ip address)
在我的 dns 中,我的 lighttpd conf 位於此處
$HTTP["host"] == "example.test.org"{
server.document-root = "/var/www/example"
accesslog.filename = "/var/www/example/access.log"
}
我沒有重定向,說找不到伺服器任何人都可以幫助我.////
答案1
您可能還想查看 mod_simple_vhost。這是 debian 配置範例:
root@yourdomain:/etc/lighttpd# cat conf-enabled/10-simple-vhost.conf
## Simple name-based virtual hosting
##
## Documentation: /usr/share/doc/lighttpd-doc/simple-vhost.txt
## http://www.lighttpd.net/documentation/simple-vhost.html
server.modules += ( "mod_simple_vhost" )
## The document root of a virtual host isdocument-root =
## simple-vhost.server-root + $HTTP["host"] + simple-vhost.document-root
simple-vhost.server-root = "/srv/www/"
simple-vhost.document-root = "/htdocs/"
## the default host if no host is sent
simple-vhost.default-host = "yourdomain.com"
這將允許您以「test.yourdomain.com」的形式在 /srv/www 中建立任何目錄,以啟動該子網域。確保在該目錄中新增 htdocs 目錄。
但我想你應該先檢查 DNS 傳播,例如本·奎克提及。
問候
答案2
“dig example.test.org”的結果是什麼? IP對嗎?無論如何,除非您在那裡得到適當的回應,否則您將無法在該子網域下進行任何操作。
答案3
將第一行替換為:$HTTP["host"] =~ "example\.test\.org$"{
也許可行。