Change the portal URI
Overview
Gotcha
When we specify the context root, do not specify a value that is the same as a directory existing in a portlet WAR directory.
For example, if set the WebSphere Portal context root as...
/images
...and there is also a portlet with the directory structure...
/myPortlet.ear/myPortlet.war/images
...this could cause a conflict if the portlet encodes URI references to resources in its own /images directory. In this situation, the portlet would be unable to display images because WebSphere Portal would look for the image resources according to its own context root path instead of the directory path specified by the portlet WAR file.
Change the URI of a WSRP Producer portal
Changing the WSRP Producer context root does not require redeploying all portlets. You only need to run the task...
modify-servlet-path configuration
With WebSphere Portal v8, the URI of the context root for the WSRP Producer is...
/wps/wsrp
Prior to v8, this context root is...
/wsrp
If you migrated to portal v8 from an earlier version, you still might have WSRP Consumers that attempt to access the WSRP Producer with the previous context root (/wsrp). We can correct this issue in one of the following ways:
- Modify the context root for the WSRP Producer to /wsrp. This change enables the Consumers to access the Producer without requiring further changes to the Consumers.
- Update the configuration of the WSRP Consumers to use the new context root...
/wps/wsrp
Change portal URI after migration from v6.1
If you migrated the portal from v6.1 to v8, the migration places the MigratedThemes application under the original context root, for example /wps.
Before we can change the portal URI to a path containing your original context root path, change the path for the migrated themes. Do this for all occurrences of the path in themes, including the EAR file for the migrated themes MigratedThemes.ear and, for example, possible hard coded occurrences in the custom theme application code. For details about how to change the path for the migrated themes, see Portal V6.1.x on application server V6.1:
Update themes and skins to remove hardcoded context root references.
WCM Syndication, the Syndicators and Subscribers
WCM syndication syndicator and subscriber servers referring to the Portal instance must be updated with the modified URI.Log on to the WebSphere Portal syndicating to this instance. Go to...
Administration | Portal Content | Syndicators | syndicator | Edit
Update the URL with the new context root information. Then log on to the WebSphere Portal subscribing to this instance. Go to...
Administration | Portal Content | Subscribers | subscriber | edit icon
Update the URL with the new context root information.
Change the Portal URI
If you modify the URI in a clustered environment, complete these steps on the primary node only, except where specified differently.
- If you changed the context root during installation on the panel...
Configuration for IBM WebSphere Portal: Profile configuration details: Advanced
...proceed to step 2. Otherwise...
- Stop the WebSphere_Portal server.
- Create backups of wkplc.properties and wkplc_comp.properties
- Edit wkplc.properties and set the WpsContextRoot property.
- Save and close the file.
- Edit wkplc_comp.properties and enter the appropriate value for the environment in the following properties:
- WsrpContextRoot
- WpsPersonalizedHome
- WpsDefaultHome
Do not enter the same value for WpsPersonalizedHome and WpsDefaultHome.
- Save and close the file.
- Start the WebSphere_Portal server in a stand-alone environment or the dmgr and node agent in a clustered environment.
- Change the portal URI:
cd WP_PROFILE/ConfigEngine
./ConfigEngine.sh modify-servlet-path -DPortalAdminPwd=foo -DWasPassword=fooCheck the output for any error messages before proceeding with the next task. If any of the configuration tasks fail, verify the values in the wkplc.properties and wkplc_comp.properties files.
- Restart the WebSphere_Portal server.
- Modify context root for the portlets:
./ConfigEngine.sh modify-servlet-path-portlets -DPortalAdminPwd=foo -DWasPassword=foo
Check the output for any error messages before proceeding with the next task. If any of the configuration tasks fail, verify the values in the wkplc.properties and wkplc_comp.properties files.
- Start the WebSphere_Portal server
- If we are using an external Web server, such as an HTTP Server:
- Update the web server definition...
- Standalone
- Copy the following script from the plugin_root/bin directory to the WP_PROFILE/bin directory on the WebSphere Portal server:
scp plugin_root/bin/configurewebservername.sh portal_host:WP_PROFILE/bin
...where webservername is the web server definition name defined previously when configuring the HTTP Server for WebSphere Portal, for example:
configurewebserver1.sh
- Update the web server definition...
cd WP_PROFILE/bin
./configurewebservername.sh- Clustered
- Copy the script from the plugin_root/bin directory to the directory on the dmgr server:
scp plugin_root/bin/configurewebservername.sh dmgr_host:dmgr_profile/bin
...where webservername is the web server definition name defined previously when configuring the HTTP Server for WebSphere Portal, for example: configurewebserver1.bat.
- Execute the following command on the dmgr server:
cd dmgr_profile/bin
./configurewebservername.sh
- Regenerate the Web server plug-in in WAS. If we are using a remote Web server, copy the generated plugin-cfg.xml file to the remote server.
These steps should not be completed if we are only changing the WSRP Producer URI.
- Restart the Web server.
- Restart the WebSphere_Portal server.
- Update the registered Application URI entries in the table...
JCR.ICMSTJCRNODEREGISTER
In a clustered environment, complete these steps on the primary node only.
- Stop the WebSphere_Portal server.
- Backup the database.
- Start the WebSphere_Portal server.
- Deregister the nodetypes:
Edit...
./PortalServer/wcm/prereq.wcm/config/nodetypes/ibmcontentwcm.registernodetypes
...and change...
<registerAction action="register"/>
...to...
<registerAction action="deregister"/>
- Update <ApplicationURI name="wps/mypoc/?view=auth&uri=wcm:oid:"/>
For example:
<registerNodeTypeDefinition name="ibmcontentwcm:classificationData"> <registerAction action="deregister"/> <Application name="wcm"/> <ApplicationURI name="wps8/mypoc/?view=auth&uri=wcm:oid:"/> </registerNodeTypeDefinition>...and then run....
ConfigEngine.sh action-register-wcm-nodetypes -DWasPassword=foo -DPortalAdminPwd=foo
- Register the nodetypes:
Edit...
/WebSphere/PortalServer/wcm/prereq.wcm/config/nodetypes/ibmcontentwcm.registernodetypes
...and change...
<registerAction action="deregister"/>
...to...
<registerAction action="register"/>
- Update <ApplicationURI name="wps/mypoc/?view=auth&uri=wcm:oid:"/>
For example:
<registerNodeTypeDefinition name="ibmcontentwcm:classificationData"> <registerAction action="register"/> <Application name="wcm"/> <ApplicationURI name="wps8/mypoc/?view=auth&uri=wcm:oid:"/> </registerNodeTypeDefinition>...then run...
ConfigEngine.sh action-register-wcm-nodetypes -DWasPassword=foo -DPortalAdminPwd=foo
- Run the following SQL query to verify the entries in the table now show the new URI:
select * from JCR.ICMSTJCRNODEREGISTER
- Restart the WebSphere_Portal server.
- If using IBM WCM, change the JSP components located in the Web Resources v70 Library:
If a clustered environment, complete these steps on the primary node only.
- Log on to WebSphere Portal and go to...
Applications | Content | Web Content Management | Preferences | Edit Shared Settings | Library Selection
...and add Web Resources v70 to the Selected Libraries list.
- Under Item Views, select...
All Items | All | Components | JSP
- Select every JSP component from the Web Resources v70 library and then click Edit.
- Update the Path field for every JSP component with the new context root path.
The JSP path includes two parts, which are separated by a semi-colon. The first part is the context path to the WCM extensions web application and then the second part is the path to the JSP. Update the path to the web application. For example the other path might be...
/wcmextension;/jsp/html/general/UpdateItem.jsp
If you changed the context root to mynewcontext, you would change the old path to:
/mynewcontext/wcmextension;/jsp/html/general/UpdateItem.jsp
- Optional: Update the custom themes to reference the correct dojo context root.
The default dojo context root in WebSphere Portal is...
/wps/portal_dojo
After running the modify-servlet-path and modify-servlet-path-portlets tasks, the dojo context root is changed to include the new value in the WpsContextRoot parameter as the prefix. For instance if the new WpsContextRoot value is myco, then the new dojo context root becomes...
/myco/portal_dojo
If the theme has hard coded references to...
/wps/portal_dojo
...update those references to the new context root. If you migrated a custom theme, we might find that it has references to /portal_dojo without the /wps prefix. Look for these references in both the WAR file and in the WebDAV storage for the theme.
Cluster note: In a clustered environment, complete these steps on the primary node only.
- If you changed the context root and you have existing search collections:
Edit the content root is each existing search collection.
- Log on to WebSphere Portal as the administrator and go to...
Administration | Search Administration | Manage Search | Search Collections | search_collection
- For the first content source in the list, select Edit Content Source icon
- Edit the URL listed in the Collect documents link from the URL with the new context root.
- Click Save.
- Edit the URL in each remaining content source and then save you changes.
- In the breadcrumb trail, click...
Collections from All Services
...and select the next search collection to modify.
- To use the Web application bridge integration feature we are using Lotus Quickr Doc Picker:
In a clustered environment, complete these steps on the primary node only.
- Log on to the WAS admin console and go to...
Applications | Application Types | WebSphere enterprise applications | Quickr Document Picker | Web Module Properties | Context Root For Web Modules
- Change the context root to new_context_root.
- Click OK.
- Click Save to save the changes to the master configuration.
- Log out of the WAS admin console.
- Update the context root information in the following files to match the new context root:
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/METAINF/application.xml
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/WEBINF/jsp/js/config.jsp
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/picker/picker-packaged.js
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/picker/picker-packaged.js.uncompressed.js
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/picker/widgets/DocumentPicker.js
- WP_PROFILE/installedApps/node_name/Quickr_Document_Picker.ear/qkr.docpicker.widgets.war/js/quickr/picker/widgets/PickerDialog.js
- WP_PROFILE/installedApps/node_name/EphoxEditLive.ear/editoreditlive.war/jsp/html/EditLiveJavaEditor.jsp
- WP_PROFILE/installedApps/node_name/PA_WCM_Authoring_UI.ear/ilwwcmauthoring.war/jsp/html/OdcEditor.jsp
- Resynchronize nodes and restart the cluster.
- static cluster:
- Synchronize...
System Administration | Nodes | primary node | Full Resynchronize
- Stop the cluster...
Servers | Clusters | cluster | Stop
- After the cluster has stopped, restart it by selecting the cluster and clicking Start.
- Dynamic cluster
- Synchronize...
System Administration | Nodes | primary node | Full Resynchronize
- Stop the cluster...
Servers | Dynamic Clusters | dynamic cluster | cluster | Stop
- Select the member name to start and then click the Start button.
- On each node within the cluster, create WebSphere environment variables for WCM...
- Locate the wkplc.properties and wkplc_comp.properties files on the additional nodes in...
WP_PROFILE/ConfigEngine/properties
...and create backup copies before changing any values.
- Edit wkplc.properties and enter the appropriate value for the environment in the WpsContextRoot property.
- Save and close the file.
- Edit wkplc_comp.properties and enter the appropriate value for the environment in the following properties:
- WsrpContextRoot
- WpsPersonalizedHome
- WpsDefaultHome
Do not enter the same value for WpsPersonalizedHome and WpsDefaultHome.
- Save and close the file.
- Create the WebSphere environment variables for WCM:
./ConfigEngine.sh create-wcm-servletpath-variables -DServerName=your_application_server -DWasPassword=foo
Check the output for any error messages before proceeding with the next task. If any of the configuration tasks fail, verify the values in the wkplc.properties and wkplc_comp.properties files.
- Resynchronize the nodes and restart the cluster.
Parent: Configuring
Related: Portal V6.1.x on application server V6.1: Update themes and skins to remove hardcoded context root references