Hitachi

uCosminexus Application Server HTTP Server User Guide


4.3.2 Virtual host based on IP address

The IP address-based virtual host appears as multiple hosts to clients by the following three methods:

Example 1: Open two ports on a Web server on a single server machine, and run as two hosts, one as a Web server that supports SSL and the other as a Web server that does not support SSL.
Listen 443                                                                             ...1
Listen 80                                                                              ...2
<VirtualHost xxx.soft.hitachi.co.jp:443>                                               ...3
    DocumentRoot "Application-Server-installation-directory/httpsd/ssldocs"
    SSLEngine On                                                                       ...4
    SSLCertificateFile "Application-Server-installation-directory/httpsd/conf/ssl/server/httpsd.pem"
    SSLCertificateKeyFile "Application-Server-installation-directory/httpsd/conf/ssl/server/httpsdkey.pem"
</VirtualHost>
<VirtualHost xxx.soft.hitachi.co.jp:80>                                                ...5
    DocumentRoot "Application-Server-installation-directory/httpsd/htdocs"
    SSLEngine Off                                                                      ...6
</VirtualHost>
  1. Definition of port number

  2. Definition of port number

  3. Definition of virtual host of port number 443

  4. Enable SSL

  5. Definition of Virtual host of port number 80

  6. Disable SSL

    [Figure]

Example 2: Provide two NIC (Network Interface Card) (IP address: 172.17.40.10 and 172.17.40.20) on a single server machine, and switch hosts according to Web browser requests, on a single Web server.

If the request from Web browser is http://172.17.40.10/, see Application-Server-installation-directory/httpsd/htdocs1/index.html (when DirectoryIndex is specified as index.html).

If the request from Web browser is http://172.17.40.20/, see Application-Server-installation-directory/httpsd/htdocs2/index.html (when DirectoryIndex is specified as index.html).

Listen 80
<VirtualHost 172.17.40.10>
DocumentRoot "Application-Server-installation-directory/httpsd/htdocs1"
ServerName www10.xxx.soft.hitachi.co.jp
</VirtualHost>
<VirtualHost 172.17.40.20>
DocumentRoot "Application-Server-installation-directory/httpsd/htdocs2"
ServerName www20.xxx.soft.hitachi.co.jp
</VirtualHost>

[Figure]