dzho002 回复于:2003-12-23 07:58:02 |
我的DocumentRoot 是这样的:
DocumentRoot "/usr/local/tomcat/webapps/jsp-examples" 当我用 http://localhost/index.html, 我可以看到JSP例子的那页, 但我点一个JSP程序, TOMCAT 报错, 找不到文件. 当我用 http://localhost/index.jsp, 我可以看到JSP例子的那页, 但是看不到网页上的图标. 连过去的JSP程序到是可以运行. 这是为啥? |
jhsea3do 回复于:2003-12-23 09:40:24 |
5.0是个不成熟的产品,当你使用5.0代替4.1时你会发现很多webapp不能正常工作,因为5.0不支持JSP1.2,而支持JSP2.0 |
dzho002 回复于:2003-12-24 05:24:06 |
[b:8a23c5158b]Tomcat 5.0.6 + jk2 + Apache 2.0[/b:8a23c5158b]
dzho002 [b:8a23c5158b]Install tomcat[/b:8a23c5158b] [code:1:8a23c5158b]cp jakarta-tomcat-5.0.16.tar.gz /usr/local cd /usr/local tar xzvf jakarta-tomcat-5.0.16.tar.gz ln -s jakarta-tomcat-5.0.16 tomcat rm -f jakarta-tomcat-5.0.16.tar.gz [/code:1:8a23c5158b] Add following lines to /etc/profile, and tomcat should work beyond this point. [code:1:8a23c5158b]export PATH=/usr/local/j2sdk1.4.2_01/bin:$PATH export JAVA_HOME=/usr/local/j2sdk1.4.2_01 export CATALINA_HOME=/usr/local/tomcat [/code:1:8a23c5158b] [b:8a23c5158b]Test Tomcat[/b:8a23c5158b] [code:1:8a23c5158b]source /etc/profile /usr/local/tomcat/bin/startup.sh It is time to open the page http://localhost:8080/ in mozilla to watch the cat(tiger). /usr/local/tomcat/bin/shutdown.sh [/code:1:8a23c5158b] [b:8a23c5158b]Install Apache 2[/b:8a23c5158b] [code:1:8a23c5158b] tar xzvf httpd-2.0.48.tar.gz cd httpd-2.0.48 ./configure --prefix=/usr/local/apache --enable-ssl --enable-so make make install [/code:1:8a23c5158b] [b:8a23c5158b]Test apache2[/b:8a23c5158b] [code:1:8a23c5158b]/usr/local/apache/bin/apachectl start [/code:1:8a23c5158b] There is a complaint: "httpd: Could not determine the server's fully qualified domain name, using 127.0.0.1 for ServerName" Donot know why yet. Now, open the page http://localhost/ to see the Apache main page from Mozilla. [code:1:8a23c5158b]/usr/local/apache/bin/apachectl stop[/code:1:8a23c5158b] [b:8a23c5158b]Install jk2[/b:8a23c5158b] [code:1:8a23c5158b] tar xzvf jakarta-tomcat-connectors-jk2-2.0.2-src.tar.gz cd jakarta-tomcat-connectors-jk2-2.0.2-src/jk/native2 ./configure --with-apxs2=/usr/local/apache/bin/apxs make ls ../build/jk2/apache2/*.so ../build/jk2/apache2/jkjni.so ../build/jk2/apache2/mod_jk2.so cp ../build/jk2/apache2/*.so /usr/local/apache/modules/ [/code:1:8a23c5158b] [b:8a23c5158b]Edit /usr/local/apache/conf/httpd.conf[/b:8a23c5158b] Add a line to load the jk2 module. [code:1:8a23c5158b]LoadModule jk2_module modules/mod_jk2.so [/code:1:8a23c5158b] [b:8a23c5158b]Edit /usr/local/tomcat/conf/jk2.properties[/b:8a23c5158b] It finnally looks like: (jk2 connector over TCP socket.) [code:1:8a23c5158b][shm] shm.file=/usr/local/tomcat/logs/jk2.shm size=1048576 handler.list=apr,request,channelSocket channelSocket.port=8009 [/code:1:8a23c5158b] Edit /usr/local/apache/conf/workers2.properties If it is not there, just create one by: [code:1:8a23c5158b] touch /usr/local/apache/conf/workers2.properties [/code:1:8a23c5158b] [code:1:8a23c5158b] [shm] shm.file=/usr/local/tomcat/logs/jk2.shm size=1048576 [channel.socket:localhost:8009] tomcatId=localhost:8009 [ajp13:localhost:8009] channel=channel.socket:localhost:8009 worker=ajp13:localhost:8009 [uri:/jsp-examples/*] [uri:/servlets-examples/*] [uri:/JSPWiki/*] [/code:1:8a23c5158b] Edit /usr/local/tomcat/conf/server.xml Just find and comment out the following HTTP/1.1 connector. Looks like it still works fine even if I donot do it. [code:1:8a23c5158b] <!-- Define a non-SSL Coyote HTTP/1.1 Connector on port 8080 --> <!-- <Connector port="8080" maxThreads="150" minSpareThreads="25" maxSpareThreads="75" enableLookups="false" redirectPort="8443" acceptCount="100" debug="0" connectionTimeout="20000" disableUploadTimeout="true" /> --> [/code:1:8a23c5158b] Now it is time to test apache + tomcat http://localhost/ ---> open the default page of apache. http://localhost/servlets-examples/ ---> open the servlets-examples page of tomcat. http://localhost/jsp-examples/ ---> open the servlets-examples page of tomcat. Done! Some optional steps: A puzzle: If I use this uri in the workers2.properties, [uri:/*.jsp] worker=ajp13:localhost:8009 http://localhost/ ---> open the default page of apache. http://localhost/index.jsp ---> open the main page of tomcat, but all images are missing. This is what I want if somebody can find those images back for me. Modify /usr/local/tomcat/conf/tomcat-users.xml Add two roles and a user with those roles, so dan can admin/manage tomcat via web. <role rolename="manager"/> <role rolename="admin"/> <user username="dan" password="tomcat" roles="manager,admin,tomcat,role1"/> Start tomcat and try these two pages. http://localhost:8080/admin/ http://localhost:8080/manager/html/ The first page looks very complicated, while the second one allows you to start/stop any JSP program in Tomcat easily. [b:8a23c5158b]To Run tomcat as a no-root user[/b:8a23c5158b] [code:1:8a23c5158b]groupadd tomcat useradd -g tomcat -c "A Big Cat", -d /usr/local/tomcat tomcat passwd tomcat chown tomcat:tomcat /usr/local/tomcat chown -R tomcat:tomcat /usr/local/jakarta-tomcat-5.0.16 su - tomcat -c /usr/local/tomcat/bin/startup.sh su - tomcat -c /usr/local/tomcat/bin/shutdown.sh [/code:1:8a23c5158b] References [url]http://www.greenfieldresearch.ca/technical/jk2_config.html[/url] [url]http://johnturner.com/howto.apache2-tomcat4127-jk-rh9-howto.html[/url] |
黑色 回复于:2004-01-12 13:26:33 |
請教一下,我照著上面所述,做到make的時侯
出現 libtool: install: warning: remember to run `libtool --finish /usr/local/httpd/m dules' make[1]: Leaving directory `/misc/tomcat4/jakarta-tomcat-connectors-jk2-2.0.2-s c/jk/native2/server/apache2' 然後去看 build/jk2/apache2 裡面只有一堆.o跟.lo沒有.so >_< 請問各位高手,我是少了什麼步驟沒做嗎?? |
dennis2 回复于:2004-01-12 17:02:49 |
[quote:ca142f9261="jhsea3do"]5.0是个不成熟的产品,当你使用5.0代替4.1时你会发现很多webapp不能正常工作,因为5.0不支持JSP1.2,而支持JSP2.0[/quote:ca142f9261]
“因为5.0不支持JSP1.2,而支持JSP2.0” 所以得出结论 “5.0是个不成熟的产品”? 什么逻辑 |
jhsea3do 回复于:2004-01-12 22:37:06 |
[quote:ea599ead34="dennis2"]
“因为5.0不支持JSP1.2,而支持JSP2.0” 所以得出结论 “5.0是个不成熟的产品”? 什么逻辑[/quote:ea599ead34] 请问你有没有亲手编写过jsp,如果没有就不要说这样的话 :em22: ! 5.0不仅仅是对jsp得支持和4.1存在分歧,而且对servlet的支持也和4.1有出入,而且servlet一般都是被封装的class,你无法修改! |
dennis2 回复于:2004-01-13 01:16:07 |
[quote:173b9bc48b="jhsea3do"]
5.0不仅仅是对jsp得支持和4.1存在分歧,而且对servlet的支持也和4.1有出入,而且servlet一般都是被封装的class,你无法修改![/quote:173b9bc48b] 你只能说 5.0 对以前版本的应用不支持(或支持得不够好),而不是不成熟。Tomcat 5 很早就已经稳定下来了,只不过一直在等着新的标准出来,它才出正式的稳定版。而这个新标准的出台,也是酝酿了很久很久了。 如果把给 4.1 版本写的应用原封不动地搬到 5.0 使用,无异于自找麻烦。但是新的应用就没必要再针对 4.1 版写了,因为 JSP 2.0 相对 1.2 有了很大改进。当然具体情况具体分析,但你却不能说 5.0 版不成熟。 |
linuxsky 回复于:2004-02-16 14:47:43 |
我在一台机上也发现apache2目录下没有一个.so的文件
但以前在Redhat9 下面就可以 出的错也和黑色网友的一样 |
dennis2 回复于:2004-02-16 14:57:01 |
编译出的模块 .so 文件在 .libs 目录下。 |
linuxsky 回复于:2004-02-16 16:02:04 |
[quote:8f117d4dc1="dennis2"]编译出的模块 .so 文件在 .libs 目录下。[/quote:8f117d4dc1]
没有啊。我刚又试了一把 还是没看到 .libs目录下也没有.so的文件 |
dennis2 回复于:2004-02-17 09:38:05 |
如果你编译 jk2 没问题的话,.so 文件应该在 jakarta-tomcat-connectors-jk2-2.0.2-src/jk/build/jk2/apache2 下。 |
linuxsky 回复于:2004-02-17 10:58:33 |
是没有的。我以前编成功过
那是在Redhat9.0环境下 最近换成了AS3.0 就成功不了 连试几台机都一样。真是惨。 不过我用以前9.0下编好的so文件拷过去,还是可以用。就不知道会不会有其它问题 另外:我想问一下,如果我在httpd.conf里指定DocumentRoot /www 我希望这个目录下可以执行php 还有jsp html 等.. 我还需要在server.xml里怎么设置?或其它地方设置? |
只爱一点点 回复于:2004-02-17 14:01:10 |
好像不会有问题,只要和apache版本对应就行了吧? |
云海天涯 回复于:2004-02-17 15:45:48 |
good ,thank you |
kevinkan 回复于:2004-02-23 10:42:43 |
我整合 apach+tomcat的时候,在最好加上以下的语句
WebAppConnection warpConnection warp localhost:8080 WebAppDeploy examples warpConnection /examples/ 在重启的时候就出现了 Invalid virtual host name 究竟在那里解决这个问题? |
只爱一点点 回复于:2004-02-23 23:31:50 |
楼上用什么整合的?
JK2是不用上面的方面的吧? |
kpflysky 回复于:2004-02-24 17:51:18 |
谁有没有单独安装tomcat5.0的经验
我的servlet怎么不能部署上去 总提示servlet/*不存在 在4.0没有问题的 是标准的servlet |
caojiqun 回复于:2004-02-24 22:37:55 |
也许你要做一下servlet映射或是修改全局的server.xml |
jessicar 回复于:2004-03-24 19:07:17 |
拜托了!!!!!!!!! |
hfh08 回复于:2005-06-04 12:02:55 |
怎么安装上数据库啊
没有数据库 我认为这些都白做了啊 |