000017585 - FIM 4.2 Cannot use localhost in install scripts.

Document created by RSA Customer Support Employee on Jun 16, 2016Last modified by RSA Customer Support Employee on Apr 21, 2017
Version 2Show Document
  • View in full screen mode

Article Content

Article Number000017585
Applies ToRSA Federated Identity Manager (FIM) 4.2  and 4.2 SP1 for Windows
No, it can?t be as there will be a default Host tag in the server.xml file which will be mapped to localhost hence it won?t allow FIM to start  if we are having FQDN as localhost in the fim-deploy.cmd file. 
Default:- <Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
FIM:- <Host appBase="FIM" autoDeploy="true" name="fimtest.fim.com" unpackWARs="true">
NOTE:- FIMConfig GUI and all the endpoints are accessed using the FQDN mentioned in the script.
IssueFIM 4.2   Cannot use localhost in install  scripts.
In the install.cmd  and  fim-deploy.cmd  can localhost be used for FQDN
Notes

sample fim-deploy.cmd from FIM 4.2 SP1

@echo off
goto :start

###############################################################
# Please read the following message under the label ":usage". #
###############################################################

:usage
echo.
echo This script updates the configurations required to run RSA Federated Identity Manager 4.2.1 on Tomcat Server.
echo.
echo This script should be executed after successfully completing the installation script.
echo.
echo Edit this file to set the following environment variables as specified here:
echo.
echo JRE_HOME         The directory containing the FIM JRE will be run under.
echo INSTALL_DIR      Location of CATALINA_BASE directory where FIM is installed.
echo INSTALL_TYPE     FIM Deployment type, It can be one of the following ("standalone" or "admincluster" or "runtimecluster" or "artifactcluster" or "replaycachecluster" or
echo       "artifact_replaycluster" or "biztierdistributed" or "webtierdistributed").
echo FQDN          The fully qualified domain name.   
echo.
echo You can also specify the values for these variables at the command line as follows:
echo.
echo.
echo   fim-deploy.cmd JAVA_HOME INSTALL_DIR INSTALL_TYPE FQDN 
echo.
echo When specifying directories that contain whitespace or special characters from
echo the command line, remember to enclose them in double-quotes.
echo.
echo.
goto :eof

:echotask
echo.
echo %TASK%....
echo.
goto :eof

:error
echo.
echo Execution failed.
echo Reverting back the changes.
if exist %SRC_FOLDER%\bkp\server_bkp.xml (
copy %SRC_FOLDER%\bkp\server_bkp.xml %SRC_FOLDER%\server.xml
del %SRC_FOLDER%\bkp\server_bkp.xml
)

if exist %SRC_FOLDER%\bkp\web_bkp.xml (
copy %SRC_FOLDER%\bkp\web_bkp.xml %SRC_FOLDER%\web.xml
del %SRC_FOLDER%\bkp\web_bkp.xml
)

if exist %SRC_FOLDER%\catalina_bkp.properties (
copy %SRC_FOLDER%\bkp\catalina_bkp.properties %SRC_FOLDER%\catalina.properties
del %SRC_FOLDER%\bkp\catalina_bkp.properties
)

echo  Please correct the problem and re-run the script.
echo.
endlocal
goto :usage

:start
setlocal

set SCRIPT_DIR=%~d0%~p0
set JRE_HOME=C:\Program Files\Java\jdk1.6.0_33
set INSTALL_DIR=C:\FimInstances\Tomcat\testdeploy
set INSTALL_TYPE=standalone
set FQDN=fimtest.fim.com
set SERVERTYPE=Windows

if "%JRE_HOME%"=="" (
       set /p JRE_HOME="Set JRE_HOME Path:"
 )

if "%JRE_HOME%"=="" (
  echo JRE_HOME variable is not set.
  goto :error
 )
 
if "%INSTALL_DIR%"=="" (
  set /p INSTALL_DIR="Set CATALINA_BASE Path where FIM4.2.1 is installed:"
 )

if "%INSTALL_DIR%"=="" (
  echo INSTALL_DIR variable is not set.
  goto :error
 )
 
