
Administration Commands                          create-domain(1)

NAME
     create-domain - creates a domain.

SYNOPSIS
     create-domain  [--user user] [--passwordfile passwordfile]
     [(--adminport port_number | --portbase portbase)]
     [(--profile developer | cluster  ] --template domain_template)]
     [--domaindir domain_directory/domains]
     [--instanceport port_number] [--savemasterpassword=false]
     [--domainproperties (name=value)[:name=value]*
     ]
     [--savelogin=false] [--terse=false]
     [--echo=false] [--interactive=true]
     domain_name

DESCRIPTION
     Use the create-domain command to  create  an  administrative
     domain.

     This  command creates  the  configuration  of  a  domain.  A
     domain  is  an  administrative namespace. Every domain has a
     configuration, which is stored in a set of files. Any number
     of domains each of which has a distinct administrative iden-
     tity can be created in a given installation . A  domain  can
     exist  independent of other domains. Any user who has access
     to the asadmin script on a  given system can create a domain
     and  store  its  configuration  in  a  folder  of choice. By
     default, the domain configuration is created in the  default
     directory  for  domains.  You  can override this location to
     store the configuration elsewhere.

     A domain, in addition to being an  administrative  boundary,
     is  also  a  fully compliant Java EE Server. This means that
     you can deploy your Java EE  Applications to the domain  and
     run  them  when the domain is started. A domain provides all
     the necessary environment and services that are essential to
     run the applications.

     A domain can be managed by tools such as the  Administration
     GUI or asadmin.

     You choose an appropriate profile for the domain,  depending
     on the applications that you want to run on your new domain.
     You can choose the developer or cluster for the  domain  you
     create.

Java EE 5            Last change: 4 Aug 2008                    1

Administration Commands                          create-domain(1)

     This command is supported in local mode only.

OPTIONS
     --user                      The username of the adminstrator
                                 of the domain.

     -t --terse                  Indicates that any  output  data
                                 must  be very concise, typically
                                 avoiding   human-friendly   sen-
                                 tences    and   favoring   well-
                                 formatted data  for  consumption
                                 by a script. Default is false.

     -e --echo                   Setting to true  will  echo  the
                                 command  line  statement  on the
                                 standard  output.   Default   is
                                 false.

     -I --interactive            If set to true  (default),  only
                                 the  required  password  options
                                 are prompted.

     --domaindir                 The directory where  the  domain
                                 is  to be created. If specified,
                                 the path must be  accessible  in
                                 the  filesystem.  If  not speci-
                                 fied, the domain is  created  in
                                 the default domain directory.

     --profile                   The profile  of  the  domain.  A
                                 usage profile depicts how a par-
                                 ticular domain is  going  to  be
                                 used. It determines how the tem-
                                 plates  for  various  files  are
                                 customized.  Currently, only the
                                 customization   for   domain.xml
                                 template is supported.

                                 Valid  values  for  this  option
                                 are:  developer and cluster. The
                                 default value for this option is
                                 set  to  developer  if  you have
                                 installed  the  product  without
                                 clustering capabilities.

                                 Note -

Java EE 5            Last change: 4 Aug 2008                    2

