RE: mod_jk with Tomcat4

2002-01-19 Thread Oli Gauti Gudmundsson

OKfinally got this workingwhat a silly mistake. The socket error was
a result of the fact that the machine only had java1.2 and the setKeepAlive
method was added in jdk 1.3. Therefore, I upgraded the jdk, and Tomcat 4.01
and Apache are now serving content at great speed through mod_jk and ajp13!

Regards,
-OGG

-Original Message-
From: Oli Gauti Gudmundsson 
Sent: 19. janĂșar 2002 14:46
To: '[EMAIL PROTECTED]'
Subject: mod_jk with Tomcat4


Hi.
Has anyone managed to get Apache and Tomcat 4.01 working together with
mod_jk? If you have, could you please share with me how you configured
Tomcat (send me the server.xml file).
 
If you had any problems, could you please share how you solved them.
 
I'm pretty sure that I have configured Apache correctly (since it starts
without errors), and I have configured an AJP13 connector in server.xml. I
have also created a workers.properties where the properties are set for the
ajp13 worker. Apache and Tomcat both start without errors, but when a
request is made, it just times out.
 
The following error appears in catalina.log:
 
java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not
found at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code) at
java.lang.Thread.run(Thread.java:479)
 
Thanks for your help.
-OGG

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>




mod_jk with Tomcat4

2002-01-19 Thread Oli Gauti Gudmundsson

Hi.
Has anyone managed to get Apache and Tomcat 4.01 working together with
mod_jk?
If you have, could you please share with me how you configured Tomcat (send
me the server.xml file).
 
If you had any problems, could you please share how you solved them.
 
I'm pretty sure that I have configured Apache correctly (since it starts
without errors), and I have configured an AJP13 connector in server.xml. I
have also created a workers.properties where the properties are set for the
ajp13 worker. Apache and Tomcat both start without errors, but when a
request is made, it just times out.
 
The following error appears in catalina.log:
 
java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not
found
at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)
 
Thanks for your help.
-OGG



RE: mod_webapp: redirects to ServerName

2002-01-18 Thread Oli Gauti Gudmundsson

>> If I point my browser to http://www.mydomain.com 
>>  , Apache redirects me to 
>> http://123.45.67.89/index.jsp  , where 
>> 123.45.67.89 is the IP address of the server running the application, 
>> and is set as the ServerName in httpd.conf.

> And what is strange here? Apache recognized www.mydomain.com as an alias
fo a sort and issued a redirect to what he considered to be the real URL.

What is strange here is that this did not happen before I upgraded to
mod_webapp. Also, when you have many domain names pointing to the same IP
address, you do not want all of them to be redirected. For example, if a
user inputs http://www.mydomain2.com in his browser address window, we dont
want the address to be changed to 123.45.67.89.

>> If I change the ServerName in httpd.conf to www.mydomain.com 
>>  , then the opposite happens (that is, if I 
>> point the browser to 123.45.67.89 I get redirected to 
>> www.mydomain.com/index.jsp  ).

> Yup.

Here I am showing that this problem is directly connected to the value of
the ServerName. It seems that mod_webapp redirects all requests to the
ServerName.

>> Now the strange thing is, that if I type the full path (with the 
>> "/index.jsp" at the end), then no redirection occurs.

> Of course not. If you type http://www.mydomain.com/ you shouldn't see
redirection. You're getting redirected because of that last slash in the URL
and it is normal for Apache and web servers in general.

That's where you are wrong my friend...again. A slash at the end IS NOT
SUFFICIENT. I have to type THE FULL PATH to not be redirected.

>> This is a problem for me because I have multiple domain names pointing 
>> to the IP address, and the user is always redirected to the IP 
>> address, which is unacceptable.

> And have you defined multiple VirtualHost-s? Of course you haven't. Read
Apache docs on Virtual Hosts.

> Nix.

Once again, you are wrong. I have tried defining VirtualHosts, and that
worked partly, but that is not an acceptable solution for me. Let me explain
why. My webapp displays different content depending on the hostname, and one
of the requirements for the webapp is that when more domain names are added
(all pointing to the same IP address), no configuration or restart should
have to be done in Apache or Tomcat. You should just have to tell the webapp
to recognize it.

