Centos-Glassfish安装
2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>
1.??官網(wǎng)下載:jdk1.8.0_31????glassfish-4.1.zip
2.? cd??/usr/local
3.??tar?-xzvf??jdk1.8.0_31
4.??vi?/etc/profile???
????JAVA_HOME=/usr/local/jdk1.8.0_31 ?export?CLASSPATH=.:$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib ?export?PATH=$PATH:$JAVA_HOME/bin:$JAVA_HOME/jre/bin
5.? source?/etc/profile
6.? java?-version???查看版本信息
?
7.?cd??/root?
8.?unzip?glassfish-4.1.zip
9.?useradd?centos??groupadd?centos
10.?usermod?-a?-G?centos?centos
11.?mkdir?-p?/decompress/glassfish
12.?chown?-R?centos:centos?/decompress/glassfish
13.?cd?/decompress/glassfish
14.?mv??/root/glassfish4?/decompress/glassfish
15.??/decompress/glassfish/glassfish4/bin/asadmin?start-domain
16.??cd?/decompress/glassfish/glassfish4/bin
17.?./asadmin
18.?/asadmin?change-admin-password
????提示輸入用戶(hù)名:?直接按Enter(不要輸入,否則會(huì)報(bào)錯(cuò))
提示密碼:?直接按Enter
輸入新密碼:[usrname]glassfish
確認(rèn)密碼:[usrname]glassfish
開(kāi)啟遠(yuǎn)程訪問(wèn)權(quán)限并退出glassfish用戶(hù)
asadmin?>enable-secure-admin
asadmin?>exit
?
19..?關(guān)閉服務(wù)并重啟服務(wù)?
???vi?/root/.bash_profile????加入以下4行
???PATH=$PATH:$HOME/bin
export?PATH
PATH=/decompress/glassfish/glassfish4/bin:$PATH
export?PATH
加入以上4行,就可以用簡(jiǎn)短的命令啟動(dòng):
asadmin?stop-domain
asadmin?start-domain?
20.???http://localhost:4848(localhost安裝glassfish的服務(wù)器ip)
as-install??/glassfish4/glassfish??glassfish安裝目錄
as-install-parent?/glassfish4???glassfish目錄的父目錄(除了galssfish默認(rèn)還有其他的比如javadb)
domain-root-dir????????as-install/domains/domain-dir????默認(rèn)創(chuàng)建的domain1的位置
domain-dir??????????domain-root-dir/domain-name????domain1的各種配置目錄
instance-dir?????????domain-dir/instance-name?????domain1下面具體應(yīng)用實(shí)例名?
21.?部署應(yīng)用:1用命令部署:
????/decompress/glassfish/glassfish4/bin/asadmin?deploy?/root/hello.war???#入徑
? 登陸網(wǎng)頁(yè)http://localhost:8080/hello
卸載應(yīng)用hello.war
/decompress/glassfish/glassfish4/bin/asadmin?undeploy?hello
?
/decompress/glassfish/glassfish4/bin/asadmin?deploy?/root/cs.war???#入徑
22. 部署應(yīng)用:2通過(guò)控制臺(tái)部署:
??????http://localhost:4848
??
23??自動(dòng)部署
可以把war包拷貝到自動(dòng)部署文件夾autodeploy下面
cp?sample-dir/hello.war?as-install/domains/domain-dir/autodeploy
cp?/root/hello.war?/decompress/glassfish/glassfish4/glassfish/domains/domain1/autodeploy
24?卸載自動(dòng)部署
cd?as-install\domains\domain-dir\autodeploy
cd?/decompress/glassfish/glassfish4/glassfish/domains/domain1/autodeploy
rm?hello.war
25?啟動(dòng)javadb數(shù)據(jù)庫(kù)(如果需要的話(huà))
as-install/bin/asadmin?start-database?--dbhome?as-install-parent/javadb
/decompress/glassfish/glassfish4/bin/asadmin?start-database?--dbhome?/decompress/glassfish/glassfish4/javadb
停止javadb數(shù)據(jù)庫(kù)
as-install/bin/asadmin?stop-database
/decompress/glassfish/glassfish4/bin/asadminstop-database
26.端口號(hào)更改:
cd?/decompress/glassfish/glassfish4/glassfish/domains/domain1/config/
vi?domain.xml
將關(guān)于8080的端口改成你想要的端口號(hào)
?
glassfish域名配置:
1?yum安裝httpd,httpd-devel
2?安裝tomcat-connectors-1.2.40-src.tar.gz
tar?-zxvf??tomcat-connectors-1.2.40-src.tar.gz
cd?tomcat-connectors-1.2.40-src/native
./buildconf.sh
./configure?--with-apxs=/etc/httpd/apxs
make
編譯完成后就有mod_jk.so文件了,在
/root/tomcat-connectors-1.2.40-src/native/apache-2.0/mod_jk.so
???cp?mod_jk.so?/etc/httpd/modules
3修改httpd.conf
vi?/etc/httpd/conf/httpd.conf
增加:
LoadModule?jk_module???modules/mod_jk.so
<IfModule?!mod_jk.c>
LoadModule?jk_module??/etc/httpd/modules/mod_jk.so
</IfModule>
增加mod_jk參數(shù)和虛擬主機(jī)內(nèi)容:
#?Where?to?find?workers.properties
JkWorkersFile???conf/workers.properties
#?Where?to?put?jk?logs
JkLogFile????logs/mod_jk.log
#?Set?the?jk?log?level?[debug/error/info]
JkLogLevel????debug
#?Select?the?log?format
JkLogStampFormat?"[%a?%b?%d?%H:%M:%S?%Y]?"
#?JkOptions?indicate?to?send?SSL?KEY?SIZE,
JkOptions?????+ForwardKeySize?+ForwardURICompat?-ForwardDirectories
#?JkRequestLogFormat?set?the?request?format
JkRequestLogFormat?????"%w?%V?%T"
JkShmFile?????logs/mod_jk.shm
?
NameVirtualHost?*:80
<VirtualHost?*:80>
ServerName???www.jolycare.com
#?Send?jsp,servlet?for?context?*?to?worker?named?worker1
JkMount?/*?worker1
</VirtualHost>
4、新建workers.properties文件:
#cd?/etc/httpd/conf/
#vi?workers.properties
#?Define?1?real?worker?using?ajp13
worker.list=worker1
#?Set?properties?for?worker1?(ajp13)
worker.worker1.type=ajp13
worker.worker1.host=127.0.0.1
worker.worker1.port=8080
worker.worker1.lbfactor=1
worker.worker1.cachesize=512
worker.worker1.cache_timeout=600
worker.worker1.socket_keepalive=50
5登陸localhost:4848配置頁(yè)面(服務(wù)器ip)
首先,點(diǎn)configurations-server-config-virtual?servers在點(diǎn)new
?
在點(diǎn)save保存。
然后點(diǎn)configurations-server-config-Network?config?-network?listeners?在點(diǎn)http?listener-1
?
JK?Listener:?enabled?打勾在點(diǎn)保存
?
?
?
?
最后測(cè)試,在瀏覽器輸入:http://www.xxx.com/可以訪問(wèn)(此處你注冊(cè)的域名)
轉(zhuǎn)載于:https://my.oschina.net/lovetyh/blog/613990
總結(jié)
以上是生活随笔為你收集整理的Centos-Glassfish安装的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 消息中间件RocketMQ源码解析--
- 下一篇: 详谈分布式系统缓存的设计细节