質問

What is the difference between alias and virtualhost in G-WAN?

Here, it is stated that:

listener may have zero or more virtualhost, for example:

 / gwan / 94.230.210.136_80 / #94.230.210.136                (root host)
                            / $gwan.ch                       (virtual host)
                            / $gwan.com                      (virtual host)
                            / $trustleap.ch                  (virtual host)
                            / $trustleap.com                 (virtual host)

and alias assign additional domain names into existing host, contents are ignored

 / gwan / 94.230.210.136_80 / #94.230.210.136                (root host)
                            / #94.230.210.136:gwan.ch        (alias)
                            / #94.230.210.136:gwan.com       (alias)
                            / #94.230.210.136:trustleap.ch   (alias)
                            / #94.230.210.136:trustleap.com  (alias)

doesn't it the same as using symlink from root host as virtual lhost? for example

ln -s '#94.230.210.136' '$gwan.ch'
役に立ちましたか?

解決

The alias example is "correct" since visiting each of the domains results in the same website. You should expect your alias directories to be empty.

As for virtual host, the example might have been misleading. As with any other web server, "virtual host" is there so that you can host different website on 1 single server. So you should populate your virtual host directories with the content you desired.

他のヒント

The difference between virtual hosts and aliases is simple:

  • virtual hosts let you host different websites on one single IP address;

  • aliases let you serve the same website from different domain names.

Hope this helps.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top