VIRTUAL HOSTS


In theory, virtual hosts allow users to lodge an infinite number of sites on a single machine. For example http://mypc.net is different from http://sub.mypc.net. To define virtual hosts in myServer open the file virtualhosts.xml in a text editor (such as notepad in Windows or GNU Emacs in GNU/Linux). A sample virtual hosts configuration file looks like:

<VHOSTS>
-
    <VHOST>
<NAME>Every connection</NAME>
<PORT>80</PORT>
<IP>127.0.0.1</IP>
<PROTOCOL>HTTP</PROTOCOL>
<DOCROOT>web</DOCROOT>
<SYSFOLDER>system</SYSFOLDER>
<HOST>www.mysite.com</HOST>
<ACCESSLOG>logs/myServer.log</ACCESSLOG>
<WARNINGLOG>logs/myServer.err</WARNINGLOG>
<ALLOW_CGI>NO</ALLOW_CGI>
</VHOST>
-
</VHOSTS>




<NAME> gives the server administrator an idea of what the virtual host is such as internal Ethernet, external ethernet or every connection. 

<PORT> is the port used for accepting connections
<IP> is optional. It is the IP address for the interface your virtual host will be working on. The optional useRegex="YES" means the address would act as a regular expression, not only a fixed value. This is more useful for networks with dynamic IP addressing.
<PROTOCOL> is the protocol to be used by the host
<DOCROOT> is the folder where the files are found
<SYSFOLDER> is the system folder
<HOST> is your virtual host's name. The optional useRegex="YES" means the address would act as a regular expression, not only a fixed value.
<ACCESSLOG> is the access log used by the virtual host
<WARNINGLOG> is the errors log file used by the virtual host.
<ALLOW_CGI> This option would deny the access to CGI in this virtual host. This line can exist in myserver.xml too, as a global configuration, but if it is included in virtualhosts.xml, this is the one that will be considered. ALLOW_CGI can also appear as ALLOW_FASTCGI, ALLOW_ISAPI, ALLOW_MSCGI , ALLOW_WINCGI, ALLOW_SEND_LINK, ALLOW_EXTERNAL_COMMANDS, ALLOW_SEND_FILE, each of them denying/allowing the proper HTTP data handler to be used.

Log files can have extra options:
<ACCESSLOG type="combined">logs/myServerHTTP.log</ACCESSLOG>
With this option, the logs will have two extra fields: HTTP Referer and HTTP User Agent.
Using cycle="yes" you will enable log cycler on the log file. When a log file with cycling enabled reaches the max size for log files it will write its content to a new file and recreate the original file. By default cycled log files uses the gzip compression to save space, if you don't want to use gzip specify cycle_gzip="no".

MyServer gives you the option to enable the HTTP TRACE command for each virtual host. All you need to do is edit the security.xml file of the root of your virtual host (not a subdirectory in it! if the file doesn't exist, you may create a new one, in the format described in the Security section of this documentation), and add the parameter

<HTTP TRACE="ON" />

Once you do that, you enable HTTP TRACE command. By default, it's disabled (so, simply delete the line, if you want to disable it)




MyServer offers the feature to follow symlinks on Unix-like Operating systems (e.g.: Linux, *BSD, GNU/HURD, Solaris, etc.).
You can add the symlink following feature for each virtual host in the virtualhosts.xml file.
<FOLLOW_LINKS>YES</FOLLOW_LINKS>

The default is: <FOLLOW_LINKS>NO</FOLLOW_LINKS> This value is used by default by MyServer.