if not exist %INSTALL_DIR%\bin (
  echo INSTALL_DIR variable is not set properly, it should be set to CATALINA_BASE.
  goto :error
 )
 
if not exist %INSTALL_DIR%\FIM\rsa-fim-config (
  echo Please check whether the installation script has completely successfully or not.
  goto :error
 )
 
if "%INSTALL_TYPE%"=="" (
  set /p INSTALL_TYPE="Set INSTALL_TYPE refer the usage instructions of the script for the value to be set:"
 )

if "%INSTALL_TYPE%"=="" (
  echo INSTALL_TYPE variable is not set.
  goto :error
 )
 
if "%FQDN%"=="" (
  set /p FQDN="Set FQDN with which the FIM Admin GUI will be going to accessed:"
 )

if "%FQDN%"=="" (
  echo FQDN variable is not set.
  goto :error
 )
 
echo Started Copying the jar and war files

if "%INSTALL_TYPE%"=="standalone" (
 xcopy /y ..\Non-distributed\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\FIM-all\*.* "%INSTALL_DIR%\FIM" /S/i/Q
) else (
 if "%INSTALL_TYPE%"=="admincluster" (
 xcopy /y ..\Non-distributed\cluster\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIMAdmin\ClusterService\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIMAdmin\FIM-config\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 ) else (
 if "%INSTALL_TYPE%"=="runtimecluster" (
 xcopy /y ..\Non-distributed\cluster\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIM-all-cluster\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 ) else (
 if "%INSTALL_TYPE%"=="artifactcluster" (
 xcopy /y ..\Non-distributed\cluster\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIM-ArtifactResolutionService\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 ) else (
 if "%INSTALL_TYPE%"=="replaycachecluster" (
 xcopy /y ..\Non-distributed\cluster\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIM-ReplayCacheService\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 ) else (
 if "%INSTALL_TYPE%"=="artifact_replaycluster" (
 xcopy /y ..\Non-distributed\cluster\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIM-ArtifactResolutionService\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 xcopy /y ..\Non-distributed\cluster\FIM-ReplayCacheService\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 )  else (
 if "%INSTALL_TYPE%"=="biztierdistributed" (
 xcopy /y ..\Distributed\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Distributed\FIMAdmin\FIM-config\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 xcopy /y ..\Distributed\FIM-biztier\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 ) else (
 if "%INSTALL_TYPE%"=="webtierdistributed" (
 xcopy /y ..\Distributed\fimlib\*.* "%INSTALL_DIR%\FIM\lib" /S/i/Q
 xcopy /y ..\Distributed\FIM-webtier\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 xcopy /y ..\Distributed\FIM-discovery\*.* "%INSTALL_DIR%\FIM" /S/i/Q
 )else (
  echo INSTALL_TYPE variable is not set correctly as mentioned in the usage instructions.
  goto :usage
 )
 )
 )
 )
 )
 )
 )
)

if ERRORLEVEL 1 goto :error

set SRC_FOLDER="%INSTALL_DIR%\conf"

call :echotask
set CLASSPATH=%SCRIPT_DIR%
set LIB_DIR=%INSTALL_DIR%\rsa-fim-config\lib
set COMMONS_CLASSPATH=%SCRIPT_DIR%\commons-configuration-1.9.jar;%SCRIPT_DIR%\commons-lang-2.6.jar;%SCRIPT_DIR%\commons-logging-1.1.2.jar
set CLASSPATH=%CLASSPATH%;%COMMONS_CLASSPATH%

echo "Updating the Tomcat Deployment Configuration Details required for FIM..."

mkdir %SRC_FOLDER%\bkp
copy %SRC_FOLDER%\server.xml %SRC_FOLDER%\bkp\server_bkp.xml
copy %SRC_FOLDER%\web.xml %SRC_FOLDER%\bkp\web_bkp.xml
copy %SRC_FOLDER%\catalina.properties %SRC_FOLDER%\bkp\catalina_bkp.properties
 
"%JRE_HOME%\bin\java" com.rsa.fim.deploy.TomcatDeploymentXMLConfiguration "%SRC_FOLDER%" "%FQDN%" "%INSTALL_TYPE%"

