練功房推薦書單

  • 猛虎出柙雙劍合璧版--最新 OCA / OCP Java SE 7 Programmer 專業認證 (電子書)
  • 流浪教師存零股存到3000萬(全新增修版)(書+DVD)
  • 開始在關西自助旅行(京都‧大阪‧神戶‧奈良)(全新增訂版)
  • 不敗教主的300張股票存股術

Apache 2.2 + SSL + JK 1.2 + Tomcat 6.0 Clustering Auto Installer for CentOS 5.3 RSS feed
Forum Index » Web/Application Server
Author Message
k.irfee

十級學員

Joined: 2010/12/6
Messages: 2
Offline
I have tried your given suggestion , but my tomcat doesn't start. I have added host element in server.xml of both workers. also created /var/webapps/domainname directory.

even I can't see anything in catalina.out it is blank.

new virtualhost part from server.xml


<Host name="mycomp.khan.com" appBase=""
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="mycomp.khan.com_access_log." suffix=".txt"
pattern="combined" resolveHosts="false"/>
<Context path="" docBase="webapps/mycomp.khan.com" reloadable="false" />




I need to use webapp folder as default setup. like, in a default tomcat setup we just need to copy application war file and then it will get unpacked by tomcat . same way it can have multiple application war file deployed.

please help!

andowson

七段學員
[Avatar]

Joined: 2007/1/2
Messages: 715
Location: 台北
Offline
Dear k.irfee,
I have tried to deploy a demo.war in my host. It's very easy to do so. Just use the Tomcat's manager application. And if you followed my setup script, the Tomcat manager application should have already been installed. All you need to do is to find out the manager's password(username is "manager").

Follow the steps and you should be successfully deploy the demo.war and see the output of "Hello, world!":
1.Check the file /var/robust/worker1/conf/tomcat-users.xml and you can see the username and password of the role "manager". (You can modify it to suit your own need.)
2.Open a browser, and go to the URL: http://<your_server_ip>/manager/html. Tomcat will ask you to enter the username and password, use the information from step 1.
3.Go to the "WAR file to deploy" section, and click the browse button at the "Select WAR file to upload" field, choose the demo.war and then click the Deploy button.
4.Click on the /demo link.

Note:
1.Check the file /var/robust/worker1/conf/server.host,
Your <Host> should look like the following example:

<Host name="192.168.1.1" appBase="webapps/192.168.1.1"
unpackWARs="true" autoDeploy="true">
<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="192.168.1.1_access_log." suffix=".txt"
pattern="combined" resolveHosts="false"/>
<Context path="" docBase="" reloadable="false" />
</Host>

2.Check the permission of /var/webapps/<your_server_ip>, it should be writable by tomcat. Use the following command to fix it.
chown -R tomcat:tomcat /var/webapps/<your_server_ip>

Reference:
http://tomcat.apache.org/tomcat-6.0-doc/manager-howto.html
 Filename demo.war [Disk] Download
 Description demo.war for deploy to Tomcat test
 Filesize 1 Kbytes
 Downloaded:  4 time(s)


分享經驗 累積智慧
[WWW]
caramel

十級學員

Joined: 2011/3/7
Messages: 4
Offline
您好:

我照這篇文章去作了設定

worker1 worker2 與 httpd 都能正常start

但是我打http://localhost/ 依舊是point到httpd自己的web

打http://localhost/clustertest.jsp

出現 Service Temporarily Unavailable

然後/var/webapps 裡的東西都無法access 不知道怎麼解決

希望大大的幫忙
andowson

七段學員
[Avatar]

Joined: 2007/1/2
Messages: 715
Location: 台北
Offline
caramel您好:
請先檢查一下您主機的IP,然後cd /var/webapps,檢查目錄下有沒有一個跟主機IP相同的目錄
例如主機IP是192.168.1.1,則目錄名稱應為192.168.1.1
請改為存取下列網址看看
http://192.168.1.1/
再不行請重新啟動一次Tomcat和Apache看看
利用下列指令去檢查Tomcat是否正常啟動
netstat -an|grep 8105

netstat -an|grep 8109

分享經驗 累積智慧
[WWW]
caramel

十級學員

Joined: 2011/3/7
Messages: 4
Offline
我發現原因了

好像是SELinux在搞鬼

我把他disable後就可以開啟了^^
andowson

七段學員
[Avatar]

Joined: 2007/1/2
Messages: 715
Location: 台北
Offline
我已經把第一篇文章中的注意事項標註為紅色了
disable SELinux and firewall

分享經驗 累積智慧
[WWW]
kevinwang72326

十級學員

Joined: 2011/6/7
Messages: 1
Offline
你好:

請教一下
我可以把session replication的功能給獨立出來嗎
意思是我只要實現這個功能

andowson

七段學員
[Avatar]

Joined: 2007/1/2
Messages: 715
Location: 台北
Offline
kevinwang72326您好:
您可以自己試試看,如果有遇到問題,再把您的做法發表上來,讓大家討論。

分享經驗 累積智慧
[WWW]
 
Forum Index » Web/Application Server
Go to:   
Mobile view