1. Contents of this article
Glassfish (V3.1) domain creation, deletion, login, deployment, etc.
Linux Client Tools: securecrtportable and WinSCP (please download it yourself)
2.1 New Domain
/root/glassfish3/glassfish/bin/asadmin create-domain--adminport 4848 domain8
Description
/root/glassfish3/glassfish/bin/glassfish the bin path of the installation directory
Asadmin glassfish command-line tools
Asadmin create-domain--adminport 4848 domain8 This sentence means creating a domain named Domain8 that uses port 4848 as the admin console login port
Then you will be prompted to enter the DOMAIN8 administrator user name, enter admin here, the default is to use admin
Enter the password for the DOMAIN8 Admin user, which is also entered in admin and will be asked to confirm the input again . last prompt to create a successful
Domain8 is the domain created above
Modify the Domain8 configuration file
Use WINSCP to enter DOMAIN8 path
Double hit Open domain.xml, find <network-listeners> section , modify http-listener-1 port is 8088 (which is modified on its own request), save and close
Create Domain after , Start First Domain
/root/glassfish3/glassfish/bin/asadmin Start-domain Domain8
then execute the command . /root/glassfish3/glassfish/bin/asadmin--host localhost--port 4848 login
execute this command for later on on Linux like this do not use when performing operations such as deployment enter each time as before Domain of the Administrator user name and password
Execution /root/glassfish3/glassfish/bin/asadmin--host localhost--port 4848 enable-secure-admin
enabled Domain8 of the HTTPS Access
Prompt Restart Domain to take effect , points Do not execute the following two lines of command
/root/glassfish3/glassfish/bin/asadmin Stop-domain Domain8
/root/glassfish3/glassfish/bin/asadmin start-domain Domain8
after reboot , Access Management Control system table , IE Open https://192.168.20.207:4848/, attention is HTTPS, I'm using Japanese. OS, does not affect the effect
Log in using Amdin/admin (the Administrator user name and password you entered when creating Domain8)
Look at the Domain8 run is normal, ie access http://192.168.20.207:8088/, note that this is HTTP, no s, the port is the above configured access port, not the management console port
Here a new domain is created, personally think, a domain corresponding to a set of management ports and access ports, so when creating multiple domain to pay attention to port problems do not create port conflicts
2.2 Delete Domain
Use the command to close the domain you want to delete first
Execute/root/glassfish3/glassfish/bin/asadmin stop-domain domain8
The entire folder is then deleted directly through WINSCP, so you can delete the DOMAIN8 domain Domain8
2.3 Starting and Stopping domain
Start/root/glassfish3/glassfish/bin/asadmin Start-domain Domain8
Stop/root/glassfish3/glassfish/bin/asadmin Stop-domain Domain8
2.3 Deploying and canceling deployment of Xxx.war files in domain is simple, but it is recommended to follow the order I wrote (assuming the Xxx.war file already exists in a directory on a Linux server)
Step1. Undeploy, if you have not deployed a war, you can skip it. Because the asadmin login command is executed above, there is no need to enter the user me and password (actually I call these commands in Jenkins)
/root/glassfish3/glassfish/bin/asadmin--host localhost--port 4848 undeploy xxx
Step2. Stop Domain8
/root/glassfish3/glassfish/bin/asadmin Stop-domain Domain8
Step3. Start Domain8
/root/glassfish3/glassfish/bin/asadmin Start-domain Domain8
Step4. Deploying Xxx.war
/root/glassfish3/glassfish/bin/asadmin--host localhost--port 4848 deploy/root/test/xxx.war
Step5. Accessing the deployed program through IE http://IP:8088/xxx/
Published by Word2016
Finish.
Domain management for Linux server Glashfish