if ERRORLEVEL 1 set ERROR=TRUE
if "%ERROR%"=="TRUE" goto :error

cd  %SCRIPT_DIR%

if "%INSTALL_TYPE%"=="standalone"  set USERINFO_UPDATE=true
if "%INSTALL_TYPE%"=="admincluster" set USERINFO_UPDATE=true
if "%INSTALL_TYPE%"=="biztierdistributed" set USERINFO_UPDATE=true

echo USERINFO_UPDATE is %USERINFO_UPDATE%

if "%USERINFO_UPDATE%"=="true" (
echo "Updating the FIM Users Information required to access FIMConfig GUI..."
"%JRE_HOME%\bin\java" com.rsa.fim.deploy.TomcatDeploymentUsersConfiguration "%INSTALL_DIR%\FIM"
)
if ERRORLEVEL 1 set ERROR=TRUE
if "%ERROR%"=="TRUE" goto :error

cd  %SCRIPT_DIR%
if "%INSTALL_TYPE%"=="standalone" (
cd %INSTALL_DIR%\FIM
echo "Tomcat Server is starting, Please press the Enter or any key once the server has started successfully...."
call startFIM.cmd
set /p RETURN="Please verify that the Tomcat server has started successfully and press Enter or any key to continue... once the server has started successfully..."
pause
cd %INSTALL_DIR%\bin
echo "Stopping the Tomcat Server...."
call shutdown.bat

cd  %SCRIPT_DIR%

echo "Updating the Standalone Deployment Configuration Details for FIM..."
"%JRE_HOME%\bin\java" com.rsa.fim.deploy.TomcatDeploymentStandaloneConfiguration "%SRC_FOLDER%" "%FQDN%" "%INSTALL_TYPE%" "%SERVERTYPE%"
)

if ERRORLEVEL 1 set ERROR=TRUE
if "%ERROR%"=="TRUE" goto :error

echo "Deleting the Backup Files as the installation is completed successfully.... Give "Y" if you want to delete the Backup files "

if exist %SRC_FOLDER%\bkp (
 rmdir /S %SRC_FOLDER%\bkp
 )
 
echo "Completed Successfully..."

endlocal


sample install.cmd from Fim 4.2 SP1

@echo off
goto :start

###############################################################
# Please read the following message under the label ":usage". #
###############################################################

:usage
echo.
echo This command installs RSA Federated Identity Manager 4.2
echo.
echo Edit this file to set the following environment variables as specified here:
echo.
echo JAVA_HOME        The directory containing the JDK FIM will be run under.
echo INSTALL_DIR      The directory to which FIM should be installed. If you are installing on Tomcat it should be the CATALINA_BASE directory where FIM should be installed.
echo INSTALL_TYPE     The type of installation ("backend" or "webtier"). If the back-end
echo                  (either fim-all.ear or fim-ejbs.ear) will be deployed
echo                  to this machine, type "backend". If the back-end will not be
echo                  deployed to this machine, type "webtier".
echo DEPLOYMENT_MODE  (Specify the type of deployment cluster/noncluster)
echo DB_TYPE          Type of Database (derby/postgresql/oracledb)
echo DB_FQDN        The fully qualified domain name of the database server (in case of derby on cluster setup  this must be FQDN of Admin server)   
echo DATABASE_PORT   The port for the database server (not required in case of derby db on standalone deployment)
echo.
echo You can also specify the values for these variables at the command line as
echo follows:
echo.
echo   install JAVA_HOME INSTALL_DIR INSTALL_TYPE DEPLOYMENT_MODE DB_TYPE ADMIN_FQDN DATABASE_PORT
echo.
echo When specifying directories that contain whitespace or special characters from
echo the command line, remember to enclose them in double-quotes.
echo.
echo If you plan to use postgresql then specify the jdbc driver in JDBC_CLASSPATH EX: set JDBC_CLASSPATH=<FIM_DOMAIN>\lib\postgresql-9.1-902.jdbc4.jar
echo If you plan to use oracledb then specify the jdbc driver in JDBC_CLASSPATH EX: set JDBC_CLASSPATH=<FIM_DOMAIN>\lib\ojdbc5.jar
echo.
goto :eof

