View Source

h1. Changing the Portal Timeout

If the GroundWork Monitor portal page is left open for a long period of time, a permissions error will eventually be displayed. The JBoss portal has a set timeout limit of 7 hours. This value can be changed with the process outlined below.
{note}This process is disruptive to the GroundWork Monitor server. You should have users logged off to this server before making changes.{note}

h6. Contents
{toc:minLevel=4|maxLevel=5|printable=false}

h4. 1.0 Changing Portal Timeout By Script

The prefered method for updating the portal timeout is to download and use the attached script

# Download the attached *tgz* file:
{attachments}
# Extract the *tgz* archive:
{noformat}
tar xvf change_portal_timeout.tgz
{noformat}
# Run the *change_portal_timeout.sh* script:
The script take a single parameter passed to the *\-t* flag which should be the desired timeout in minutes.
{noformat}
./change_portal_timeout.sh -t <timeout in minutes>
{noformat}
For a 480 minute timeout you would run:
{noformat}
./change_portal_timeout.sh -t 480
{noformat}
# When script has finished you can restart gwservices for the changes to take effect:
{noformat}
service groundwork restart gwservices
{noformat}
{tip}If you need to revert the changes you can untar the backup placed in a folder matching the date the script was run (*'/usr/local/groundwork/backup/YYYY-MM-DD'*) and then restart gwservices:
{noformat}tar xvf /usr/local/groundwork/backup/2016-10-19/portal-timeout-backup.tgz -C /
service groundwork restart gwservices{noformat}
{tip}

h4. 2.0 Changing Portal Timeout Manually

There are 5 settings in XML files embedded in 5 separate war files. As a broad overview, you have to uncompress each jar file, edit the files within them, repack them, make sure the permissions are correct, then redeploy.

