Virtual host is not working
Added by jhakku almost 11 years ago
I am a newbie to lighttpd maintenance. In apache2 when I add a site(virtual host) file to sites-available, I will have to use the a2ensite command to activate it. If the vhost is example.conf, I will have to run the command below to activate it.
sudo a2ensite example
and then restart apache.
I see there are other sites which are in the conf-enabled folder, but I cannot see mine. I even ran lighttpd-enable-mod on the conf file, but for some reason I cannot find a symlink even though I restart the lighttpd server.
How do I do the same in lighttpd??
I am adding the vhosts
vhost1 >> conf-available/subdomain1.conf
$HTTP["host"] =~ "subdomain1.example.com" {
#$SERVER["socket"] == ":80" {
proxy.balance = "round-robin" proxy.server = ( "/" =>
( ( "host" => "127.0.0.1", "port" => 8081 ) ) )
}
vhost2 >> conf-available/subdomain2.conf
$HTTP["host"] =~ "subdomain2.example.com" {
#$SERVER["socket"] == ":80" {
proxy.balance = "round-robin" proxy.server = ( "/" =>
( ( "host" => "127.0.0.1", "port" => 8082 ) ) )
}
So now I am adding another sub domain(subdomain3) on port 8083. And when I restart it I am unable to get to subdomain3. My web admin helped me on this and now he is out on vacation for two weeks, I primarily am a web developer, so I do not have a lot of idea around this.
One thing I noticed is, there are sym links for subdomain1.conf & subdomian2.conf, but I do not have a sym link to my subdomain3.conf file. When I do a curl -I http://127.0.0.1:8083/, I get a 200 and am receiving the expected data.There are no errors in the conf file, becaus it is a mirror image of the other files, except for the port and host.
Can someone help me around this please.