lighttpd의 하위 도메인

lighttpd의 하위 도메인

내 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를 살펴볼 수도 있습니다. 데비안 구성 예는 다음과 같습니다.

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"

이렇게 하면 /srv/www에 "test.yourdomain.com" 형식으로 디렉터리를 생성하여 이 하위 도메인을 활성화할 수 있습니다. 디렉토리 내에 htdocs 디렉토리를 추가했는지 확인하십시오.

하지만 먼저 DNS 전파를 확인해야 할 것 같습니다.벤 퀵말하는.

문안 인사

답변2

"dig example.test.org"의 결과는 무엇입니까? IP 맞나요? 어쨌든 적절한 응답을 받을 때까지 해당 하위 도메인에서는 아무 것도 작동하지 않습니다.

답변3

첫 번째 줄을 다음으로 바꿉니다. $HTTP["host"] =~ "example\.test\.org$"{아마도 작동할 것입니다.

관련 정보