# Back up all files:
{noformat}source /usr/local/groundwork/scripts/setenv.sh
tar cfpz portal_timeout_backup.tar.gz \
/usr/local/groundwork/foundation/container/jpp/standalone/deployments/nagvis.war \
/usr/local/groundwork/foundation/container/jpp/gatein/gatein.ear/portal.war \
/usr/local/groundwork/foundation/container/jpp/standalone/deployments/portal-groundwork-base.war \
/usr/local/groundwork/foundation/container/jpp/standalone/deployments/icefaces-push-server-1.8.2-P06-EE.war \
/usr/local/groundwork/foundation/container/jpp/standalone/deployments/groundwork-enterprise.ear{noformat}
# nagvis.war
## Copy *nagvis.war* to a temp location and extract *WEB-INF/web.xml*:
{noformat}cd /my_temp_dir/
cp /usr/local/groundwork/foundation/container/jpp/standalone/deployments/nagvis.war .
jar xf nagvis.war WEB-INF/web.xml
vim WEB-INF/web.xml{noformat}
## Edit *WEB-INF/web.xml*:
{noformat}<session-config>
<session-timeout>480</session-timeout>
</session-config>{noformat}
{note}The session timeout is defined in minutes, and is 480 in the example above.{note}
## Update *nagvis.war*, change ownership, and deploy:
{noformat}jar uf nagvis.war WEB-INF/web.xml
chown nagios:nagios nagvis.war
mv nagvis.war /usr/local/groundwork/foundation/container/jpp/standalone/deployments/nagvis.war
rm -rf *{noformat}
# portal.war
## Copy *portal.war* to a temp location, and extract *WEB-INF/web.xml*:
{noformat}cd /my_temp_dir/
cp /usr/local/groundwork/jpp/gatein/gatein.ear/portal.war .
jar xf portal.war WEB-INF/web.xml
vim WEB-INF/web.xml{noformat}
## Edit *WEB-INF/web.xml*:
{noformat}<session-config>
<session-timeout>480</session-timeout>
</session-config>{noformat}
## Update *portal.war*, change ownership, and deploy:
{noformat}jar uf portal.war WEB-INF/web.xml
chown nagios:nagios portal.war
mv portal.war /usr/local/groundwork/jpp/gatein/gatein.ear/portal.war
rm -rf *{noformat}
# portal-groundwork-base.war
## Copy *portal-groundwork-base.war* to a temp location, and extract *WEB-INF/web.xml*:
{noformat}cd /my_temp_dir/
cp /usr/local/groundwork/foundation/container/jpp/standalone/deployments/portal-groundwork-base.war .
jar xf portal-groundwork-base.war WEB-INF/web.xml
vim WEB-INF/web.xml{noformat}
## Edit *WEB-INF/web.xml*:
{noformat}<session-config>
<session-timeout>480</session-timeout>
</session-config>{noformat}
## Update *portal-groundwork-base.war*, change ownership, and deploy:
{noformat}jar uf portal-groundwork-base.war WEB-INF/web.xml
chown nagios:nagios portal-groundwork-base.war
mv portal-groundwork-base.war /usr/local/groundwork/foundation/container/jpp/standalone/deployments/portal-groundwork-base.war
rm -rf *{noformat}
# icefaces-push-server-1.8.2-P06-EE.war
## Copy *icefaces-push-server-1.8.2-P06-EE.war* to an empty temp location, and extract *WEB-INF/web.xml*:
{noformat}cd /my_temp_dir/
cp /usr/local/groundwork/foundation/container/jpp/standalone/deployments/icefaces-push-server-1.8.2-P06-EE.war .
jar xf icefaces-push-server-1.8.2-P06-EE.war WEB-INF/web.xml
vim WEB-INF/web.xml{noformat}
## Edit *WEB-INF/web.xml*:
{noformat}<session-config>
<session-timeout>30</session-timeout>
</session-config>{noformat}
## Update *icefaces-push-server-1.8.2-P06-EE.war*, change ownership, and deploy:
{noformat}jar uf icefaces-push-server-1.8.2-P06-EE.war WEB-INF/web.xml
chown nagios:nagios icefaces-push-server-1.8.2-P06-EE.war
mv icefaces-push-server-1.8.2-P06-EE.war /usr/local/groundwork/foundation/container/jpp/standalone/deployments/icefaces-push-server-1.8.2-P06-EE.war
rm -rf *{noformat}
# status viewer war file packed in groundwork-enterprise.ear
{note}This edit is different from the rest: You will need to first unpack *groundwork-enterprise.ear*, then unpack the *status viewer war*, extract, and edit *WEB-INF/web.xml*, repack the *status viewer war*, then repack *groundwork-enterprise.ear*.{note}
{note}The filename in this section should reflect the correct version, status-viewer-X.X.X.war.{note}
## Copy *groundwork-enterprise.ear* to an empty temp location, unpack and extract the *status viewer war*.
{noformat}cd /my_temp_dir/
cp /usr/local/groundwork/foundation/container/jpp/standalone/deployments/groundwork-enterprise.ear .
jar xf groundwork-enterprise.ear
mkdir status-viewer-war-temp
mv status-viewer-7.1.1.war status-viewer-war-temp
cd status-viewer-war-temp
jar xf status-viewer-7.1.1.war WEB-INF/web.xml
vim WEB-INF/web.xml{noformat}
## Edit *WEB-INF/web.xml*:
{noformat}<session-config>
<session-timeout>480</session-timeout>
</session-config>{noformat}
## Repack the status viewer war file, repack *groundwork-enterprise.ear*, change ownership, and deploy:
{noformat}jar uf status-viewer-7.1.1.war WEB-INF/web.xml
mv status-viewer-7.1.1.war ..
cd ..
jar uf groundwork-enterprise.ear status-viewer-7.1.1.war
chown nagios:nagios groundwork-enterprise.ear
mv groundwork-enterprise.ear /usr/local/groundwork/foundation/container/jpp/standalone/deployments/groundwork-enterprise.ear
rm -rf *{noformat}
# Then, restart *gwservices*:
{noformat}service groundwork restart gwservices{noformat}
{tip}If there are any issues with the portal restarting, restore the backup:
{noformat}service groundwork stop gwservices
tar xvf <path to backup>/portal_timeout_backup.tar.gz -C /
service groundwork start gwservices{noformat}{tip}