Handle the password and master password required when starting in one of the following ways:
On Microsoft Windows, configure the service to ask the user for the password.
In the Services Control Panel, double-click the service you created.
In the Properties window, click the Log On tab.
Check “Allow service to interact with desktop” to prompt for the required passwords when starting the component.
You have to log in to see the prompts, and entries are not echoed back as you type them. This method is the most secure way to use the services option, but user interaction is required before the service becomes available.
If the “interact with desktop” option is not set, the service stays in a “start-pending” state and appears to hang. Kill the service process to recover from this state.
On Windows or UNIX, create a domain using the --savemasterpassword=true option and create a password file to store the admin password. When starting the component, use the --passwordfile option to point to the file that contains the password. The admin password can also be added by using the --password option of the asadmin start command. Be aware that this method is less secure because the admin password is stored in clear text.
For example:
Create domain with a saved master password. In this syntax, you are prompted for the admin password and master password:
asadmin create-domain --adminport 4848 --adminuser admin --savemasterpassword=true --instanceport 8080 domain1 |
On Windows, create a service using a password file to populate the admin password:
C:\windows\system32\sc.exe create domain1 binPath= "C:\Sun\AppServer\lib\appservService.exe \"C:\Sun\AppServer\bin\asadmin.bat start-domain --user admin --passwordfile C:\Sun\AppServer\password.txt domain1\" \"C:\Sun\AppServer\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SJESAS_PE8.1 DOMAIN1"
The path to the password file password.txt is C:\Sun\AppServer\password.txt. It contains the password in the following format
AS_ADMIN_password=password
For example, for a password adminadmin:
AS_ADMIN_password=adminadmin
On UNIX, use the --passwordfile option in the line you add to the inittab file:
das:3:respawn:/opt/SUNWappserver/bin/asadmin start-domain --user admin --passwordfile /opt/SUNWappserver/password.txt domain1 |
The path to the password file password.txt is /opt/SUNWappserver/password.txt. It contains the password in the following format
AS_ADMIN_password=password
For example, for a password adminadmin:
AS_ADMIN_password=adminadmin
Creating a service using a password that is populated from a command line option:
C:\windows\system32\sc.exe create domain1 binPath= "C:\Sun\AppServer\lib\appservService.exe \"C:\Sun\AppServer\bin\asadmin.bat start-domain --user admin --password adminadmin domain1\" \"C:\Sun\AppServer\bin\asadmin.bat stop-domain domain1\"" start= auto DisplayName= "SJESAS_PE8.1 DOMAIN1"