Configure the server for virtualhosting

Adaptors and virtual hosts

To host multiple tenants on a server, configure the server so that each customer has their own section. Administrators can configure their own sections to serve their content most effectively. You can configure virtual hosting in several ways, depending on your needs.

The server is divided into hierarchical levels: server, adaptor, virtual host (also called vhost), and application. The server is at the top level and contains one or more adaptors. Each adaptor contains one or more virtual hosts. Each virtual host hosts one or more applications. Each application has one or more instances. You can add adaptors and virtual hosts to organize the server for hosting multiple applications and sites.

Note:

For information about registering applications with the server and storing media, see Configuring content storage.

If you’re hosting multiple websites on a server, use virtual hosts to give customers their own root folders. For example, you could use two virtual hosts to host www.test.com and www.example.com on the same server.

You can assign an IP address or a port number to an adaptor, but not to a virtual host. For this reason, use adaptors to organize virtual hosts by IP address or port number. For example, if a virtual host needs its own IP address to configure SSL, assign it to its own adaptor.

You can also configure one virtual host to run as an edge server and one to run as an origin server. This is called running the server in hybrid mode.

Configuration folder structure

Each of these levels—server, adaptor, virtual host, application, and application instances—has distinct configuration settings stored in XML files in the rootinstall/conf directory: Server.xml, Adaptor.xml, Vhost.xml, and Application.xml. There are also configuration files for information about administrators and logging: Users.xml and Logger.xml. The most important configuration parameters have been pulled out to the ams.ini file, which enables you to use one file to configure the server.

Default structure of the server’s configuration (conf) directory

Edit any of these XML files in a text or XML editor and restart the server for the changes to take effect. If you modify Users.xml or ams.ini, you also must restart Adobe Media Administration Server. For more information, see Working with configuration files.

The following rules define the conf directory structure:

  • The root configuration folder is rootinstall/conf. You cannot remove or modify the name of this directory. The server must have a Server.xml file, a Logger.xml file, and a Users.xml file in the conf directory.

  • The server has one initialization file, ams.ini, in the rootinstall/conf directory. This file contains commonly used settings.

  • The default adaptor’s root directory is rootinstall/conf/_defaultRoot_. You cannot remove or modify the name of this directory. Each adaptor must have an Adaptor.xml file in its root directory.

  • The default virtual host’s root directory is rootinstall/conf/_defaultRoot_/_defaultVHost_. You cannot remove or modify the name of this directory. Each virtual host must have a Vhost.xml file in its root directory. Each adaptor must have a default virtual host.

  • Virtual host directories may also contain an Application.xml file that serves as a default to all applications in that virtual host and a Users.xml file that contains information about administrators of that virtual host.

  • You may place an Application.xml file in an application’s registered directory to create an application-specific configuration. For more information about registered application directories, see the Developer Guide.

Add an adaptor

  1. Create a new directory with the name of the adaptor in the rootinstall/conf folder; for example, rootinstall/conf/adaptor2.

  2. In the adaptor2 directory, create or paste a copy of the _defaultVHost_ directory and an Adaptor.xml file.

    Each adaptor directory must contain a _defaultVHost_ directory and an Adaptor.xml file.

  3. In the _defaultVHost_ directory, create or paste a copy of an Application.xml file and a Vhost.xml file.

  4. In the Adaptor.xml file in the adaptor directory, add a HostPort element to listen on a new port for this adaptor:

     <HostPort name="edge2" ctl_channel=":19351" rtmfp=":1936">:1936</HostPort>

    The name, ctl_channel, and rtmfp attribute values must be unique on the server. The rtmfp attribute and the HostPort element specify the ports to which an IP address should bind. If an IP address is not specified, the adaptor listens on all available interfaces. The server uses the control channel (ctl_channel) attribute internally to communicate between server processes (adding a HostPort element creates a new AMSEdge process).

    The server uses the HostPort value to listen for clients—no two adaptors can listen on the same port, either internally or externally, unless they use different IP addresses. If a host has multiple IP addresses, multiple adaptors can listen on port 1935. In addition, the control channels of two adaptors must be different, or they cannot inter-operate. Ensure that the control channels on which separate adaptors listen are different from each other. The following example is for a host with multiple IP addresses:

     <HostPort name=”edge1” ctl_channel=”:19350” rtmfp=”xx.xx.xx.xx:1935”>xx.xx.xx.xx:1935</HostPort> 
     
     <HostPort name=”edge2” ctl_channel=”:19351” rtmfp=”yy.yy.yy.yy:1935”>yy.yy.yy.yy:1935</HostPort>
  5. If you’re running peer-assisted networking applications, add an Adaptor/RTMFP/Core/HostPortList/HostPort element. See Configure IP addresses and ports for RTMFP.

  6. Restart the server.

  7. To log in to the Administration Console on the new adaptor, use the syntax adaptorname/username in the Username box; for example, adaptor2/admin.

    For information about logging in to the Administration Console, see Connecting to the Administration Console.

    Administrators are defined in the UserList section of the Users.xml file. Administrators are either server-level users (similar to a root user) or virtual host-level users. If you log in to an adaptor other than the default adaptor, you are considered a virtual host administrator and don’t have privileges to manage the server or users.

    The conf directory with an additional adaptor called adaptor2

Add a virtual host

  1. Create a folder with the name of the virtual host in an adaptor folder, for example, rootinstall/conf/_defaultRoot_/www.example.com.

  2. Copy an Application.xml file, a Vhost.xml file, and a Users.xml file to the new virtual host folder. (The Users.xml file is required only if you are defining administrators for this virtual host.)

  3. In the Vhost.xml file, specify an application directory in the AppsDir element, for example:

     <AppsDir>C:\www.example.com<\AppsDir>
    Note:

    It is possible to use the same applications directory for multiple virtual hosts, but it causes namespace conflicts and is not recommended.

  4. Validate the XML and save the Vhost.xml file.

  5. Restart the server.

    Note:

    You can call the startVHost() Administration API or log in to the Administration Console without restarting the server.

  6. Log in to the Administration Console.

    For information about logging in to the Administration Console, see Connecting to the Administration Console.

  7. Connect to the new virtual host by specifying the virtual host name, for example, www.example.com, in the Server name field.

  8. Connect a test application to the new virtual host to make sure it works.

    The conf directory with an additional virtual host called www.example.com

Configuring a single application

You can place an Application.xml file in an application’s folder. Values set in the application-level Application.xml file override the values in the vhost-level Application.xml file.

To see an example, look at the vod and live applications included with Adobe Media Server. Navigate to rootinstall\applications\vod and rootinstall\applications\live. Each folder contains an Application.xml file. The values in these files override the values in the vhost-level file rootinstall\conf\_defaultRoot_\_defaultVHost_\Application.xml.

To prevent settings in the vhost-level Application.xml settings from being overridden by the application-level Application.xml file, add an override attribute to a tag and set it to "no", as in the following:

<LoadOnStartup override="no">false</LoadOnStartup>

When override="no" for an element in a vhost-level Applcation.xml file, you cannot override that element, or any elements contained within that element, in an application-level Application.xml file.

Get help faster and easier

New user?