CentOS安裝GlassFish4.0 配置JDBC串連MySQL

來源:互聯網
上載者:User

CentOS安裝GlassFish4.0 配置JDBC串連MySQL

版本glassfish-4.0.zip

1、解壓,拷貝到指定安裝路徑

unzip glassfish-4.0.zip

cp cp glassfish4 /usr/local/ -rf

2、設定glassfish環境變數

vim  /etc/profile

export GLASSFISH_HOME=/usr/local/glassfish4

export PATH=.:$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和admin port

執行如下命令,建立連接埠為4848,名稱為虹盤的domain

asadmin create-domain --adminport 4848 hongpan

Enter admin user name [Enter to accept default "admin" / no password]>

Bad Network Configuration.  DNS can not resolve the hostname:

java.net.UnknownHostException: dev: dev: Name or service not known

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.

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=localhost,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]

Distinguished Name of the self-signed X.509 Server Certificate is:

[CN=localhost-instance,OU=GlassFish,O=Oracle Corporation,L=Santa Clara,ST=California,C=US]

Domain hongpan created.

Domain hongpan admin port is 4848.

Domain hongpan allows admin login as user "admin" with no password.

Command create-domain executed successfully.

4、啟動剛才建立的domain虹盤

asadmin start-domain hongpan

Waiting for hongpan to start .........................

Successfully started the domain : hongpan

domain  Location: /usr/local/glassfish4/glassfish/domains/hongpan

Log File: /usr/local/glassfish4/glassfish/domains/hongpan/logs/server.log

Admin Port: 4848

Command start-domain executed successfully.

5、修改剛剛建立的domain的admin密碼,並使之能夠通過web登入到控制台

asadmin change-admin-password

Enter admin user name [default: admin]>

Enter the admin password>

Enter the new admin password>

Enter the new admin password again>

Command change-admin-password executed successfully.

每次操作的時候控制台都提示輸入使用者名稱密碼,比較麻煩

可以建立密碼設定檔

AS_ADMIN_PASSWORD=xxxx

6、開啟遠程登入許可權

asadmin enable-secure-admin

Enter admin user name>

Enter admin password>

You must restart all running servers for the change in secure admin to take effect.

Command enable-secure-admin executed successfully.

7、重啟domain

asadmin restart-domain hongpan

Ubuntu 12.04 安裝 GlassFish3.1.2 

現在就可通過控制台進行管理了

 

 

更多詳情見請繼續閱讀下一頁的精彩內容:

  • 1
  • 2
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.