Create GlassFish v2 and v2.1 domain1 with saved credential for developer profile


How to create a GlassFish domain1with saved credential for developer profile



User could use the following asadmin create-domain command to create a domain1 with saved credential.

$GF_INSTALL/bin/asadmin create-domain --user admin --adminport 4848 --profile developer --passwordfile mypasswordfile --savemasterpassword=true --savelogin=true domain1


The following files are very important and make sure you don't delete them.

# ls -lF ~/.asadminpass

-rw-------   1 root    root         110 Apr  3 11:19 //.asadminpass

# ls -lF ~/.asadmintruststore

-rw-------   1 root    root         808 Apr  3 11:19 //.asadmintruststore

# ls -lF /opt/glassfish/domains/domain1/config/admin-keyfile

-rw-------   1 root    root         116 Apr  3 11:19 /opt/glassfish/domains/domain1/config/admin-keyfile



/opt/glassfish/bin/asadmin create-domain

Usage: create-domain [--user admin] [--adminport port_number] [--terse=false] [--echo=false] [--interactive=true] [--domaindir
domain_directory] [--profile profile_name] [--template domain_template]  [--passwordfile filename ] [--instanceport
port_number] [--savemasterpassword=false] [--domainproperties (name=value)[:name=value]\*] [--portbase portbase] [--savelogin=false]
[--checkports=true] domain_name





Create domain1

# /opt/glassfish/bin/asadmin create-domain --user admin --adminport 4848 --profile developer --savemasterpassword=true --savelogin=true domain1
Please enter the admin password>
Please enter the admin password again>
Please enter the master password [Enter to accept the default]:>
Please enter the master password again [Enter to accept the default]:>
Using port 4848 for Admin.
Using default port 8080 for HTTP Instance.
Using default port 7676 for JMS.
Using default port 3700 for IIOP.
Using default port 8181 for HTTP_SSL.
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Using default port 8686 for JMX_ADMIN.
Domain being created with profile:developer, as specified on command line or environment.
Security Store uses: JKS
Domain domain1 created.
Login information relevant to admin user name [admin] for this domain [domain1] stored at [/.asadminpass] successfully.
Make sure that this file remains protected. Information stored in this
file will be used by asadmin commands to manage this domain.



Start domain1

# /opt/glassfish/bin/asadmin start-domain domain1

Starting Domain domain1, please wait.
Log redirected to /opt/glassfish/domains/domain1/logs/server.log.
Redirecting output to /opt/glassfish/domains/domain1/logs/server.log
Domain domain1 is ready to receive client requests. Additional services
are being started in background.
Domain [domain1] is running [Sun Java System Application Server 9.1.1
(build b14-fcs)] with its configuration and logs at:
[/opt/glassfish/domains].
Admin Console is available at [http://localhost:4848].
Use the same port [4848] for "asadmin" commands.
User web applications are available at these URLs:
[http://localhost:8080 https://localhost:8181 ].
Following web-contexts are available:
[/web1  /__wstx-services ].
Standard JMX Clients (like JConsole) can connect to JMXServiceURL:
[service:jmx:rmi:///jndi/rmi://localhost:8686/jmxrmi] for domain management purposes.
Domain listens on at least following ports for connections: [8080 8181 4848 3700 3820 3920 8686 ].
Domain does not support application server clusters and other standalone instances.





mypasswordfile

AS_ADMIN_PASSWORD=adminadmin
AS_ADMIN_MASTERPASSWORD=changeit





Hope this information helps.


Comments:

Thank you, that worked

Posted by Scott on April 27, 2009 at 12:01 AM PDT #

I am glad, it helps.
Thanks,
Homer Yau

Posted by Homer Yau on April 27, 2009 at 04:35 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

Some information, writeup and thoughts about Java, JavaEE JavaSE, GlassFish, Open Source, Exalogic, Xen, xen hypervisor, Cloud, Elastic, OVM , OEL, OVS, Virtualization, Platform as a service (PaaS), Infrastructure as a service (IaaS), Software as a Service (SaaS), Cloud Applications, Cloud computing, and even free software .....

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today