Virtual hosts can be "IP-based", meaning that you have a different IP address for every web site (or same IP but different port numbers), or "Name-Based", meaning that you have multiple names running on each IP address. The fact that they are running on the same physical server is not apparent to the end user. Using an Apache Virtual Host, you can run several websites on the same apache instance utilizing the same Apache binary; thus saving physical and maintenance resources. For example, you can run both theacmecompany.com and top5acmecompanies.com on a single physical server that has one Apache webserver running on it. This can be easier to manage with Apache and CA SSO (e.g. upgrade a single agent), hence fewer resources.
In the Name-based Virtual Host, when Apache webserver receives a request, it looks for the hostname in the HTTP header, and depending on the hostname, it serves different websites. This is very easy, as you need only one IP-address on that physical server; but, you update the DNS with multiple website names pointing to the same IP-address. For all practical purpose, you’ll be using only Name-based virtual host configuration.
In the following example, the server can contain only one NIC card, which is configured with 10.10.10.10 IP-address. The DNS entry for both theacmecompany.com and top5acmecompanies.com websites point to the 10.10.10.10 IP-address. When Apache receives a request, it looks for the hostname entry in the HTTP header, and serves the corresponding website.
1.) Create the virtual Host in the httpd.conf
DocumentRoot /www/docs/ top5acmecompanies.com
2.) After this is done, using Administrative UI, add agent identity ("agentname") in the ACO for the virtual server to be protected by CA SSO, and the name of the ACO, “Apach2ACO”, is set in the AgentConfigObject parameter of the WebAgent.conf.
In your ACO (Agent Configuration Object) on the Policy Server, you can have “apache” defined for the “defaultagentname” (theacmecompany.com)
3.) In the Administrative UI, create a new Agent for the new agent identity “apache2”. The IP addresses and Agent Name must be the identical with what is specified in ACO “Apache2ACO” and httpd.conf.
4.) For each additional virtual server that needs to be protected by CA SSO, the underlying reason is a new realm and associated policy, -- which should be created.
5.) Each agent identity should have a unique ServerPath parameter defined in the WebAgent.conf. (The ServerPath creates a unique identifier for the caching, logging, and health-monitoring resources that the agents use.)
6.) Start/Stop the web server for the changes to take effect.
When trying to debug your virtual host configuration, you may find the -S command line switch useful, along with Web Agent log and Web Agent trace.