:echotask
echo.
echo %TASK%....
echo.
goto :eof

:error
echo.
echo Installation failed: %TASK%
echo Please correct the problem and re-run the installation.
echo.
endlocal
goto :usage

:start
setlocal

set SCRIPT_DIR=%~d0%~p0
set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_33
set INSTALL_DIR=C:\FimInstances\Tomcat\testdeploy
set INSTALL_TYPE=backend
set DEPLOYMENT_MODE=noncluster
set DB_TYPE=derby
set DB_FQDN=%6
set DATABASE_PORT=%7
set SERVER=TOMCAT

if "%SERVER%"=="TOMCAT" (
 set CATALINA_DIR="%INSTALL_DIR%"
)

if "%SERVER%"=="TOMCAT" (
    if not exist "%CATALINA_DIR%\FIM" (mkdir "%CATALINA_DIR%\FIM")
    set INSTALL_DIR="%CATALINA_DIR%\FIM"
)


if "%INSTALL_TYPE%"=="backend" (
 set CONFIG_ZIP=rsa-fim-config.zip
) else (
 if "%INSTALL_TYPE%"=="webtier" (
  set CONFIG_ZIP=rsa-fim-config-webtier.zip
 ) else (
  goto :usage
 )
)

@rem Strip any quotes from the command-line parameters
set JAVA_HOME=%JAVA_HOME:"=%
set INSTALL_DIR=%INSTALL_DIR:"=%
set INSTALL_TYPE=%INSTALL_TYPE:"=%
@rem Convert forward slashes to backward slashes
set INSTALL_DIR=%INSTALL_DIR:/=\%
set JAVA_HOME=%JAVA_HOME:/=\%

set TASK=Extracting configuration information
call :echotask
pushd "%INSTALL_DIR%"
"%JAVA_HOME%\bin\jar.exe" -xf "%SCRIPT_DIR%\%CONFIG_ZIP%"
if ERRORLEVEL 1 set ERROR=TRUE
popd
if "%ERROR%"=="TRUE" goto :error

set TASK=Copying updated Xalan and Xerces libraries
call :echotask

if "%SERVER%"=="TOMCAT" (
 if not exist "%JAVA_HOME%\jre\lib\endorsed" (mkdir "%JAVA_HOME%\jre\lib\endorsed")
 copy /y .\jre\lib\endorsed\*.* "%JAVA_HOME%\jre\lib\endorsed"
 if ERRORLEVEL 1 goto :error
 if not exist "%CATALINA_DIR%\endorsed" (mkdir "%CATALINA_DIR%\endorsed")
 copy /y .\jre\lib\endorsed\*.* "%CATALINA_DIR%\endorsed"
 if ERRORLEVEL 1 goto :error
 if not exist "%INSTALL_DIR%\lib" (mkdir "%INSTALL_DIR%\lib")
 if ERRORLEVEL 1 goto :error
 copy /y fim-users*.* "%INSTALL_DIR%"
 copy /y startFIM*.* "%INSTALL_DIR%"
 copy /y fimUserInfo*.* "%INSTALL_DIR%"
) else (
 if not exist "%JAVA_HOME%\jre\lib\endorsed" (mkdir "%JAVA_HOME%\jre\lib\endorsed")
 copy /y .\jre\lib\endorsed\*.* "%JAVA_HOME%\jre\lib\endorsed"
 if ERRORLEVEL 1 goto :error
 )


if "%SERVER%"=="WLS" (
 set TASK=Copying BouncyCastle JCE
 call :echotask
 if not exist "%JAVA_HOME%\jre\lib\ext" (mkdir "%JAVA_HOME%\jre\lib\ext")
 copy /y .\jre\lib\ext\bcprov-jdk14-134.jar "%JAVA_HOME%\jre\lib\ext"
    if ERRORLEVEL 1 goto :error

set TASK=Copying JSSE if necessary
call :echotask
 if not exist "%JAVA_HOME%\jre\lib\ext\jsse.jar" (
 copy /y .\jre\lib\ext\jsse.jar "%JAVA_HOME%\jre\lib\ext"
 )
if ERRORLEVEL 1 goto :error
)else (
    set TASK=Copying BouncyCastle JCE
 call :echotask
 if not exist "%JAVA_HOME%\jre\lib\ext" (mkdir "%JAVA_HOME%\jre\lib\ext")
 copy /y .\jre\lib\ext\bcprov-jdk14-134.jar "%JAVA_HOME%\jre\lib\ext"
if ERRORLEVEL 1 goto :error

set TASK=Copying BSAFE Crypto Jars
call :echotask
 if not exist "%JAVA_HOME%\jre\lib\ext" (mkdir "%JAVA_HOME%\jre\lib\ext")
 copy /y .\jre\lib\ext\cryptojce.jar "%JAVA_HOME%\jre\lib\ext"
 copy /y .\jre\lib\ext\cryptojcommon.jar "%JAVA_HOME%\jre\lib\ext"
 copy /y .\jre\lib\ext\jcmFIPS.jar "%JAVA_HOME%\jre\lib\ext"
 if ERRORLEVEL 1 goto :error

set TASK=Copying JSSE if necessary
call :echotask
 if not exist "%JAVA_HOME%\jre\lib\ext\jsse.jar" (
 copy /y .\jre\lib\ext\jsse.jar "%JAVA_HOME%\jre\lib\ext"
 )
if ERRORLEVEL 1 goto :error
 )


set TASK=Configuring FIM
call :echotask
set CLASSPATH=%SCRIPT_DIR%
set LIB_DIR=%INSTALL_DIR%\rsa-fim-config\lib
set CASTOR_CLASSPATH=%LIB_DIR%\castor-0.9.7.jar
set FIM_CLASSPATH=%LIB_DIR%\fim.jar
set MORPH_CLASSPATH=%LIB_DIR%\morph-0.7.2.jar
set JDBC_CLASSPATH=
set JDO_CLASSPATH=%LIB_DIR%\bcel-5.1.jar;%LIB_DIR%\jdo2-api-2.0-rc1.jar;%LIB_DIR%\jpox-1.1.0-rc-1.jar
set JDO_CLASSPATH=%JDO_CLASSPATH%;%LIB_DIR%\jpox-enhancer-1.1.0-rc-1.jar;%LIB_DIR%\derby.jar
set JDO_CLASSPATH=%JDO_CLASSPATH%;%LIB_DIR%\jpox-dbcp-1.1.0-rc-1.jar;%LIB_DIR%\commons-dbcp-1.1.jar
set JDO_CLASSPATH=%JDO_CLASSPATH%;%LIB_DIR%\commons-collections.jar;%LIB_DIR%\commons-pool-1.1.jar
set OTHER_CLASSPATH=%LIB_DIR%\commons-logging-1.0.4.jar;%LIB_DIR%\log4j-1.2.9.jar
set OTHER_CLASSPATH=%OTHER_CLASSPATH%;%LIB_DIR%\xmlsec.jar;%LIB_DIR%\commons-codec-1.3.jar;
set AUDIT_LOGGING_CLASSPATH=%LIB_DIR%\resources.jar
set CLASSPATH=%CLASSPATH%;%CASTOR_CLASSPATH%;%FIM_CLASSPATH%;%MORPH_CLASSPATH%;%JDO_CLASSPATH%;%OTHER_CLASSPATH%;%AUDIT_LOGGING_CLASSPATH%;%JDBC_CLASSPATH%

pushd %INSTALL_DIR%

"%JAVA_HOME%\bin\java" com.rsa.fim.install.FIMInstaller "%INSTALL_DIR%" "%INSTALL_TYPE%" WIN32 "%SERVER%" "%DEPLOYMENT_MODE%" "%DB_TYPE%" "%DB_FQDN%" "%DATABASE_PORT%"
if ERRORLEVEL 1 goto :error
copy /y "%JAVA_HOME%\jre\lib\security\java.security" "%JAVA_HOME%\jre\lib\security\java.security.bak"
move /y "%JAVA_HOME%\jre\lib\security\java.security.tmp" "%JAVA_HOME%\jre\lib\security\java.security"
if ERRORLEVEL 1 goto :error

endlocal

Legacy Article IDa66102

Attachments

    Outcomes