Administration Commands                          create-domain(1)

                                   Profile   names   are    case-
                                   sensitive.   Use  all  profile
                                   names in lower case only.

     --template                  The file name  of  a  domain.xml
                                 template   used  to  create  the
                                 domain. This allows  domains  of
                                 different  types  to be created.
                                 This also allows you  to  define
                                 your own template.

     --adminport                 The HTTP/S port for  administra-
                                 tion.  This is the port to which
                                 you should  point  your  browser
                                 (example,
                                 http://localhost:<this-port>) to
                                 manage  the  domain. This option
                                 is mandatory unless you  specify
                                 a   value   for  the  --portbase
                                 option.

     --passwordfile              The file containing  the  domain
                                 password   associated  with  the
                                 administrative   instance.   The
                                 create-domain    command   reads
                                 values for AS_ADMIN_PASSWORD and
                                 the AS_ADMIN_MASTERPASSWORD from
                                 this  file.   The  password   is
                                 defined  in  the following form:
                                 AS_ADMIN_PASSWORD=password,
                                 where  password  is  the  actual
                                 administrator password  for  the
                                 domain.  This  file  can contain
                                 many other passwords required by
                                 the asadmin commands.  In adher-
                                 ence to security policy, asadmin
                                 does not accept clear text pass-
                                 words on the command line.

                                 If     AS_ADMIN_PASSWORD      or
                                 AS_ADMIN_MASTERPASSWORD  are not
                                 in  the  passwordfile,   create-
                                 domain command prompts for admin
                                 password and master password.

     -t --terse                  Indicates that any  output  data
                                 must  be very concise, typically
                                 avoiding          human-friendly

Java EE 5            Last change: 4 Aug 2008                    3

Administration Commands                          create-domain(1)

                                 sentences   and  favoring  well-
                                 formatted data  for  consumption
                                 by a script. Default is false.

     --instanceport              As noted above, the  domain pro-
                                 vides  services so that applica-
                                 tions  can  run  when  deployed.
                                 This (HTTP) port specifies where
                                 the   web  application   context
                                 roots  are  available  for a Web
                                 browser to connect to. This port
                                 is  a  positive integer and must
                                 be  available  at  the  time  of
                                 creation of the domain.

     --savemasterpassword        Setting  this  option  to   true
                                 allows  the masterpassword to be
                                 written to the  file  system.  A
                                 master   password  is  really  a
                                 password  for  the  secure   key
                                 store.  A  domain is designed to
                                 keep    its   own    certificate
                                 (created  at  the time of domain
                                 creation) in  a  safe  place  in
                                 the    configuration   location.
                                 This   certificate   is   called
                                 domain's SSL server certificate.
                                 When the  domain is contacted by
                                 a  Web  browser  over  a  secure
                                 channel (HTTPS),  this  certifi-
                                 cate is presented by the domain.
                                 The master password is  supposed
                                 to  protect  this store (a file)
                                 that contains this  certificate.
                                 This file is called keystore.jks
                                 and is  created  in  the  config
                                 directory of the domain created.
                                 If  however,  this   option   is
                                 chosen,  the  master password is
                                 saved on the  disk  in  domain's
                                 configuration    location.   The
                                 master password is stored  in  a
                                 file   called   master-password,
                                 which is a Java JCEKS type  key-
                                 store.   The  only  advantage of
                                 using this option is in case  of
                                 unattended  system  boots, where
                                 at the time of start-domain, the
                                 master  password is not prompted
                                 for,   because   it   will    be

Java EE 5            Last change: 4 Aug 2008                    4

Administration Commands                          create-domain(1)

                                 extracted from this file.

                                 It is best to create  a  master-
                                 password when creating a domain,
                                 because masterpassword  is  used
                                 by the start-domain command. For
                                 security purposes,  the  default
                                 setting should be false, because
                                 saving the masterpassword on the
                                 disk  is  an  insecure practice,
                                 unless file  system  permissions
                                 are properly set. If masterpass-
                                 word is saved, then start-domain
                                 will  not prompt for it. Master-
                                 password gives an extra level of
                                 security to the environment.

     --domainproperties          Setting the optional  name/value
                                 pairs   overrides   the  default
                                 values for the properties of the
                                 domain  to  be created. The list
                                 must be  separated  by  the  ":"
                                 character. The following proper-
                                 ties are available:

                                     o    jms.port: Specifies the
                                          port  number  for  JMS.
                                          Valid value is 7676.

                                     o    domain.jmxPort:  Speci-
                                          fies  the port on which
                                          the  JMX  connector  is
                                          initialized.  The valid
                                          values are 1-65535.

                                     o    orb.listener.port:
                                          Specifies    the    ORB
                                          listener port  for IIOP
                                          connections   on  which
                                          orb-listener-1  listens
                                          .

                                     o    http.ssl.port:   Speci-
                                          fies  the  port  number
                                          for    http-listener-2.
                                          Valid  values  are 1 to
                                          65535.  On   UNIX,   to
                                          create   sockets   that
                                          listen on ports 1-1024,
                                          you    need   superuser
                                          privileges.

Java EE 5            Last change: 4 Aug 2008                    5

Administration Commands                          create-domain(1)

                                     o    orb.ssl.port: Specifies
                                          the  ORB  listener port
                                          for IIOP connections on
                                          which the IIOP listener
                                          called SSL listens.

                                     o    orb.mutualauth.port:
                                          Specifies    the    ORB
                                          listener port for  IIOP
                                          connections   on  which
                                          the    IIOP    listener
                                          called   SSL_MUTUALAUTH
                                          listens.

     --portbase                  Determines the number with which
                                 the   port   assignment   should
                                 start. A domain uses  a  certain
                                 number  of ports that are stati-
                                 cally  assigned.   The  portbase
                                 value   determines   where   the
                                 assignment should start.  Choose
                                 this   value   judiciously.  The
                                 values for the ports are  calcu-
                                 lated  as  follows:  Admin port:
                                 portbase  +  48,  HTTP  listener
                                 port:   portbase   +   80,  IIOP
                                 listener port:  portbase  +  37,
                                 JMX port: portbase + 86. See the
                                 output of  this  command  for  a
                                 complete list of occupied ports,
                                 when --portbase option is speci-
                                 fied.

                                 Note -

                                   The --portbase  option  cannot
                                   be  used  with the --adminport
                                   or the --instanceport option.

      --savelogin                Saves the admin  user  name  and
                                 password  if you set this option
                                 to true. The  default  value  is
                                 false. The username and password
                                 are stored in  the  .asadminpass
                                 file in user's home directory. A
                                 domain  can  only   be   created
                                 locally  and  hence  while using
                                 the above option, the host  name
                                 saved   in   .asadminpass   will
                                 always be localhost. If the user

Java EE 5            Last change: 4 Aug 2008                    6

Administration Commands                          create-domain(1)

                                 has specified default admin port
                                 while creating the domain, there
                                 is  no  need  to specify --user,
                                 --passwordfile,  --host,  or  --
                                 port  on  any  of the subsequent
                                 asadmin remote  commands.  These
                                 values   will  be  automatically
                                 obtained.

                                 Note -

                                   When  the  same  user  creates
                                   multiple  domains  having same
                                   admin port number on the  same
                                   or  different  machines (where
                                   the  home  directory  is   NFS
                                   mounted),  the  command is not
                                   going to  prompt  whether  the
                                   password  should  be overwrit-
                                   ten.   It   will   always   be
                                   overwritten.

OPERANDS
     domain_name                 The name of  the  domain  to  be
                                 created.

EXAMPLES
     Example 1 Using the create-domain  command  (developer  pro-
     file)

     The  following  command  creates  sampleDomain  domain  with
     developer profile.

       asadmin> create-domain --adminport 5006
       --profile developer --adminuser admin domain3
       Please enter the admin user name>admin
       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 5005 for Admin.
       Default port 8080 for HTTP Instance is in use. Using 51871
       Default port 7676 for JMS is in use. Using 51872
       Default port 3700 for IIOP is in use. Using 51873
       Default port 8181 for HTTP_SSL is in use. Using 51874
       Default port 3820 for IIOP_SSL is in use. Using 51875
       Default port 3920 for IIOP_MUTUALAUTH is in use. Using 51876
       Default port 8686 for JMX_ADMIN is in use. Using 51877

Java EE 5            Last change: 4 Aug 2008                    7

Administration Commands                          create-domain(1)

       Domain being created with profile:developer,as specified on command line
       or environment
       ----- Using Profile [developer] to create the domain ------
       XML processing for profile:
       Base document [/home/SUNWappserver/lib/install/templates/default-domain.xml.template].
       Profile name [developer]. Processing property [domain.xml.style-sheets].
       Domain sampleDomain created.

     Example 2 Using the create-domain command (cluster profile)

     The following command creates domain2  domain  with  cluster
     profile.

       asadmin>create-domain --adminport 4647 --profile cluster domain2
       Please enter the admin user name>admin
       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 4647 for Admin.
       Using default port 8080 for HTTP Instance.
       Default port 7676 for JMS is in use. Using 51256
       Default port 3700 for IIOP is in use. Using 51257
       Using default port 8181 for HTTP_SSL.
       Default port 3820 for IIOP_SSL is in use. Using 51258
       Default port 3920 for IIOP_MUTUALAUTH is in use. Using 51259
       Using default port 8686 for JMX_ADMIN.
       Domain being created with profile:cluster, as specified on command line or environment.
       ------ Using Profile [cluster] to create the domain ------
       XML processing for profile: Base document
       [/home/SUNWappserver/lib/install/templates/default-domain.xml.template].
       Profile name [cluster]. Processing property [domain.xml.style-sheets].

       Security Store uses: JKS
       Domain domain2 created.

EXIT STATUS
     0                           command executed successfully

     1                           error in executing the command

SEE ALSO
     login(1), delete-domain(1), start-domain(1), stop-domain(1),
     list-domains(1)

Java EE 5            Last change: 4 Aug 2008                    8