OGG

--
To unsubscribe:   
For additional commands: 
Troubles with the list: 




mod_jk with Tomcat 4.01 -- hangs

2002-01-17 Thread Oli Gauti Gudmundsson

Hi.
I'm trying to use mod_jk with Tomcat 4.01 (could not use mod_webapp because
of host name problems).
I'm going mad, because the connection just hangs, and I cannot locate an
error.
 
I've build the mod_jk.so without errors.
I've added the LoadModule and AddModule directives for mod_jk to httpd.conf.
I've added an include directive for mod_jk.conf to httpd.conf
I've created a workers.properties file from Tomcat 3.2 distribution.
Apache configtest returns "Syntax OK".
Apache starts up without errors:
 
[Thu Jan 17 17:41:12 2002] [notice] Apache/1.3.9 (Unix) mod_jk/1.1.0
configured -- resuming normal operations
 
I've added an AJP13 connector to my server.xml:
 


 
I made sure that the port number is the same as in workers.properties.
Tomcat starts without errors.
 
But when I make a request, it just hangs, and eventually times out.
The catalina.log shows the following error:
 
Starting service Tomcat-Apache
Apache Tomcat/4.0.1
java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not
found
at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)

And the mod_jk log shows the following:
 
[Thu Jan 17 17:42:40 2002]  [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb
[Thu Jan 17 17:42:40 2002]  [jk_ajp13.c (537)]: ajp13_marshal_into_msgb -
Done
[Thu Jan 17 17:42:40 2002]  [jk_connect.c (108)]: Into jk_open_socket
[Thu Jan 17 17:42:40 2002]  [jk_connect.c (115)]: jk_open_socket, try to
connect socket = 9
[Thu Jan 17 17:42:40 2002]  [jk_connect.c (124)]: jk_open_socket, after
connect ret = 0
[Thu Jan 17 17:42:40 2002]  [jk_connect.c (132)]: jk_open_socket, set
TCP_NODELAY to on
[Thu Jan 17 17:42:40 2002]  [jk_connect.c (140)]: jk_open_socket, return, sd
= 9
[Thu Jan 17 17:42:40 2002]  [jk_ajp13_worker.c (189)]: In
jk_endpoint_t::connect_to_tomcat, connected sd = 9
[Thu Jan 17 17:42:40 2002]  [jk_ajp13_worker.c (206)]: sending to ajp13 #328
[Thu Jan 17 17:42:40 2002]  [jk_ajp13_worker.c (645)]: send_request 2:
request body to send 0 - request body to resend 0
 
What can possibly be wrong? 
My mod_jk.conf looks like this:
 
JkWorkersFile /usr/local/tomcat/vyrecl/conf/workers.properties
JkLogFile /usr/local/tomcat/vyrecl/logs/mod_jk.log
JkLogLeveldebug
 
JkMount /*.jsp ajp13
JkMount /servlet/* ajp13
 
System info:
Tomcat 4.01
Apache 1.3.9
JDK 1.2
OS: Solaris 7

Thanks for your help.
-OGG



RE: mod_webapp: redirects to ServerName, mod_jk hangs

2002-01-17 Thread Oli Gauti Gudmundsson

Thanks for your response Nick.
I tried using mod_jk, but wasn't able to get it working. I built mod_jk.so
without errors, and put it into the $APACHE_HOME/libexec folder. I created
mod_jk.conf, and workers.properties. Then I included mod_jk.conf in
httpd.conf, and Apache started up without errors:

[Thu Jan 17 14:52:22 2002] [notice] Apache/1.3.9 (Unix) mod_jk/1.1.0
configured -- resuming normal operations

I added a AJP13 connector in $TOMCAT_HOME/conf/server.xml, and Tomcat also
started up without errors.

But when I made a request through the browser, it just timed out. When I
checked the logs, there was a small stacktrace in catalina.log:

java.lang.NoSuchMethodError: java.net.Socket: method setKeepAlive(Z)V not
found
at org.apache.ajp.tomcat4.Ajp13Connector.run(Compiled Code)
at java.lang.Thread.run(Thread.java:479)

And the mod_jk.log says:

[Thu Jan 17 15:08:55 2002]  [jk_ajp13.c (403)]: Into ajp13_marshal_into_msgb
[Thu Jan 17 15:08:55 2002]  [jk_ajp13.c (537)]: ajp13_marshal_into_msgb -
Done
[Thu Jan 17 15:08:55 2002]  [jk_connect.c (108)]: Into jk_open_socket
[Thu Jan 17 15:08:55 2002]  [jk_connect.c (115)]: jk_open_socket, try to
connect socket = 9
[Thu Jan 17 15:08:55 2002]  [jk_connect.c (124)]: jk_open_socket, after
connect ret = 0
[Thu Jan 17 15:08:55 2002]  [jk_connect.c (132)]: jk_open_socket, set
TCP_NODELAY to on
[Thu Jan 17 15:08:55 2002]  [jk_connect.c (140)]: jk_open_socket, return, sd
= 9
[Thu Jan 17 15:08:55 2002]  [jk_ajp13_worker.c (189)]: In
jk_endpoint_t::connect_to_tomcat, connected sd = 9
[Thu Jan 17 15:08:55 2002]  [jk_ajp13_worker.c (206)]: sending to ajp13 #337
[Thu Jan 17 15:08:55 2002]  [jk_ajp13_worker.c (645)]: send_request 2:
request body to send 0 - request body to resend 0

And there it just hangs

Has anyone experienced this problem??
Can anyone tell me exactly how to configure server.xml for use with mod_jk
??

My system information is following:
Tomcat 4.01
Apache 1.3.9
JDK 1.2
OS: Solaris 7

Thx for your help.
-OGG

-Original Message-
From: Nicholas Ide [mailto:[EMAIL PROTECTED]] 
Sent: 17. janĂșar 2002 14:33
To: [EMAIL PROTECTED]
Subject: Re: mod_webapp: redirects to ServerName



Oli,

My problem (encodeURL bug) is related.  If *all* you care about is getting
the hostname corrected and if you're not worried about changing ports, then
I believe switching from mod_webapp to mod_jk will solve your problem.  

It is fairly easy to get mod_jk working under tomcat 3.x -- 
and then you can copy/edit the configuration files
over to your tomcat 4.x configuration and add the connector into servlet.xml

-Nick

>Mailing-List: contact [EMAIL PROTECTED]; run by ezmlm
>List-Unsubscribe: <mailto:[EMAIL PROTECTED]>
>List-Subscribe: <mailto:[EMAIL PROTECTED]>
>List-Help: <mailto:[EMAIL PROTECTED]>
>List-Post: <mailto:[EMAIL PROTECTED]>
>List-Id: "Tomcat Users List" 
>Delivered-To: mailing list [EMAIL PROTECTED]
>From: Oli Gauti Gudmundsson <[EMAIL PROTECTED]>
>To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
>Subject: mod_webapp: redirects to ServerName
>Date: Thu, 17 Jan 2002 13:45:23 -
>MIME-Version: 1.0
>X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N
>
>Hi guys.
>I've installed Tomcat4 with Apache through mod_webapp, and it works. 
>However, I have the following problem:
> 
>If I point my browser to http://www.mydomain.com 
><http://www.mydomain.com> , Apache redirects me to 
>http://123.45.67.89/index.jsp <http://123.45.67.89/index.jsp> , where 
>123.45.67.89 is the IP address of the server running the application, 
>and is set as the ServerName in httpd.conf.
> 
>If I change the ServerName in httpd.conf to www.mydomain.com 
><http://www.mydomain.com> , then the opposite happens (that is, if I 
>point the browser to 123.45.67.89 I get redirected to 
>www.mydomain.com/index.jsp <http://www.mydomain.com/index.jsp> ).
> 
>Now the strange thing is, that if I type the full path (with the 
>"/index.jsp" at the end), then no redirection occurs.
> 
>This is a problem for me because I have multiple domain names pointing 
>to the IP address, and the user is always redirected to the IP address, 
>which is unacceptable.
> 
>Has anyone experienced this problem, or even better, solved it?
> 
>Thx for your help.
>-OGG


--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe:   <mailto:[EMAIL PROTECTED]>
For additional commands: <mailto:[EMAIL PROTECTED]>
Troubles with the list: <mailto:[EMAIL PROTECTED]>




mod_webapp: redirects to ServerName

2002-01-17 Thread Oli Gauti Gudmundsson

Hi guys.
I've installed Tomcat4 with Apache through mod_webapp, and it works.
However, I have the following problem:
 
If I point my browser to http://www.mydomain.com  ,
Apache redirects me to http://123.45.67.89/index.jsp
 , where 123.45.67.89 is the IP address of
the server running the application, and is set as the ServerName in
httpd.conf.
 
If I change the ServerName in httpd.conf to www.mydomain.com
 , then the opposite happens (that is, if I point
the browser to 123.45.67.89 I get redirected to www.mydomain.com/index.jsp
 ).
 
Now the strange thing is, that if I type the full path (with the
"/index.jsp" at the end), then no redirection occurs.
 
This is a problem for me because I have multiple domain names pointing to
the IP address, and the user is always redirected to the IP address, which
is unacceptable.
 
Has anyone experienced this problem, or even better, solved it?
 
Thx for your help.
-OGG



Tomcat 4.01 + Apache 1.3 + mod_webapp: problem with root context

2002-01-16 Thread Oli Gauti Gudmundsson

Hey everyone.
I've been looking for a solution to my problem for two days now, scanning
through the archives without any luck. So, I'm hoping someone here can help
me.
 
Following are the specs of my system:
 
Tomcat 4.01
Apache 1.3
JDK 1.2
Solaris 7
 
I built Apache and mod_webapp, and Tomcat now successfully serves up dynamic
content through Apache.
 
Before I can describe the problem, I'll have to give you some background
information. 
 
The first thing you need to know, is that I have a number of domain names
all pointing to the same IP address (server1.mydomain.com,
server2.mydomain.com, etc.). Apache listens on that IP address, and the same
web application serves all those domain names. The thing is that my web
application responds differently to the different domain names. For example
if the user goes to server1.mydomain.com in his browser, he gets a different
looking page than if he would go to server2.mydomain.com. The web
application selects the right content by reading the hostname.
 
The second thing you need to know, is that the webapp runs in the root
context.
 
Now, I've put the following lines into my httpd.conf:
 
WebAppConnection conn warp localhost:8044
WebAppDeploy mywebapp conn /

(and yes, I deliberately changed the warp port to 8044 for reasons that are
not the subject of this discussion). Also the ServerName in httpd.conf is
set to the IP address of the server.
 
Let's say that my IP address is 123.45.67.89. Now, if I point my browser to
http://123.45.67.89  , the webapplication serves up
dynamic content. But if I point it to http://server1.mydomain.com
  (which is pointing to 123.45.67.89), it
redirects me to http://123.45.67.89  . The same goes
for server2.mydomain.com, etc. 
 
And things get even stranger. If I include the index.jsp in the path, then
the server does not redirect!!! That is, if I point the browser to
http://server1.mydomain.com/index.jsp
  (appending the "/index.jsp"), then
Apache does not redirect and the webapp can serve the correct content.
 
This just started to happen after I upgraded Tomcat from 3.2 using mod_jserv
to Tomcat 4.01 using mod_webapp.
 
I know that you can add virtual hosts in httpd.conf, but that is an
unacceptable solution for me, because the httpd.conf should not be edited if
a new domain name is added.
 
I need some workaround for this, so that the hostname that the user inputs
stays the same.
 
If you can think of a solution, please bear in mind that it must fulfill the
following requirements:
 
1. The webapp MUST run in the root context.
2. The Apache httpd.conf SHOULD NOT HAVE TO BE EDITED if a new domain name
pointing to the IP address of the server is added.
 
Any help is greatly appreciated.
 
Gauti.