glassfish创建domain并发布项目

1. 进入glassfish目录

[root@plcdfgs ~]#  cd /opt/glassfish3/glassfish/bin

2. 创建domain,输入用于登陆的的账号密码,登陆控制台需要,创建成功之后,看好端口和用户(此处可有其他命令指定创建时使用的端口和用户,自行百度)

[root@plcdfgs bin]# sh asadmin create-domain domain9
Enter admin user name [Enter to accept default "admin" / no password]> admin
Enter the admin password [Enter to accept default of no password]> 
Enter the admin password again> 
Default port 4848 for Admin is in use. Using 29469
Default port 8080 for HTTP Instance is in use. Using 10957
Default port 7676 for JMS is in use. Using 16963
Default port 3700 for IIOP is in use. Using 36926
Default port 8181 for HTTP_SSL is in use. Using 21009
Using default port 3820 for IIOP_SSL.
Using default port 3920 for IIOP_MUTUALAUTH.
Default port 8686 for JMX_ADMIN is in use. Using 32523
Using default port 6666 for OSGI_SHELL.
Using default port 9009 for JAVA_DEBUGGER.
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=plcdfgs,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
Distinguished Name of the self-signed X.509 Server Certificate is:
[CN=plcdfgs-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]
No domain initializers found, bypassing customization step
Domain domain9 created.
Domain domain9 admin port is 29469.
Domain domain9 admin user is "admin".
Command create-domain executed successfully.

3. 启动domain

[root@plcdfgs bin]# sh asadmin start-domain domain9
Waiting for domain9 to start ..
Successfully started the domain : domain9
domain  Location: /opt/glassfish3/glassfish/domains/domain9
Log File: /opt/glassfish3/glassfish/domains/domain9/logs/server.log
Admin Port: 29469
Command start-domain executed successfully.

4. 如果登陆控制台出现需要DAS认证,则开启就行,开启之后需要重启一下

[root@plcdfgs bin]# sh asadmin --host 192.168.0.2 --port 29469 enable-secure-admin 
Enter admin user name>  admin
Enter admin password for user "admin"> 
You must restart all running servers for the change in secure admin to take effect.
Command enable-secure-admin executed successfully.

5. 此时打开glassfish控制台,

http://192.168.0.2:29469/common/index.jsf

6. 输入账号密码登陆即可,如果登陆不上或长时间转圈圈,重启重登清缓存三连

7. 将要发布的webapp文件夹丢到服务器上,此步骤应该再第一步执行,放这里也不影响

8. 登陆成功之后,Application-->Deploy,看图


9. 选择好文件后,可更改项目访问路径参数Context Root(如上图)其他默认即可,然后点击ok,然后等着。。。。ok

10. 成功后可点击application列表上项目右边的 lunch,然后打开下方的url,如果host为主机名,则替换成ip地址则可访问


阅读更多
想对作者说点什么?

博主推荐

换一批

没有更多推荐了,返回首页