Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Hi I have lighttpd running on my local machine (somebody else set it up) and it is working on well on a specific project. I am trying to set it up for a new project myself from what I can work out/docs I have read. I have done the following but am getting server not found error when accessing dev.{project-name}.com. What have I done wrong/haven't done:

cd /etc/lighttpd/conf-available

sudo touch 01-{project-name}.conf

sudo vi 01-{project-name}.conf

$HTTP["host"] == "dev.{project-name}.com" {
    server.document-root = "/path/to/project/{project-name}/public_html"
    magnet.attract-physical-path-to = ( server.document-root + "/rewrite.lua" )

cd ../conf-enabled

sudo ln -s ../conf-available/01-{project-name}.conf 01-{project-name}.conf

sudo /etc/init.d/lighttpd restart

cd {parent-directory}/{project-name}/public_html

touch rewrite.lua

vi rewrite.lua

attr = lighty.stat(lighty.env["physical.path"])
if (not attr) then
    lighty.env["uri.path"] = "/index.php"
    lighty.env["physical.rel-path"] = lighty.env["uri.path"]
    lighty.env["physical.path"] = lighty.env["physical.doc-root"] .. lighty.env["physical.rel-path"]
share|improve this question
Does the DNS name resolve to the correct IP? –  Shane Madden Jan 29 '12 at 21:47
Sorry I'm not really sure what that means/how to find out? –  user71736 Jan 29 '12 at 21:57
sudo vi /etc/hosts then dev.{project-name}.com –  user71736 Jan 29 '12 at 22:52
add comment

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.