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
檔案名稱 |
demo.war |
描述 |
demo.war for deploy to Tomcat test |
檔案大小 |
1 Kbytes
|
下載次數 |
4 次 |
下載
|
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