1

I have 2 php fpm services in my server, one is php 5.6 in port 9001, and the other is php 7.2 in port 9072.

I have a website that is running on PHP 5.6, working using the following config:

fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9001",
                "broken-scriptfilename" => "enable"
        ))
)

I want a subdomain to work with php 72, currently it configured like that:

###### Subdomain settings ##############
$HTTP["host"]  == "dev.mydomain.net"{
        server.document-root = "/var/www/lighttpd/dev"
}

but when I add:

server.port = "9072"

my lighttpd service fail to start after restart.

Any idea what could have gone wrong? My logs say nothing about it.

2020-04-15 10:31:23: (server.c.1521) server started (lighttpd/1.4.54) 
2020-04-15 10:31:23: (server.c.1550) WARNING: unknown config-key: alias.url (ignored) 
1

You can configure lighttpd to run multiple fastcgi servers and to send traffic to one or the other based on conditions.

fastcgi.server += ( ".php" =>
        ((
                "host" => "127.0.0.1",
                "port" => "9001",
                "broken-scriptfilename" => "enable"
        ))
)

$HTTP["host"]  == "dev.mydomain.net"{
        server.document-root = "/var/www/lighttpd/dev"
        fastcgi.server += ( ".php" =>
                ((
                        "host" => "127.0.0.1",
                        "port" => "9072",
                        "broken-scriptfilename" => "enable"
                ))
        )
}
| improve this answer | |
  • Not sure why but this is not working either. Web server stay down without any log – TheUnreal Apr 16 at 15:47
  • @TheUnreal please triple check what you are doing. Then check again. If lighttpd doesn't start, it produces trace why it doesn't start. (authoritative source: I am a lighttpd developer). You need to find the log. You can manually run lighttpd -tt -f /etc/lighttpd/lighttpd.conf to run the config in pre-flight test mode. Run that as the same user that starts lighttpd and look at the output. If you still have server.port = "9072" then remove that from your config. It's broken syntax and lighttpd will complain. – gstrauss Apr 17 at 9:22

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.