Today I configured Portal 10.1.2.0.2 on a test system to handle multiple virtual hosts. This was done as a proof-of-concept to support some work for a customer. We had a standard installation on a server named nap01.itconvergence.com with infrastructure on port 7780 and the middle tier using 7779 (HTTP server listen port) and 7778 (webcache listen port). The desired result of this configuration is to have two additional (virtual) hostnames be available on the middle tier. For our testing, we created fictional aliases named www.dan.com and www.houcine.com.
- Add the necessary entries to the local hosts files on the server and any desktop PCs used for testing. It is important that the server be able to resolve these names quickly. As a result, you may also need to review the /etc/nsswitch.conf file on the server to make sure that “
hosts: files dns” is present. If you “hijack” one or two domain names from the real world, the proper DNS entries might interfere with your testing if you don’t have
fileslisted first. We use reserved IP address ranges, so obviously, these IP addresses won’t work for you. Here’s what we added to the /etc/hosts file on the server and also the c:\windows\system32\drivers\etc\hosts.
- Add the following to the end of the httpd.conf file for the middle tier.
### note that the Listen port is 7779, the Port (which is also the webcache listen port) is 7778 NameVirtualHost *:7779 <VirtualHost *:7779> ServerName nap01.itconvergence.com Port 7778 RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:7779> ServerName www.dan.com Port 7778 RewriteEngine On RewriteOptions inherit </VirtualHost> <VirtualHost *:7779> ServerName www.houcine.com Port 7778 RewriteEngine On RewriteOptions inherit </VirtualHost>
- Update the distributed configuration repository with these manual changes using this command.
$ORACLE_HOME/dcm/bin/dcmctl updateconfig -ct ohs -d -v
- Configure the webcache for the new virtual hosts. Note that we reviewed the contents of Metalink note 406542.1 for this step since the supplied documentation was incorrect on this point. Here is the configuration you must make:
- go to http://nap01.itconvergence.com:9400/webcacheadmin
- log in as ias_admin/password
- go to Site definitions
- Add a site for www.dan.com, port 7778 (rest of fields default)
- Add a site for www.houcine.com, port 7778 (rest of fields default)
- Then go to site-to-server mappings
- Select nap01.itconvergence.com, port 7778 and then click “Insert Above”
- Select the site definition you created earlier for www.dan.com and then check the checkbox for the origin server on nap01.itconvergence.com:7779
- Again, select nap01.itconvergence.com, port 7778 and then click “Insert Above”
- Select the site definition you created earlier for www.houcine.com and then check the checkbox for the origin server on nap01.itconvergence.com:7779
- Click Apply changes at the top of the page
- Click restart webcache once the operations management page appears
- At this point, the HTTP path should be configured properly. Next, it’s on to the application configuration. The primary application we’re concerned with is Oracle Portal. For that, we’ll need to configure each Portal virtual host. These commands should do the trick:
go to $ORACLE_HOME/portal/conf ### check for (and rename if desired) logfiles in $ORACLE_HOME/portal/logs after each run of ptlconfig below ### note that the port # is the Port number in the httpd.conf file (not the Listen port) ./ptlconfig -dad portal -sso -host nap01.itconvergence.com -port 7778 ./ptlconfig -dad portal -sso -host www.dan.com -port 7778 ./ptlconfig -dad portal -sso -host www.houcine.com -port 7778
- Then, we need to re-register the mod_osso partner application for each virtual host. The commands look intimidating, but don’t let them bother you. Note here again that the Oracle Portal 10.1.2 configuration guide also has these commands slightly wrong. Specifically, the config_file parameter is specified incorrectly and in order to avoid corrupting your configuration, you’ll need to ignore Oracle’s documentation.
### note the port number in the mod_osso_url is the Port number from httpd.conf (not the Listen port)### first, back up the file cp $ORACLE_HOME/Apache/Apache/conf/osso/osso.conf $ORACLE_HOME/Apache/Apache/conf/osso/osso.conf.20070612 ### for nap01.itconvergence.com--this should already be done, but doesn't hurt to repeat it $ORACLE_HOME/sso/bin/ssoreg.sh -site_name mod_osso_nap01.itconvergence.com:7778 -mod_osso_url http://nap01.itconvergence.com:7778 -config_mod_osso TRUE -oracle_home_path $ORACLE_HOME -config_file $ORACLE_HOME/Apache/Apache/conf/osso/osso.conf -admin_info cn=orcladmin ### for www.dan.com $ORACLE_HOME/sso/bin/ssoreg.sh -site_name mod_osso_www.dan.com:7778 -mod_osso_url http://www.dan.com:7778 -config_mod_osso TRUE -oracle_home_path $ORACLE_HOME -config_file $ORACLE_HOME/Apache/Apache/conf/osso/osso_www.dan.com.conf -admin_info cn=orcladmin -virtualhost ### for www.houcine.com $ORACLE_HOME/sso/bin/ssoreg.sh -site_name mod_osso_www.houcine.com:7778 -mod_osso_url http://www.houcine.com:7778 -config_mod_osso TRUE -oracle_home_path $ORACLE_HOME -config_file $ORACLE_HOME/Apache/Apache/conf/osso/osso_www.houcine.com.conf -admin_info cn=orcladmin -virtualhost
- Following the ssoreg.sh commands, you’ll have generated new OSSO configuration files with each command. The first command just regenerated the original file, but the last two commands will create new files. We need to modify the httpd.conf file to include references to these new files. Modify the original two <VirtualHost> sections for the virtual host names and include the two new parameters OssoConfigFile and OssoIpCheck.
<VirtualHost *:7779> ServerName www.dan.com Port 7778 RewriteEngine On RewriteOptions inherit OssoConfigFile /u04/oracle/product/10.2.0/midtier/Apache/Apache/conf/osso/osso_www.dan.com.conf OssoIpCheck off </VirtualHost> <VirtualHost *:7779> ServerName www.houcine.com Port 7778 RewriteEngine On RewriteOptions inherit OssoConfigFile /u04/oracle/product/10.2.0/midtier/Apache/Apache/conf/osso/osso_www.houcine.com.conf OssoIpCheck off </VirtualHost>
- Once again, update the configuration repository with the dcmctl utility.
$ORACLE_HOME/dcm/bin/dcmctl updateconfig -ct ohs -d -v
- Almost done! Before restarting the components, you should flush the modplsql cache by deleting all the files and directories in $ORACLE_HOME/Apache/modplsql/cache/*.
- Finally, restart the OC4J_Portal and HTTP_Server components.
### restart HTTPD and OC4J_Portal $ORACLE_HOME/opmn/bin/opmnctl stopproc process-type=OC4J_Portal $ORACLE_HOME/opmn/bin/opmnctl stopproc process-type=HTTP_Server $ORACLE_HOME/opmn/bin/opmnctl startall
Now that you’re done, you should be able to access http://nap01.itconvergence.com:7778/pls/portal just as before, plus also http://www.dan.com:7778/pls/portal and http://www.houcine.com:7778/pls/portal.