question about Multiple Hosting

Discussion in 'General' started by SilentCoder, Feb 16, 2011.

  1. SilentCoder

    SilentCoder New Member

    [RESOLVED] Question about Multiple Hosting

    Hi, i had a question about multiple virtual hosting.

    Suppose i made 5 virtual hosts and 5 listeners connected to that hosts and they have ports such as:

    Host 1 : Port 80
    Host 2 : Port 81
    Host 3 : Port 83
    Host 4 : Port 84
    Host 5 : Port 85

    How would i link them to domain without entering web url such as http://www.website.com:81 and so on?

    Because i know that for domains you cannot enter ip:port so any idea how to make hosting w/e port?

    Thanks.
    Last edited: Feb 20, 2011
  2. webizen

    webizen New Member

    In virtualhost mappings (admin console), domain tells the listener (combination of IP: port) which domain name it should be responsible given the domain name resolves to the IP it is bound to.

    Client request still needs port info such as http://www.domain.com: port/resource
  3. SilentCoder

    SilentCoder New Member

  4. mistwang

    mistwang LiteSpeed Staff

    If it is in native LSWS configuration, you can put "*" for listener to vhost mapping.
  5. SilentCoder

    SilentCoder New Member

    yeh but " * " will only work for port 80 which is default port what if we enter port like 81 then we cannot view the site but to put in the port like internet.com:81.
  6. mistwang

    mistwang LiteSpeed Staff

    If you do not specify a port, port 80 is used, it is on client side (browsers), nothing to do with litespeed or any web server at all.
  7. SilentCoder

    SilentCoder New Member

    Yes, but suppose i host 5 websites and their domains are different so can't i host all website on one port and then add different domains in listener?
  8. mistwang

    mistwang LiteSpeed Staff

    Yes, you can map one listener to multiple vhosts on different domain name. It is called name based vhost.
  9. SilentCoder

    SilentCoder New Member

    but see in picture when point to same port they give errors

    Attached Files:

  10. mistwang

    mistwang LiteSpeed Staff

    You need to check error log for errors.
  11. SilentCoder

    SilentCoder New Member

    This is the error log

    Code:
    2011-02-18 20:24:31.244	ERROR	[config:template:centralConfigLog] Listener [Default] does not exist
    2011-02-18 20:24:31.245	ERROR	[config:template:PHP_SuEXEC] Listener [Default] does not exist
    2011-02-18 20:24:31.245	ERROR	[config:template:EasyRailsWithSuEXEC] Listener [Default] does not exist
  12. mistwang

    mistwang LiteSpeed Staff

    Those errors are unrelated. Post screen shots of your listener configuration maybe easier.
  13. SilentCoder

    SilentCoder New Member

  14. webizen

    webizen New Member

    Listener and vhost mapping looks ok. So what's the problem?

    Keep in mind, you can create another vhost say blog and bind to the same listener as long as domain resolves to the same IP (Name based virtual host). Each vhost has its own config, docroot, etc.
    Last edited: Feb 19, 2011
  15. mistwang

    mistwang LiteSpeed Staff

    Just continue adding other vhosts to the "Virtual Host Mapping".
  16. SilentCoder

    SilentCoder New Member

    the problem is that all the listeners won't run on same port that is port 80 and if i use different ports then i would have to use www.domain.com:port which i don't want.
  17. mistwang

    mistwang LiteSpeed Staff

    You can add multiple mapping to the same listener. click "Add" link on the second table in that page.
  18. SilentCoder

    SilentCoder New Member

    to be honest i actually never thought of mapping different hosts on same listener lol

    Thank you for the help :)

Share This Page