Yichuan Wang

Greenhorn
+ Follow
since Jan 17, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Yichuan Wang

Originally posted by Bear Bibeault:

Why bother? Save yourself a ton of headaches and just let Tomcat serve everything.

Is there a reason you want to use Apache?


well, for solely test purpose , it is true that only Tomcat is sufficient. but don't most of ISP providers use Apache+Tomcat on their servers? If they do, why not we,
My question is that is it worth to do it?
16 years ago
Hi, There is a problem occurred when I tried to make Tomcat and Apache work together.
I have both Tomcat and Apache installed on my desktop, an additional helper
software(Jakarta Tomcat connecter) is also installed which connects Apache with Tomcat.
When there is a static html page, apache handles it, and when there is a JSP page apache passes it over to Tomcat.


When I use port 80(Apache):
It works perfectly when it processes JSP pages, but it just can not process servlets.

This is the configuration I added to Apache httpd.conf








anybody could possibly tell me why?
or should I change line:JkMount /servlet/* ajp13
to something else?
16 years ago

Originally posted by Ben Souther:
I'm going to move this to our Apache / Tomcat forum.

The forum covers Tomcat more than the Apache Web Server but someone there might be able to help you with the connector configuration.



Yes please, and I desperately need answers
16 years ago

Originally posted by Ben Souther:
If you're using something more than just Tomcat, it's a good idea to mention that upfront. I didn't know that you were connecting Tomcat to the Apache Web Server till now.


These days, I use Tomcat as a standalone so I'm out of practice when it comes to connecting it to other web servers.

Maybe someone else can assist you in getting the two to cooperate.



Sorry about the confusion, I should have mentioned that at the very beginning, but I did not know this was the cause of the problem.

hope somebody else could know more about the problem.
16 years ago

Originally posted by Ben Souther:




The default port for non-secure HTTP is 80.
If you don't specify a port the browser will automatically use port 80.

For a couple reasons, Tomcat ships with its default port set to 8080.
You can change it by editing your tomcat/conf/server.xml file.
Look for the <Connector ... /> entry that its port attribute set to 8080 and change it to 80. Restart Tomcat and you can use the URL that you mentioned.


Hi Ben, thanks for your reply,
I think now I found out why http://localhost:8080/Test/hello works where http://localhost/Test/hello doesn't. but I still don't know how to fix it yet. The reason for why port 80 doesn't work is because Apache can not handles Servlet properly. It appears that it can properly handles JSP and Do files but not Servlets, there could be something wrong with the configuration of the helper program(Jakarta Tomcat connector).
I have both Tomcat and Apache installed on my desktop, an additional helper
software(Jakarta Tomcat connecter) is also installed which connects Apache with Tomcat.
When there is a static html page, apache handles it, and when there is a JSP page apache passes it over to Tomcat.


When I use port 80(Apache):
It works perfectly when it processes JSP pages, but it just can not process servlets.

This is the configuration I added to Apache httpd.conf


anybody could possibly tell me why?
or should I change line:JkMount /servlet/* ajp13
to something else?
[ January 20, 2008: Message edited by: Yichuan Wang ]
16 years ago

Originally posted by Christophe Verre:

Please move your application under webapps, not under ROOT :
I:\Web\Tomcat 6.0\webapps\Test\WEB-INF\classes

Also, you'll probably have to access Tomcat at port 8080 :
http://localhost:8080/Test/hello



I tried it in your way, and it works,
but I've got a new question:it works when I use
http://localhost:8080/Test/hello
but if use http://localhost/Test/hello, then the error message
pops up again.
16 years ago

Originally posted by Christophe Verre:

Please move your application under webapps, not under ROOT :
I:\Web\Tomcat 6.0\webapps\Test\WEB-INF\classes

Also, you'll probably have to access Tomcat at port 8080 :
http://localhost:8080/Test/hello



Thanks for your reply,
first, can you please tell me why should I move it to webapp directory?
isn't the ROOT directory supposed to be the default directory for WWW access??

I use both apache and Tomcat for WWW accessing on my machine, where
Apache is for rendering static html, Tomcat is for JSP and servlets.
16 years ago
Hi everyone, I am new to this forum.
I come across a problem when I was doing the example from "Head First Servlet and JSP"(page 30-31).

I wrote a Servlet (HelloWorldTest), compiled it (no error) and placed it
in :I:\Web\Tomcat 6.0\webapps\ROOT\Test\WEB-INF\classes
THe WEB-INF file is placed
in: I:\Web\Tomcat 6.0\webapps\ROOT\Test\WEB-INF

When I tried to access the servlet using:
http://localhost/Test/hello
got the following message
Not Found

The requested URL /Test/hello was not found on this server.


Servlet File:


Here is my WEB-INF file:

Anybody can tell me what is wrong with my code??
thanks very much
[ January 19, 2008: Message edited by: Bear Bibeault ]
16 years ago