|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
如果您觉得本篇CentOSLinux教程讲得好,请记得点击右边漂浮的分享程序,把好文章分享给你的小伙伴们!版本glassfish-4.0.zip
1、解压,拷贝到指定装置路径
unzipglassfish-4.0.zip
cpcpglassfish4/usr/local/-rf
2、设置glassfish情况变量
vim/etc/profile
exportGLASSFISH_HOME=/usr/local/glassfish4
exportPATH=.:$PATH:$JAVAHOME/bin:$MYSQLHOME/bin:$GLASSFISH_HOME/bin
source/etc/profle
进进/usr/local/glassfish4/glassfish/config,编纂该目次下的asevn.conf文件,在文件开端到场AS_JAVA="/usr/local/jdk"(值为本机jdk装置路径)
AS_JAVA="/usr/jdk1.7.0_60"
3、假如不想利用默许domain可在此步调创立本人的domain,并指定domaindir和adminport
实行以下下令,创立端口为4848,称号为虹盘的domain
asadmincreate-domain--adminport4848hongpan
Enteradminusername[Entertoacceptdefault"admin"/nopassword]>
BadNetworkConfiguration.DNScannotresolvethehostname:
java.net.UnknownHostException:dev:dev:Nameorservicenotknown
Usingport4848forAdmin.
Usingdefaultport8080forHTTPInstance.
Usingdefaultport7676forJMS.
Usingdefaultport3700forIIOP.
Usingdefaultport8181forHTTP_SSL.
Usingdefaultport3820forIIOP_SSL.
Usingdefaultport3920forIIOP_MUTUALAUTH.
Usingdefaultport8686forJMX_ADMIN.
Usingdefaultport6666forOSGI_SHELL.
Usingdefaultport9009forJAVA_DEBUGGER.
DistinguishedNameoftheself-signedX.509ServerCertificateis:
[CN=localhost,OU=GlassFish,O=OracleCorporation,L=SantaClara,ST=California,C=US]
DistinguishedNameoftheself-signedX.509ServerCertificateis:
[CN=localhost-instance,OU=GlassFish,O=OracleCorporation,L=SantaClara,ST=California,C=US]
Domainhongpancreated.
Domainhongpanadminportis4848.
Domainhongpanallowsadminloginasuser"admin"withnopassword.
Commandcreate-domainexecutedsuccessfully.
4、启动方才创建的domain虹盘
asadminstart-domainhongpan
Waitingforhongpantostart.........................
Successfullystartedthedomain:hongpan
domainLocation:/usr/local/glassfish4/glassfish/domains/hongpan
LogFile:/usr/local/glassfish4/glassfish/domains/hongpan/logs/server.log
AdminPort:4848
Commandstart-domainexecutedsuccessfully.
5、修正方才创立的domain的admin暗码,并使之可以经由过程web登录到把持台
asadminchange-admin-password
Enteradminusername[default:admin]>
Entertheadminpassword>
Enterthenewadminpassword>
Enterthenewadminpasswordagain>
Commandchange-admin-passwordexecutedsuccessfully.
每次操纵的时分把持台都提醒输出用户名暗码,对照贫苦
能够创建暗码设置文件
AS_ADMIN_PASSWORD=***x
6、开启近程登录权限
asadminenable-secure-admin
Enteradminusername>
Enteradminpassword>
Youmustrestartallrunningserversforthechangeinsecureadmintotakeeffect.
Commandenable-secure-adminexecutedsuccessfully.
7、重启domain
asadminrestart-domainhongpan
如今便可经由过程把持台举行办理了
上面入手下手设置jdbc毗连mysql
1、拷贝毗连mysql的jar包到glassfish库目次里
[size=1em]1
[size=1em][size=1em]cpmysql-connector-java-5.1.16-bin.jar/usr/local/glassfish4/glassfish/lib/
2、重启domain
3、上岸mysql把持台,到JDBC毗连池界面
点击new新建JDBC毗连池
设置毗连属性
测试连通性
Succeeded
4、创立JDBC资本,步伐到时分只必要毗连JNDI称号便可
下图JNDIName填写称号,PoolsName选择方才创立的JDBC毗连池。
设置完成,半途而废!
欢迎大家来到仓酷云论坛! |
|