i need to update an subdomain in my dns and lighhtpd conf i tried the dns as

 example.test.org IN A (my ip address)

in my dns and my lighttpd conf goes here

$HTTP["host"]  == "example.test.org"{
        server.document-root = "/var/www/example"
        accesslog.filename         = "/var/www/example/access.log"

i am not redirected says server not found can any one help me .////

  • What is the result of an nslookup on the host? Maybe you have old entries in your DNS cache? – Ben Quick Sep 9 '10 at 8:01

You might also want to have a look on mod_simple_vhost. Here's the debian configuration example:

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"

This would allow you to create any directory in /srv/www in form of "test.yourdomain.com", to activate this subdomain. Make sure you add the htdocs directory inside the directory.

But I guess you should check the DNS propagation at first, like Ben Quick mentioned.


| improve this answer | |

What's the result of "dig example.test.org"? Is the IP right? In any case, until you get a proper responde there, you won't have anything working under that subdomain.

| improve this answer | |

Replace the first line to: $HTTP["host"] =~ "example\.test\.org$"{ Maybe that works.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy