Sun Java System Application Server
With Sun Java System Application Server
,
you can use the deploy subcommand of the asadmin utility to deploy a WAR file. The syntax is:
# asadmin deploy --user admin-user --passwordfile filename --port port --contextroot deployment-URI --name deployment-URI --target instance-name WAR-file-location
where:
admin-user |
Defines the ID of the Application Server administrator. |
filename |
Defines the full path to the file that stores the password of the Application Server administrator. You must manually edit this file so it can be understood by the asadmin utility. The password must be in the form: AS_ADMIN_PASSWORD=password where password is the password in text used during the installation of Application Server. |
port |
Defines the port for the Application Server Domain Administration Server. The default is 4849. |
deployment-URI |
Defines the URI for the application. This value must be the same as that defined for the SERVER_DEPLOY_URI property in The Silent Installation File. |
instance-name |
Defines the instance of Application Server to which the WAR will be deployed. |
WAR-file-location |
Defines the full path to the WAR file being deployed. |
The asadmin options listed above are those relevant to deploying Federation Manager. For more information (including the full set of options), see the Sun Java System Application Server Enterprise Edition 8.1 2005Q2 Reference Manual.
This section contains the following procedures:
To Deploy an Instance of Federation Manager in Application Server
To Delete an Instance of Federation Manager from Application Server
Type the following command replacing the variables with information regarding your deployment and hit Enter.
# ApplicationServer-base/bin/asadmin deploy --user AS-administrator --passwordfile filename --port port-number --contextroot deployment-URI --name deployment-URI --target instance-name war-file-location |
For example:
# /opt/SUNWappserver/appserver/bin/asadmin deploy --user admin --passwordfile /tmp/pwdfile --port 4849 --contextroot fm --name fm --target server1 /var/opt/SUNWam/fm/war_staging/fm.war |
Following the deployment, modify the Application Server server.policy file.
By default, server.policy is located in the /var/opt/SUNWappserver/domains/domain-name/ directory. In the server.policy sample below, all of the capitalized contents (except WEB-INF) must be replaced with information applicable to your deployment.
// Federation Manager RELATED ADDITIONS grant { permission java.util.PropertyPermission "user.language", "write"; }; grant codeBase "file:${BASEDIR}/${PROD_DIR}/fm/web-src/WEB-INF/lib/am_sdk.jar" { permission java.net.SocketPermission "*", "connect,accept,resolve"; }; grant codeBase "file:${BASEDIR}/${PROD_DIR}/fm/web-src/WEB-INF/lib/am_services.jar" { permission java.net.SocketPermission "*", "connect,accept,resolve"; }; grant codeBase "file:$AS81_VARDIR/domains/$AS81_DOMAIN/applications/ j2ee-modules/${DEPLOY_WARPREFIX}/-" { permission java.net.SocketPermission "*", "connect,accept,resolve"; }; grant { permission java.lang.RuntimePermission "modifyThreadGroup"; permission java.lang.RuntimePermission "setFactory"; permission java.lang.RuntimePermission "accessClassInPackage.*"; permission java.util.logging.LoggingPermission "control"; permission java.lang.RuntimePermission "shutdownHooks"; permission javax.security.auth.AuthPermission "insertProvider.Mozilla-JSS"; permission java.security.SecurityPermission "putProviderProperty.Mozilla-JSS"; permission javax.security.auth.AuthPermission "getLoginConfiguration"; permission javax.security.auth.AuthPermission "setLoginConfiguration"; permission javax.security.auth.AuthPermission "modifyPrincipals"; permission javax.security.auth.AuthPermission "createLoginContext.*"; permission java.security.SecurityPermission "insertProvider.Mozilla-JSS"; permission javax.security.auth.AuthPermission "putProviderProperty.Mozilla-JSS"; permission java.io.FilePermission "ALL FILES", "execute,delete"; permission java.io.FilePermission "$VAR_SUBDIR/logs/*", "delete,write"; permission java.util.PropertyPermission "java.util.logging.config.class", "write"; permission java.security.SecurityPermission "removeProvider.SUN"; permission java.security.SecurityPermission "insertProvider.SUN"; permission java.security.SecurityPermission "removeProvider.Mozilla-JSS"; permission javax.security.auth.AuthPermission "doAs"; permission java.util.PropertyPermission "java.security.krb5.realm", "write"; permission java.util.PropertyPermission "java.security.krb5.kdc", "write"; permission java.util.PropertyPermission "java.security.auth.login.config", "write"; permission javax.security.auth.kerberos.ServicePermission "*", "accept"; permission javax.net.ssl.SSLPermission "setHostnameVerifier"; };
Post installation modifications to server.policy are made as follows:
Replaceable Content |
Default Value |
---|---|
$BASEDIR |
/opt |
$PROD_DIR |
SUNWam |
$AS81_VARDIR |
/var/opt/SUNWappserver |
$AS81_DOMAIN |
domain1 |
$VAR_SUBDIR |
/var/opt/SUNWam |
$DEPLOY_WARPREFIX |
federation |
Restart the Application Server.
To view the Federation Manager Java API Specifications when it is deployed in Application Server, you must first create a symbolic link by typing:
# ln -s /FederationManager-base/SUNWam/fm/docs /Application Server-doc-root/javadocs |
where:
FederationManager-base |
Defines the Federation Manager installation directory. |
Application Server-doc-root |
Defines the Application Server directory in which you store publicly available documentation files. |
Once the symbolic link is defined, you can access the Java API Reference via a web browser by typing a URL in the format protocol://host:port/javadocs. For example, http://host1.sun.com:81/javadocs.
Type the following command replacing the variables with information regarding your deployment:
# ApplicationServer-base/bin/asadmin undeploy --user AS-administrator --passwordfile filename --host host --port port --target instance-name deployment-URI |
where:
ApplicationServer-base |
Defines the Application Server installation directory. |
AS-administrator |
Defines the administrator of the Application Server |
filename |
Defines the file that holds the Application Server administrator password. |
host |
Defines the server that is hosting Federation Manager. |
port |
Defines the port number used. |
instance-name |
Defines the instance of Application Server to which the application is deployed. |
deployment-URI |
Defines the Federation Manager URI (with leading slash). |
For example:
# /opt/SUNWappserver/appserver/bin/asadmin undeploy --user admin --passwordfile /tmp/pwdfile --host samplehost.sun.com --port 4849 --target server1 /fm |
Hit Enter.