Forum

Multiplie vHosts with diferent Ports and the same Host

Ji
23 December 2015, 21:47
Hello,
I need to create 5 Virtual Hosts with the same host but different ports. If my server has for example the IP 192.168.0.1, I need to have different Virtual Hosts on Port 80, 81,.., 85
192.168.0.1:80 is one Virtual Host and 192.168.0.1:81 another.
I have no idea how to configure a such server..
Thank you
Hugo Leisink
26 December 2015, 22:40
Use several bindings, which you give a ID via BindingID. Use the RequiredBinding to use a specific binding for a virtual host. All is explained in the manual.
Ji
26 December 2015, 22:47
Hi, so it doesn't works. I always get the files from /var/www/htdocs
Binding {
Port = 80
}
Binding {
BindingId = port81
Port = 81
}
Binding {
BindingId = port82
Port = 82
}

Hostname = 127.0.0.1
WebsiteRoot = /var/www/htdocs
StartFile = index.html

VirtualHost {
RequiredBinding = port81
Hostname = 127.0.0.1
WebsiteRoot = /var/www/htdocs-P1
StartFile = index.html
}
VirtualHost {
RequiredBinding = port82
Hostname = 127.0.0.1
WebsiteRoot = /var/www/htdocs-P2
StartFile = index.html
}
Hugo Leisink
28 December 2015, 17:14
Make sure the hostnames of the virtual hosts match with the one you use in the URL bar of your browser. Otherwise, the default host is used.
This topic has been closed.