Dear all, The virtual server setup of NaviServer was in part tricky and buggy, so i did the following changes to improve the situation:
- One problem was the maintenance of the virtual server map: a) for drivers listening on a non-standard port, one has to list the entry with the port b) for drivers on the standard port (80/443), one has to list two entries, one with and one without the port. These rules are from [1]. since NaviServer used this entries as-is, one had to repeat the port for every host in the configuration, and to add entries without the port, when the driver should listen on the default port. - When doing so, i found bugs, where it was possible that the start of NaviServer was aborted, since a server was not yet defined, or that a driver might have been initialized twice (when multiple servers use the same driver) Up to my knowledge, everything continues to work, also the more complex case with - 2 drivers (nssock1 and nssock2) - 2 servers (s1 and s2), and - 3 "virtual hosts" The new version is already running at OpenACS.org, which has two servers and 8 virtual servers defined. If you have complex server/virtual server setups, please test if possible all the best -gn ############################################################### # Define two servers # ns_section ns/servers ns_param s1 "Virtual Server 1" ns_param s2 "Virtual Server 2" ns_section ns/server/s1/fastpath ns_param pagedir /tmp/ns/s1 ns_section ns/server/s2/fastpath ns_param pagedir /tmp/ns/s2 # # Define two nssock drivers, listening on port 8001 and 8002 # ns_section ns/modules ns_param nssock1 nssock.so ns_param nssock2 nssock.so ns_section ns/module/nssock1 ns_param port 8001 ns_param defaultserver s1 ns_section ns/module/nssock2 ns_param port 8002 ns_param defaultserver s2 # # Directing requests to three virtual servers (foo.com, bar.com, # baz.com), which are mapped to the servers s1 and s2. # ns_section ns/module/nssock1/servers ns_param s1 foo.com ns_param s2 bar.com ns_section ns/module/nssock2/servers ns_param s2 baz.com ############################################################### Virtual server reform: - new feature: Make mapping of host entries in the virtual server definition more intelligent to avoid newbie gotchas and hard to find mis-configurations (entries in e.g. nssock/servers) a) add automatically an entry with the port, when non is given b) complain, when driver is not listening on the specified port c) add automatically an entry without the port, when the driver listening on the default port Old configurations (doing a-z manually) should continue to work, non RFC compliant (test) cases have to be fixed (when a driver uses a non-default port, and the request contains no port) - Added documentation - bugfix: Avoid potential double-initialization of driver modules when multiple servers are used. - bugfix: Postpone registration of virtual servers until all servers are defined. Before it was possible that NaviServer boot was terminated, when a default server of a driver was not yet defined. [1] https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.23 ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ naviserver-devel mailing list naviserver-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/naviserver-devel