how to upgrade tomcat 8.5.x?

2017-05-16 Thread modjklist
First-time Tomcat user here. I installed 8.5.9months ago, and would like to 
upgrade to the latest 8.5.15. I see there's some documentation for updating the 
8.5.x branch here, 


http://tomcat.apache.org/migration-85.html#Upgrading_8.5.x


but I'm missing some context. I have a fairly simple install/application, and 
wonder what the conventional wisdom is how to perform the update.


I assume I need to shutdown Tomcat. Then, is there a set of directories I 
should just replace to perform the update? Are these directories listed 
somewhere? Then do I just restart Tomcat to finalize the update? Any advice 
much appreciated (the more specific the better). Thanks in advance, Gerry

Re: 404 errors accessing webapp URLs using local IP address on fresh Tomcat 8.5.9 install

2017-01-10 Thread modjklist
Thanks for the help Christopher, 

I resolved this by adding 192.168.0.2 to hostB's httpd.conf file as a 
VirtualHost, then including JkMount for mod_jk. 

- Original Message -

From: "Christopher Schultz"  
To: "Tomcat Users List"  
Sent: Tuesday, January 10, 2017 11:50:27 AM 
Subject: Re: 404 errors accessing webapp URLs using local IP address on fresh 
Tomcat 8.5.9 install 

-BEGIN PGP SIGNED MESSAGE- 
Hash: SHA256 

To whom it may concern, 

On 1/9/17 12:57 AM, modjkl...@comcast.net wrote: 
> I have two Linux servers connected via a cross-connect cable with 
> internal IP addresses 192.168.0.1 (hostA) and 192.168.0.2 (hostB). 
> 
> 
> hostA runs CentOS 5, and hostB CentOS 7. 
> 
> hostB runs Apache 2.4.x, and Tomcat 8.5.9. All web traffic gets 
> routed to port 443 (e.g. HTTPS) of Apache web server hostB. All web 
> application traffic (e.g. 
> https://www.example.com/mywebapp/somepage) is then passed to Tomcat 
> via mod_jk version 1.2.42 on port 8009. Additionally, hostB Apache 
> web server is configured to listen on 192.168.0.2 port 8009 (hostA 
> Apache web server is not configured as such). 
> 
> If hostA attempts to access a webpage on hostB (via hostB external 
> IP address) from a browser or command line, such as: [root@hostA 
> ~]# curl -I http://www.example.com/mywebapp/somepage 
> 
> it returns status 200 (good). 
> 
> Now, if I modify the hostA /etc/hosts file hostA accesses to my 
> website (www.example.com) on hostB through the cross-connect cable 
> (e.g. 192.168.0.2 rather than the external IP address), the webpage 
> returns error 404. 
> 
> What can I change to get status 200? 
> 
> My web addresses are xxx.xxx.xxx.xxx (e.g. IPv4). I know Tomcat 
> configures IPv6 by default. So, I modified the setenv.sh as 
> follows: 
> 
> CATALINA_OPTS="-Xms512M -Xmx1024M -Djava.awt.headless=true 
> -Djava.net.preferIPv4Stack=true 
> -Djava.net.preferIPv4Addresses=true" 
> 
> This didn't change the result. 
> 
> As another clue, I observe that hostA always reports status 200 
> (good) when accessing any hostB webpage in www.example.com that is 
> NOT part of /mywebapp, for both internal and external IP addresses. 
> 
> 
> Any ideas what I can try to resolve this? I'm new to Tomcat and 
> this is fresh install (previously used GlassFish) on a brand new 
> server. Thanks in advance for any advice. 

What does hostA say when you issue "host [hostB]" from the command-line? 

- -chris 
-BEGIN PGP SIGNATURE- 
Comment: GPGTools - http://gpgtools.org 
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ 

iQIcBAEBCAAGBQJYdTsDAAoJEBzwKT+lPKRYQY8QAL2d3o6cqoNJ4ENxOA9al6i+ 
VETnlJ5JjDsAC0hzbd0c8eRZj8NryptV9hbx7nmVeIRNs+Pgr56BxIsmih+QGT+p 
vDCdeJEfcYXPdStpPOmBu1u+FfCJDIUEFevxigqYsvav/1UUXdoV3aW8ThyQaddd 
30ecS9NmTaijYZjHA/ufTOymuFgSnwAwkO7PbwV1hWG/JNqnXNLM+Dywkv/5CqH/ 
DpbquCyiDrvDZVCBsvOUIRGfXyH3czxOHycGfl8GarNoskuvrc9gxHkSwc3HvIau 
qlfd7g9SICwrLeVcm02SbTkkUJV/xIV6p5csPMKt5bID3+MciX+XjOoFlo6GWVGY 
6UtZ0OFvznvgb2wgOMEmf9N1ORqj1a8765VDae2oTJhpNoygW55/WwJT/s24gohz 
xEGTw5Fqddo8s8IzTWbIOChWSwQ1V/1gtjJJgn/O/JUyAobFvMipWAGLztfo/w4V 
+shtlh/+rRAigFrgc7cYAfp4+SMbnDCD4MBJHBdrgjAQuH1bg4+CbdN6WkhNsi0+ 
rcPFUJUQPxmdN1HtYAUmeXXEfMPuMJNhP3Dsq6L7RpEmKAFdkwrPe2AXkP/TzbeH 
yy/4M1Ng1EBMZuWHnEylo3o0A4qtp139o3B/gJiwZ5CVnQXxCwv0MsjiY9Z6wPPm 
FuzFy8TTIECLskz4vn5C 
=LNg6 
-END PGP SIGNATURE- 

- 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
For additional commands, e-mail: users-h...@tomcat.apache.org 




Re: 404 errors accessing webapp URLs using local IP address on fresh Tomcat 8.5.9 install

2017-01-08 Thread modjklist
I should mention that to configure hostB (e.g. 192.168.0.2) to listen to hostA 
(e.g. 192.168.0.1), I simply added 

Listen 192.168.0.2:80 
Listen 192.168.0.2:443 

to hostB httpd.conf file. I did not create a virtual host (is that OK?). I also 
didn't modify httpd.conf on hostA. 

- Original Message -

From: modjkl...@comcast.net 
To: "Tomcat Users List"  
Sent: Sunday, January 8, 2017 9:57:32 PM 
Subject: 404 errors accessing webapp URLs using local IP address on fresh 
Tomcat 8.5.9 install 

I have two Linux servers connected via a cross-connect cable with internal IP 
addresses 192.168.0.1 (hostA) and 192.168.0.2 (hostB). 

hostA runs CentOS 5, and hostB CentOS 7. 

hostB runs Apache 2.4.x, and Tomcat 8.5.9. All web traffic gets routed to port 
443 (e.g. HTTPS) of Apache web server hostB. All web application traffic (e.g. 
https://www.example.com/mywebapp/somepage) is then passed to Tomcat via mod_jk 
version 1.2.42 on port 8009. Additionally, hostB Apache web server is 
configured to listen on 192.168.0.2 port 8009 (hostA Apache web server is not 
configured as such). 

If hostA attempts to access a webpage on hostB (via hostB external IP address) 
from a browser or command line, such as: 
[root@hostA ~]# curl -I http://www.example.com/mywebapp/somepage 

it returns status 200 (good). 

Now, if I modify the hostA /etc/hosts file hostA accesses to my website 
(www.example.com) on hostB through the cross-connect cable (e.g. 192.168.0.2 
rather than the external IP address), the webpage returns error 404. 

What can I change to get status 200? 

My web addresses are xxx.xxx.xxx.xxx (e.g. IPv4). I know Tomcat configures IPv6 
by default. So, I modified the setenv.sh as follows: 

CATALINA_OPTS="-Xms512M -Xmx1024M -Djava.awt.headless=true 
-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" 

This didn't change the result. 

As another clue, I observe that hostA always reports status 200 (good) when 
accessing any hostB webpage in www.example.com that is NOT part of /mywebapp, 
for both internal and external IP addresses. 

Any ideas what I can try to resolve this? I'm new to Tomcat and this is fresh 
install (previously used GlassFish) on a brand new server. Thanks in advance 
for any advice. 



404 errors accessing webapp URLs using local IP address on fresh Tomcat 8.5.9 install

2017-01-08 Thread modjklist
I have two Linux servers connected via a cross-connect cable with internal IP 
addresses 192.168.0.1 (hostA) and 192.168.0.2 (hostB). 

hostA runs CentOS 5, and hostB CentOS 7. 

hostB runs Apache 2.4.x, and Tomcat 8.5.9. All web traffic gets routed to port 
443 (e.g. HTTPS) of Apache web server hostB. All web application traffic (e.g. 
https://www.example.com/mywebapp/somepage) is then passed to Tomcat via mod_jk 
version 1.2.42 on port 8009. Additionally, hostB Apache web server is 
configured to listen on 192.168.0.2 port 8009 (hostA Apache web server is not 
configured as such). 

If hostA attempts to access a webpage on hostB (via hostB external IP address) 
from a browser or command line, such as: 
[root@hostA ~]# curl -I http://www.example.com/mywebapp/somepage 

it returns status 200 (good). 

Now, if I modify the hostA /etc/hosts file hostA accesses to my website 
(www.example.com) on hostB through the cross-connect cable (e.g. 192.168.0.2 
rather than the external IP address), the webpage returns error 404. 

What can I change to get status 200? 

My web addresses are xxx.xxx.xxx.xxx (e.g. IPv4). I know Tomcat configures IPv6 
by default. So, I modified the setenv.sh as follows: 

CATALINA_OPTS="-Xms512M -Xmx1024M -Djava.awt.headless=true 
-Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true" 

This didn't change the result. 

As another clue, I observe that hostA always reports status 200 (good) when 
accessing any hostB webpage in www.example.com that is NOT part of /mywebapp, 
for both internal and external IP addresses. 

Any ideas what I can try to resolve this? I'm new to Tomcat and this is fresh 
install (previously used GlassFish) on a brand new server. Thanks in advance 
for any advice. 


does Tomcat 8.5.9 have UTF-8 encoding throughout by default?

2017-01-07 Thread modjklist
Anyone know if it has UTF-8 encoding throughout out-of-the-box, or do I need to 
configure it to be so? 

I'm seeing some headers using iso-8859-1 and I'm not sure where they're being 
generated. 


help resolving memory leak error message

2017-01-06 Thread modjklist
I'm porting a Apache Flex (with Apache BlazeDS) web app from glassfish to 
tomcat 8.5.9, and observing the following severe error.  

06-Jan-2017 13:49:07.644 SEVERE 
[ContainerBackgroundProcessor[StandardEngine[Catalina]]] 
org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks 
The web application [myApp] created a ThreadLocal with key of type 
[java.lang.ThreadLocal] (value [java.lang.ThreadLocal@4d6e6d7b]) and a value of 
type [flex.messaging.io.SerializationContext] (value 
[flex.messaging.io.SerializationContext@66135428]) but failed to remove it when 
the web application was stopped. Threads are going to be renewed over time to 
try and avoid a probable memory leak. 

Is this a warning or an actual error that is causing a memory leak?

Can anyone point me in the right direction to resolve this? I'm a new Tomcat 
user (please try to be explicit). 

Thanks for any advice/comments.

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



basic logging info

2017-01-05 Thread modjklist
Newbie Tomcat user here. I installed Tomcat 8.5.9 on CentOS 7 a few days ago 
and noticed the default log files for catalina, host-manager, localhost, and 
manager are created fresh each day with a date in their filename. 

Doesn't this fill up the directory over time? Wouldn't it be better to have the 
logs accumulate in one file for some time? 

Can someone set my expectations what the default logging behavior is, then 
recommend a general approach to configuring something more manageable (from a 
sheer number-of-files standpoint)? 


mod-jk reports errors when downloading files above 4 MB, but runs fine for smaller file sizes

2014-10-17 Thread modjklist
Hi, I'm using mod-jk (v1.2.40) on CentOS Linux server to pass requests from 
Apache web server (v2.4.9) to GlassFish (v3.1.2) application server. I'm using 
a java 7 servlet (shown below) on my application server to enable a client to 
download a PDF file via HTTPS. 

Things work fine when this file size is less than about 4 MB. When the file is 
larger than 4 MB, I see the following errors in the mod_jk.log file:

[info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized
[error] ajp_connection_tcp_get_message::jk_ajp_common.c (1313): wrong message 
format 0xcad5 from ::1:8009
[error] ajp_get_reply::jk_ajp_common.c (2204): (worker1) Tomcat is down or 
network problems. Part of the response has already been sent to the client
[info] ajp_service::jk_ajp_common.c (2673): (worker1) sending request to tomcat 
failed (recoverable), because of protocol error (attempt=1)
[info] ajp_process_callback::jk_ajp_common.c (2000): Writing to client aborted 
or client network problems
[info] ajp_service::jk_ajp_common.c (2673): (worker1) sending request to tomcat 
failed (unrecoverable), because of client write error (attempt=2)
[info] jk_handler::mod_jk.c (2799): Aborting connection for worker=worker1

I'm not an expert here, and wondered if anyone could decode this to find root 
cause and solution. There are no errors in Apache or GlassFish log files. When 
I run the client Google Chrome browser (for example), it appears to download 
the first 4 MB and then report network error. Other browsers behave 
similarly. Mod_jk appears to have the only log file reporting an error. 

Other miscellaneous thoughts: 

1. My server doesn't have a firewall limiting file size. 

2. My client router/modem doesn't limit file download size (I download much 
larger files often). 

3. As far as I'm aware, the Java code below doesn't restrict the file size 
download (can anyone confirm? perhaps mod-jk is complaining about the header or 
content type?). 

4. GlassFish timeout is 15 minutes, and the browser stops downloading after 
perhaps 10 seconds.

I'm running out of things to check. What could it be? Any help is MUCH 
appreciated. Thanks.


-- Java Servlet --

public class GetFile extends HttpServlet {

@Override
public void init(ServletConfig config) throws ServletException {
  super.init(config);
}

protected void doPost(HttpServletRequest req, HttpServletResponse res)
  throws ServletException, IOException {

String filename =init_java;

try {

// get user parameters
filename = req.getParameter(fileId);  // complete path to file
//res.setContentType(video/mp4);  //not working
res.setContentType(application/x-download);  

File file=new File(filename);

if (file.exists()) {

res.setHeader(Content-Disposition, inline; 
filename=\+filename+\);
res.setHeader(Cache-Control, cache, must-revalidate);
//res.setHeader(Pragma, public); // not sure when to use
returnFile(filename, res.getOutputStream());

} else {
//error handling goes here
} 

} catch (Exception e) {
...
} finally {
... 
}
}


private static void returnFile(String filename, OutputStream out) throws 
FileNotFoundException, IOException {
  InputStream in = null;
  try {
  in = new BufferedInputStream(new FileInputStream(filename));
  byte[] buf = new byte[4 * 1024]; // 4K buffer
  int bytesRead;
  while ((bytesRead = in.read(buf)) != -1) {
  out.write(buf, 0, bytesRead);
  }
  out.flush();

  } finally {
  if (in != null) in.close();
  }
}

}

-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod-jk reports errors when downloading files above 4 MB, but runs fine for smaller file sizes

2014-10-17 Thread modjklist
Thanks so much! 

- Original Message -

From: Christopher Schultz ch...@christopherschultz.net 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, October 17, 2014 5:01:49 PM 
Subject: Re: mod-jk reports errors when downloading files above 4 MB, but runs 
fine for smaller file sizes 

-BEGIN PGP SIGNED MESSAGE- 
Hash: SHA256 

To whom it may concern, 

On 10/17/14 4:51 PM, modjkl...@comcast.net wrote: 
 Hi, I'm using mod-jk (v1.2.40) on CentOS Linux server to pass 
 requests from Apache web server (v2.4.9) to GlassFish (v3.1.2) 
 application server. I'm using a java 7 servlet (shown below) on my 
 application server to enable a client to download a PDF file via 
 HTTPS. 
 
 Things work fine when this file size is less than about 4 MB. When 
 the file is larger than 4 MB, I see the following errors in the 
 mod_jk.log file: 
 
 [info] init_jk::mod_jk.c (3383): mod_jk/1.2.40 initialized [error] 
 ajp_connection_tcp_get_message::jk_ajp_common.c (1313): wrong 
 message format 0xcad5 from ::1:8009 [error] 
 ajp_get_reply::jk_ajp_common.c (2204): (worker1) Tomcat is down or 
 network problems. Part of the response has already been sent to the 
 client [info] ajp_service::jk_ajp_common.c (2673): (worker1) 
 sending request to tomcat failed (recoverable), because of protocol 
 error (attempt=1) [info] ajp_process_callback::jk_ajp_common.c 
 (2000): Writing to client aborted or client network problems [info] 
 ajp_service::jk_ajp_common.c (2673): (worker1) sending request to 
 tomcat failed (unrecoverable), because of client write error 
 (attempt=2) [info] jk_handler::mod_jk.c (2799): Aborting connection 
 for worker=worker1 
 
 I'm not an expert here, and wondered if anyone could decode this to 
 find root cause and solution. There are no errors in Apache or 
 GlassFish log files. When I run the client Google Chrome browser 
 (for example), it appears to download the first 4 MB and then 
 report network error. Other browsers behave similarly. Mod_jk 
 appears to have the only log file reporting an error. 
 
 Other miscellaneous thoughts: 
 
 1. My server doesn't have a firewall limiting file size. 
 
 2. My client router/modem doesn't limit file download size (I 
 download much larger files often). 
 
 3. As far as I'm aware, the Java code below doesn't restrict the 
 file size download (can anyone confirm? perhaps mod-jk is 
 complaining about the header or content type?). 
 
 4. GlassFish timeout is 15 minutes, and the browser stops 
 downloading after perhaps 10 seconds. 
 
 I'm running out of things to check. What could it be? Any help is 
 MUCH appreciated. Thanks. 

Looks like it's an old GlassFish bug: 

https://java.net/jira/browse/GLASSFISH-18446 

and 

http://stackoverflow.com/questions/9770529/glassfish-jk-large-file-strange-response
 

Funny how Googling for mod_jk message format 0xcad5 can find exactly 
what you were looking for. 

- -chris 
-BEGIN PGP SIGNATURE- 
Version: GnuPG v1 
Comment: GPGTools - http://gpgtools.org 

iQIcBAEBCAAGBQJUQa3tAAoJEBzwKT+lPKRYXL0P/1r+mj6taEZHCbn1ZpSCMHJ3 
9C/ByrbV6mtbO5AQUSeJ+FJuLMoF9g02A2CjfTAXoiTzb8Q8yUSW/myGPouUsHtV 
BoexlvjCAYYrGzNybM4f6A4vQ76kq7rEXt0o8zj2V4LOHHB5pHoKsU53e2a4re+a 
/1EL0ZyVgkeZOa09vNdh0bRa15zlf3JCG5u+mKa+6H2BdSHJCz4wbv8NV74w/Jc4 
2E8j46se5Jx+pa2lhX1D2tHrcbtq3feUijELrMJcKQq0/Lujy+N7nZP/udQncdvB 
KrvSn1T9LdqYFr0QS9LuxS/6bEb36CMUifRCXjaqBiVctBAw7zxdOql0FOKZRH95 
mNtajRhpJJp7dPzLMes0uowcCqa5M957r64ab0/KOcNfLyhwmmUVTiFSFZ3FWoOP 
azsu5IDFO6HVK46MxHWWqoJOdE2bEFcYCSwpOcImDwCxHGckDtZYlY8lTPPQr/jx 
2s/M0lvYCYwxKGwF9bqpREuPrRCH+YLIDUxdwoloy3o75k8GzR2QPxvEOnzqEose 
rMzWcDpnS09MSK5vHJ7EzFgMa8S/ohqK9dYTASNe2rpJ1QXZSgpe39JH2snhuk7j 
wwX19WrHrADL71qz8Ekg2mNnyyaHxJF5yU1kFgB0eTF4makZbheaP0CuArV+EWiJ 
cS3TsRD9t6kRvz6FDsP7 
=+0h4 
-END PGP SIGNATURE- 

- 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
For additional commands, e-mail: users-h...@tomcat.apache.org 




Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-17 Thread modjklist



Thanks Andre, for taking time to type up the comments below (very helpful to 
me, a new user). Rainer and Christopher, thanks as well for your recent 
comments regarding this post. I did a quick Google search that shows Adobe 
Flashbuilder uses HTTP/1.1, so that shouldn't be an issue. 


Some more background -- I'm hosting with a company, perhaps like most, that 
uses Cpanel to simplify their administration. One result is that the httpd.conf 
file is auto-generated each night, and this process limits the changes one can 
make to its contents. Unfortunately this means I'm unable to modify the 
NameVirtualHost designations, nor the order of the the VirtualHost tags. Of the 
4 VirtualHost tags I'm only able to modify the last two (which relate 
specifically to mydomain.com and myotherdomain.com). Modifying the first two 
VirtualHost tags would wreck havoc with the Cpanel and WHM processes and so 
that's why they're autogenerated each night. Also, as Cpanel versions are 
upgraded behind the scenes, changes to its distiller, etc., may change 
httdp.conf to stay in synch with the new Cpanel version, although this 
shouldn't change the user-modifications in the limited places where they are 
allowed. I'm new to this, but it's probably nothing new to you. My point is, 
the one thing I do have control over is placing mod_jk attributes globally in 
httpd.conf as well as in its VirtualHost tags for mydomain.com and 
myotherdomain.com. Ranier's comments therefore proved to work nicely in this 
environment. 


Inspired by this forum's help I've gained the courage to try to improve on this 
process. I can see that a global JkMountCopy All would open quite a lot for web 
crawlers to view, which I probably should avoid. So I've been tweaking various 
settings on my client to map the Linux drive that Adobe Flashbuilder uses to 
read/write files to the server, as well as the URL input field Adobe uses to 
connect to the server. As I mentioned earlier, every change I make on those 
fronts always produces a result in the mod_jk.log file that is: 


host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
 


It's possible (I'm thinking) that Adobe is using a different URL to access the 
server than what appears in mod_jk.log. After several hours I managed to 
stumble upon one setting that allowed me to remove the global JkMountCopy All 
setting and use the intended VirtualHost JkMount's, although I'm not exactly 
sure why (and so I am feeling quite lucky). To understand everything I'd need 
to see the host name used in the post or get statements directly from Adobe's 
software on the client. Not sure how to extract this directly but maybe there's 
a specific tcpdump command that can show it (?). I need to dig into it more. 



- Original Message -
From: André Warnier a...@ice-sa.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, February 17, 2012 12:13:33 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

modjkl...@comcast.net wrote: 
 Thanks so much Andre for taking the time to help me understand this. It's 
 VERY helpful! I've attached the section of httpd.conf below related to 
 virtual hosts. I think I'm starting to get the picture now. 
 
 Whatever I input into Adobe's software, I ALWAYS see in the mod_jk.log file 
 the hostname: host3.mydomain.com. 
Based on your description below, Apache webserver would select the first 
virtual host 
associated 
with that name. In this case, the first VirtualHost section below would not 
match 
(since xx.xxx.xxx.196 does not match host3.mydomain.com). But I'm guessing the 
2nd 
VirtualHost section below DOES match 
(since I interpret * to match anything). 

No, you still misunderstand somewhat the meaning of 
NameVirtualHost * 
and 
VirtualHost * 

I suggest that you re-read the Apache documentation about these, 
here : http://httpd.apache.org/docs/2.2/vhosts/name-based.html 
but as a kind of shortcut explanation : 
NameVirtualHost * introduces a family of name-based VirtualHost's. 
VirtualHost * indicates that this section is a VirtualHost belonging to 
that family *. 

The * is NOT what Apache matches on, when it compares to the request's 
Host: header. 
What Apache matches on, are the *ServerName* and *ServerAlias* values /inside/ 
the 
VirtualHost section. 

In that sense, the * in NameVirtualHost and VirtualHost is just a common 
label, like 
the family name. If you change the * to for example *:80, then you should 
change it 
in both the NameVirtualHost AND all corresponding VirtualHost lines. They 
must always 
match exactly. 

In yet another way to say this : 

NameVirtualHost * 
introduces a family of 
VirtualHost * 
that answers on all the IP addresses of the server, and all ports on which 
Apache listens 
(as per the Listen directive(s)). 

NameVirtualHost *:80 
introduces a family of 
VirtualHost *:80 
that answers on all the IP 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-17 Thread modjklist
Hi David, Well I used Adobe Flashbuilder now to write files to the server 
(verified by looking at their time stamps) and then looked into the 
/etc/httpd/logs/access_log file, and there's no activity reported there for 
this event. The last few entries were as follows (again, not related to Adobe):

127.0.0.1 - - [17/Feb/2012:08:45:01 -0800] GET /whm-server-status HTTP/1.0 
200 8978 
xx.xx.x.58 - - [17/Feb/2012:08:46:06 -0800] GET / HTTP/1.0 200 111 
127.0.0.1 - - [17/Feb/2012:08:46:06 -0800] GET / HTTP/1.0 200 111 

Also, I've tried endless entries into the URL input field for Abobe's software, 
such as

xx.xxx.xxx.196
mydomain.com
www.mydomain.com
mydomain.com:80
and so on...

I'm starting to think such settings may be making a difference, although 
mod_jk.log always reports host3.mydomain.com, so I'm just speculating.


- Original Message - 
From: David N. Smith david.sm...@cornell.edu 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Friday, February 17, 2012 8:43:57 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 


On Feb 17, 2012, at 10:27 AM, André Warnier a...@ice-sa.com wrote: 

 Christopher Schultz wrote: 
 -BEGIN PGP SIGNED MESSAGE- 
 Hash: SHA1 
 To whom it may concern, 
 On 2/16/12 1:29 PM, modjkl...@comcast.net wrote: 
 I took all JkMounts inside the VirtualHost tags and placed them outside 
 these tags, and above them added JkMountCopy All, 
 restarted Apache, and now Adobe successfully can access 
 mydomain.com/mywebapp. Thanks so much!!! 
 
 I also tried modifying the above httpd.conf configuration by 
 removing the global JkMountCopy All line of code, and adding a 
 JkMountCopy On line of code inside the original VirtualHost tags, 
 but this also failed as before. Any idea why? 
 
 Andre, I did worry about the host3 designation initially, so I previously 
 added it to the VirtualHost tag here under ServerAlias: 
 
 ServerAlias www.mydomain.com host3.mydomain.com 
 
 So I assumed that should permit Adobe trying to access host3.mydomain.com 
 I'm still curious as to why Adobe sees a different experience than you 
 do with your web browser. 
 
 Me too in fact. I didn't quite get Rainer's explanation, and still do not 
 understand why an Adobe request results in this URI being logged by mod_jk : 
 
 [Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
 jk_map_to_storage::mod_jk.c (3647): missing uri map for 
 host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
  
 
 while when doing it by hand, the URI shown in the log is quite different : 
 
  [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
  map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI 
  '/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm' 
  from 6 maps 
 
 Is it just a variation due to how the mod_jk logging works, or is it really 
 that the request URI is arriving differently to Apache in one case or the 
 other ? 
 
 Like : 
 - from a browser : 
 GET /mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm 
 HTTP/1.1 
 Host: host3.mydomain.com 
 ... 
 
 - from Adobe : 
 GET 
 host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
  HTTP/1.1 
 Host:  
 ... 
 
 ??? 
 
 

Partially to add to the chorus ... 

It *looks like* to my eye that Adobe is trying something strange like: 

http://host3.mydomain.com/host3.mydomain.com:/mywebapp/flex  (the rest of 
the URL). 

Question is ... what happens if you don't specify the host ... just the server 
relative URL. Also the Apache httpd service should have access logs. What is 
listed there? 

FYI ... my access logs only show the part of the URL after the host/port. It's 
likely if you see host3.mydomain.com in there that Adobe is treating what you 
enter as a server relative URL instead of an absolute URL. 

--David 
- 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
For additional commands, e-mail: users-h...@tomcat.apache.org 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Hello. I'm trying to setup Adobe's Flexbuilder 4.6 software to access 
mydomain.com/mywebapp using port 80 on Apache Webserver 2.2.21 and connect 
using mod_jk 1.2.32 on a remote Linux CentOS 6.2 server. I'm puzzled by the 
mod_jk.log file, which I've included a snippet below and attached as a text 
file. I also attached an image of Adobe Flexbuilder's wizard. 


As you can see from the image, this wizard has a button called Validate 
Configuration that attempts to connect to the remote server provided in the 
input field labeled Root URL. If I enter the following into this Root URL 
field 


http://mydomain.com:8080/mywebapp 


the Adobe Flashbuilder software states that a connection was successfully made 
to the server. However, if I enter the following instead: 


http://mydomain.com/mywebapp 


the Adobe Flashbuilder software states that it cannot connect to the server. 


When I review the mod_jk.log file (attached as a file and also shown below), I 
see Adobe's request in the 2nd line (see red font ), where the mod_jk.log entry 
reports a missing uri map for host3.mydomain.com:/jitterapp/flex_wizard_... 


Later in this log snippet, as identified in green font , you'll see an entry 
for attempting to map URI ' /jitterapp/flex_wizard_... This entry was created 
when I opened a web browser and pointed it to the address Adobe was trying to 
access, which I obtained from the log file, that is, 
http://mydomain.com/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm.
 In this case, a match was found with JkMount and a worker assigned, and so 
mod_jk seems to be working. 


My question is, why does mod_jk work when I manually enter the web address 
Adobe is trying to access but not work when Adobe accesses it? Can you see 
anything in the log file that would indicate the address I entered is different 
than the address Adobe is using, that could explain this? I really need this 
working, so any help MUCH appreciated. Thanks in advance. 


For reference, the httpd.conf file includes the following (the ... indicates 
non-relevant code I removed for simplicity): 


LoadModule jk_module modules/mod_jk.so 

JkWorkersFile /etc/httpd/conf/workers.properties 
JkLogFile /etc/httpd/logs/mod_jk.log 
JkLogLevel debug 
JkLogStampFormat [%a %b %d %H:%M:%S %Y]  JkOptions +ForwardKeySize 
+ForwardURICompat -ForwardDirectories 
JkRequestLogFormat %w %V %T 
... 
Listen 0.0.0.0:80 
User nobody 
Group nobody 
ExtendedStatus On 
ServerAdmin webmas...@webxyz.net 
ServerName host3.mydomain.com 
LogLevel warn 
Timeout 300 
ServerSignature On 
... 
UserDir public_html 
... 

Location /whm-server-status 
SetHandler server-status 
Order deny,allow 
Deny from all 
Allow from 127.0.0.1 
/Location 

Location /server-status 

SetHandler server-status 
Order deny,allow 
Deny from all 
Allow from xx.xx.xxx.0/24 
/Location 


Location /server-info 
SetHandler server-info 
Order deny,allow 
Deny from all 
Allow from xx.xx.xxx.0/24 
/Location 
... 

NameVirtualHost 67.227.243.196:80 
NameVirtualHost * 
... 
VirtualHost xx.xxx.xxx.196:80 
ServerName mydomain.com 
ServerAlias www.mydomain.com host3.mydomain.com 
DocumentRoot /home/gkk/public_html 
ServerAdmin webmas...@mydomain.com 
UseCanonicalName Off 
JkMountCopy On 
JkMount /mydomain/* worker1 
JkMount /mydomain worker1 
/VirtualHost 



mod_jk.log file snippet-- 




[Thu Feb 16 06:46:37 2012] [13722:140020322740160] [debug] jk_handler::mod_jk.c 
(2662): Service finished with status=404 for worker=worker1 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map for 
host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_map_to_storage::mod_jk.c (3647): missing uri map for 
host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map for 
host3.mydomain.com:/404.shtml 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_map_to_storage::mod_jk.c (3647): missing uri map for 
host3.mydomain.com:/404.shtml 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map for 
host3.mydomain.com:/cp_errordocument.shtml 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_map_to_storage::mod_jk.c (3647): missing uri map for 
host3.mydomain.com:/cp_errordocument.shtml 

[Thu Feb 16 06:49:46 2012] [13724:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map for host3.mydomain.com:/ 

[Thu Feb 16 06:49:46 2012] [13724:140020322740160] [debug] 
jk_map_to_storage::mod_jk.c (3647): missing uri map for host3.mydomain.com:/ 

[Thu Feb 16 06:49:46 2012] [13724:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map for 
host3.mydomain.com:/index.html.var 

... 

[Thu Feb 16 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Thanks Andre for catching my typo (correct in practice, but incorrect when I 
edited it for this email). I've corrected it below. Also, switched to plain 
text instead of HTML.

Thanks Christopher -- I eliminated the attachments. I've tried to make it more 
readable for color-blind people, use in-text clues, etc. below. I've also 
included my workers.properties file. You're right that the JkMountCopy isn't 
needed (I was desperate to find a solution and this was one attempt to fix it 
that had no effect). I was worried about the colon in the mod_jk.log file lines 
as well, but since it is consistently everywhere, I assumed it was a formatting 
issue related to mod_jk. I'm not switching ports or changing protocols. I'm 
trying to keep everything simple. The address you pointed out is the IP address 
for host3.mydomain.com. As an experiment, I replaced host3.mydomain.com with 
the actual IP address for the server (used by VirtualHost) in the input field 
for Host URL in Adobe's software so there's be no mistake which IP address 
would receive Adobe's request, but the mod_jk.log appears exactly the same. 

original message is below---

Hello. I'm trying to setup Adobe's Flexbuilder 4.6 software to access 
mydomain.com/mywebapp using port 80 on Apache Webserver 2.2.21 and connect 
using mod_jk 1.2.32 on a remote Linux CentOS 6.2 server. I'm puzzled by the 
mod_jk.log file, which I've included a snippet below and attached as a text 
file. I also attached an image of Adobe Flexbuilder's wizard. 

As you can see from the image, this wizard has a button called Validate 
Configuration that attempts to connect to the remote server provided in the 
input field labeled Root URL. If I enter the following into this Root URL 
field 

http://mydomain.com:8080/mywebapp 

the Adobe Flashbuilder software states that a connection was successfully made 
to the server. However, if I enter the following instead: 

http://mydomain.com/mywebapp 

the Adobe Flashbuilder software states that it cannot connect to the server. 

When I review the mod_jk.log file (attached as a file and also shown below), I 
see Adobe's request in the 2nd line, where the mod_jk.log entry reports a 
missing uri map for host3.mydomain.com:/jitterapp/flex_wizard_... Here's that 
line: 

[Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
jk_translate::mod_jk.c (3488): missing uri map 
forhost3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
 

Later in this log snippet , you'll see an entry for attempting to map URI ' 
/jitterapp/flex_wizard_... Here's that line: 

[Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI 
'/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm' from 
6 maps 

This entry was created when I opened a web browser and pointed it to the 
address Adobe was trying to access, which I obtained from the log file, that 
is, 
http://mydomain.com/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm.
 In this case, a match was found with JkMount and a worker assigned, and so 
mod_jk seems to be working. Here's the relevant line: 

[Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
find_match::jk_uri_worker_map.c (863): Found a wildchar match 
'/mywebapp/*=worker1' 

My question is, why does mod_jk work when I manually enter the web address 
Adobe is trying to access but not work when Adobe accesses it? Can you see 
anything in the log file that would indicate the address I entered is different 
than the address Adobe is using, that could explain this? I really need this 
working, so any help MUCH appreciated. Thanks in advance. 

httpd.conf file snippet-

For reference, the httpd.conf file includes the following (the ... indicates 
non-relevant code I removed for simplicity): 

LoadModule jk_module modules/mod_jk.so 

JkWorkersFile /etc/httpd/conf/workers.properties 
JkLogFile /etc/httpd/logs/mod_jk.log 
JkLogLevel debug 
JkLogStampFormat [%a %b %d %H:%M:%S %Y]  JkOptions +ForwardKeySize 
+ForwardURICompat -ForwardDirectories 
JkRequestLogFormat %w %V %T 
... 
Listen 0.0.0.0:80 
User nobody 
Group nobody 
ExtendedStatus On 
ServerAdmin webmas...@webxyz.net 
ServerName host3.mydomain.com 
LogLevel warn 
Timeout 300 
ServerSignature On 
... 
UserDir public_html 
... 

Location /whm-server-status 
SetHandler server-status 
Order deny,allow 
Deny from all 
Allow from 127.0.0.1 
/Location 

Location /server-status 

SetHandler server-status 
Order deny,allow 
Deny from all 
Allow from xx.xx.xxx.0/24 
/Location 


Location /server-info 
SetHandler server-info 
Order deny,allow 
Deny from all 
Allow from xx.xx.xxx.0/24 
/Location 
... 

NameVirtualHost 67.227.243.196:80 
NameVirtualHost * 
... 
VirtualHost xx.xxx.xxx.196:80 
ServerName mydomain.com 
ServerAlias www.mydomain.com host3.mydomain.com 
DocumentRoot /home/gkk/public_html 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Hi Christopher, I've never used tcpdump before, but it seems the trick is 
knowing how to configure it with the various switches to extract what one 
wants. I took a stab at it below, but I can't find much meaning in it. This 
snippet captures the time when Adobe accesses the webaddress. Is there a better 
command you can give me to use to give more relevant information? (below: 
xx.xxx.xxx.163 = client and xx.xxx.xxx.196 = server)

Hi Andre, yes there's a few more JkMounts that I didn't mention since they're 
unrelated, and I corrected below the additional typos you found. Also, the 
initial part of the mod_jk.log below was critical to understanding the problem 
(I'll edit it to make it more obvious -- see THE CAPITAL LETTING inside the 
mod_jk snippet below).

[root@host3 /etc]# tcpdump -v -n port http 
tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 
bytes 
09:12:45.953686 IP (tos 0x0, ttl 50, id 60955, offset 0, flags [DF], proto TCP 
(6), length 64) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [S], cksum 0xf26a (correct), 
seq 2296787062, win 65535, options [mss 1460,nop,wscale 3,nop,nop,TS val 
837669530 ecr 0,sackOK,eol], length 0 
09:12:45.953728 IP (tos 0x0, ttl 64, id 0, offset 0, flags [DF], proto TCP (6), 
length 60) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [S.], cksum 0xb37b (correct), 
seq 1455038508, ack 2296787063, win 14480, options [mss 1460,sackOK,TS val 
428508894 ecr 837669530,nop,wscale 7], length 0 
09:12:46.047635 IP (tos 0x0, ttl 50, id 38932, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [.], cksum 0x1ad7 (correct), 
ack 1, win 65535, options [nop,nop,TS val 837669531 ecr 428508894], length 0 
09:12:46.047658 IP (tos 0x0, ttl 50, id 55301, offset 0, flags [DF], proto TCP 
(6), length 181) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [P.], cksum 0xb731 (correct), 
seq 1:130, ack 1, win 65535, options [nop,nop,TS val 837669531 ecr 428508894], 
length 129 
09:12:46.047688 IP (tos 0x0, ttl 64, id 42769, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [.], cksum 0x197e (correct), 
ack 130, win 122, options [nop,nop,TS val 428508988 ecr 837669531], length 0 
09:12:46.050453 IP (tos 0x0, ttl 64, id 42770, offset 0, flags [DF], proto TCP 
(6), length 1500) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [.], cksum 0xfe97 (incorrect 
- 0x6a47), seq 1:1449, ack 130, win 122, options [nop,nop,TS val 428508991 ecr 
837669531], length 1448 
09:12:46.050461 IP (tos 0x0, ttl 64, id 42771, offset 0, flags [DF], proto TCP 
(6), length 1200) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [P.], cksum 0xfd6b (incorrect 
- 0x62d7), seq 1449:2597, ack 130, win 122, options [nop,nop,TS val 428508991 
ecr 837669531], length 1148 
09:12:46.050505 IP (tos 0x0, ttl 64, id 42772, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [F.], cksum 0x0f56 (correct), 
seq 2597, ack 130, win 122, options [nop,nop,TS val 428508991 ecr 837669531], 
length 0 
09:12:46.145851 IP (tos 0x0, ttl 50, id 64715, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [.], cksum 0x0fd0 (correct), 
ack 2597, win 65535, options [nop,nop,TS val 837669532 ecr 428508991], length 0 
09:12:46.145878 IP (tos 0x0, ttl 50, id 58941, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [.], cksum 0x0fcf (correct), 
ack 2598, win 65535, options [nop,nop,TS val 837669532 ecr 428508991], length 0 
09:12:46.155260 IP (tos 0x0, ttl 50, id 33156, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.163.36246  xx.xxx.xxx.196.http: Flags [F.], cksum 0x0fce (correct), 
seq 130, ack 2598, win 65535, options [nop,nop,TS val 837669532 ecr 428508991], 
length 0 
09:12:46.155293 IP (tos 0x0, ttl 64, id 42773, offset 0, flags [DF], proto TCP 
(6), length 52) 
xx.xxx.xxx.196.http  xx.xxx.xxx.163.36246: Flags [.], cksum 0x0eec (correct), 
ack 131, win 122, options [nop,nop,TS val 428509095 ecr 837669532], length 0 

- Original Message - 
From: modjkl...@comcast.net 
To: users@tomcat.apache.org 
Sent: Thursday, February 16, 2012 8:55:35 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

Thanks Andre for catching my typo (correct in practice, but incorrect when I 
edited it for this email). I've corrected it below. Also, switched to plain 
text instead of HTML. 

Thanks Christopher -- I eliminated the attachments. I've tried to make it more 
readable for color-blind people, use in-text clues, etc. below. I've also 
included my workers.properties file. You're right that the JkMountCopy isn't 
needed (I was desperate to find a solution and this was one attempt to fix it 
that had no effect). I was worried about the colon in the mod_jk.log file lines 
as well, but since it is 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Hi Ranier, 

I took all JkMounts inside the VirtualHost tags and placed them outside these 
tags, and above them added JkMountCopy All, restarted Apache, and now Adobe 
successfully can access mydomain.com/mywebapp. Thanks so much!!!

I also tried modifying the above httpd.conf configuration by removing the 
global JkMountCopy All line of code, and adding a JkMountCopy On line of code 
inside the original VirtualHost tags, but this also failed as before. Any idea 
why?

Andre, I did worry about the host3 designation initially, so I previously 
added it to the VirtualHost tag here under ServerAlias:

ServerAlias www.mydomain.com host3.mydomain.com 

So I assumed that should permit Adobe trying to access host3.mydomain.com

Thanks Andre, Ranier, and Christopher!!!

- Original Message - 
From: Rainer Jung rainer.j...@kippdata.de 
To: users@tomcat.apache.org 
Sent: Thursday, February 16, 2012 9:47:13 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

On 16.02.2012 17:55, modjkl...@comcast.net wrote: 
 original message is below--- 
 
 Hello. I'm trying to setup Adobe's Flexbuilder 4.6 software to access 
 mydomain.com/mywebapp using port 80 on Apache Webserver 2.2.21 and connect 
 using mod_jk 1.2.32 on a remote Linux CentOS 6.2 server. I'm puzzled by the 
 mod_jk.log file, which I've included a snippet below and attached as a text 
 file. I also attached an image of Adobe Flexbuilder's wizard. 
 
 As you can see from the image, this wizard has a button called Validate 
 Configuration that attempts to connect to the remote server provided in the 
 input field labeled Root URL. If I enter the following into this Root URL 
 field 
 
 http://mydomain.com:8080/mywebapp 
 
 the Adobe Flashbuilder software states that a connection was successfully 
 made to the server. However, if I enter the following instead: 
 
 http://mydomain.com/mywebapp 
 
 the Adobe Flashbuilder software states that it cannot connect to the server. 
 
 When I review the mod_jk.log file (attached as a file and also shown below), 
 I see Adobe's request in the 2nd line, where the mod_jk.log entry reports a 
 missing uri map for host3.mydomain.com:/jitterapp/flex_wizard_... Here's that 
 line: 

That means it is using a VHost in Apache which does not have JkMount or 
uriworkermap.properties inside. 

 [Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
 jk_translate::mod_jk.c (3488): missing uri map 
 forhost3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
  

And the colon Chris and you were speculating about is indeed an accident 
in trying to separate host and URI, so read it as: 

missing uri map for host3.mydomain.com: /jitterapp/flex_wizard_... 

So your request is served by whatever VHost is configured to handle 
requests for host3.mydomain.com 

 Later in this log snippet , you'll see an entry for attempting to map URI ' 
 /jitterapp/flex_wizard_... Here's that line: 
 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map URI 
 '/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm' 
 from 6 maps 
 
 This entry was created when I opened a web browser and pointed it to the 
 address Adobe was trying to access, which I obtained from the log file, that 
 is, 
 http://mydomain.com/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm.
  In this case, a match was found with JkMount and a worker assigned, and so 
 mod_jk seems to be working. Here's the relevant line: 

Yep, the VHost handling mydomain.com (which must be some other VHost 
than the previous one for host3.mydomain.com) has rules and those did match. 

 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 find_match::jk_uri_worker_map.c (863): Found a wildchar match 
 '/mywebapp/*=worker1' 
 
 My question is, why does mod_jk work when I manually enter the web address 
 Adobe is trying to access but not work when Adobe accesses it? Can you see 
 anything in the log file that would indicate the address I entered is 
 different than the address Adobe is using, that could explain this? I really 
 need this working, so any help MUCH appreciated. Thanks in advance. 

Because you are being handled by different VHosts and the mounting rules 
are not defined in all of them. 

If you want to double check my VHos theory: add a special accesslog 
using CustomLog with a new log file name to the VHost you added your 
Jkmount. I would expect the request that found a mount to show up in 
that accesslog, and the other one to not show up in this additional 
access log because it was handled by some other vhost. 

Easiest solution could be moving all Jkmount directives to the global 
server and setting JkMountCopy all in the global server. 

 httpd.conf file snippet- 
 
 For reference, the httpd.conf 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Hi Andre, yes I see your point (Rainer's solution would solve that too I 
suppose). Also, believe me, I was trying all sorts of addresses in Adobe's 
input field:

http://www.mydomain.com/mywebapp
http://mydomain.com/mywebapp
http://mydomain.com:80/mywebapp
http://host3.mydomain.com/mywebapp
http://host3.mydomain.com:80/mywebapp
http://xx.xxx.xxx.xxx/mywebapp
etc.

practically every permutation I could think of, all with the same result. 

Also interesting is the tcpdump I send out earlier reports two cksum INCORRECTs 
when Adobe accesses port 80 (without Rainer's fix). No idea what's going on 
there.

- Original Message - 
From: André Warnier a...@ice-sa.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, February 16, 2012 10:46:45 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

And still more.. 

André Warnier wrote: 
 Another addendum at end. 
 
 André Warnier wrote: 
 In this case, and although Rainer is of course The mod_jk specialist, 
 I beg to differ with his analysis. 
 
 
 modjkl...@comcast.net wrote: 
 
 mod_jk.log file snippet-- 
 [Thu Feb 16 06:46:37 2012] [13722:140020322740160] [debug] 
 jk_handler::mod_jk.c (2662): Service finished with status=404 for 
 worker=worker1 
 [Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
 jk_translate::mod_jk.c (3488): missing uri map for 
 host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
  
 
 RIGHT NOW THE ADOBE SOFTWARE WILL ATTEMPT TO CONNECT TO THE SERVER... 
 
 [Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
 jk_map_to_storage::mod_jk.c (3647): missing uri map for 
 host3.mydomain.com:/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm
  
 
 NOTICE THE WEB ADDRESS ADOBE IS USING IN THE ABOVE LINE 
 
 Well no, actually it is not a web address. It seems very much like 
 Adobe is sending host3.mydomain.com:/mywebapp/flex_w... AS A URI. 
 And since mod_jk has no mapping for a URI starting with host3.., it 
 says so and hands it back to Apache. From then on, we don't see 
 anything anymore in the mod_jk log of course, since it is Apache which 
 is trying to match that URI (and failing). 
 
 
 [Thu Feb 16 06:47:35 2012] [13723:140020322740160] [debug] 
 jk_translate::mod_jk.c (3488): missing uri map for 
 host3.mydomain.com:/404.shtml 
 
 That's again the Adobe thing trying now to get other documents, which 
 similarly fail because there is still that funny prefix to the URI. 
 And so on... 
 
 
 IN THE NEXT LINE, I HAVE TAKEN ADOBES ADDRESS SEEN ABOVE AND ENTERED 
 IT MANUALLY INTO A BROWSER WINDOW 
 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 map_uri_to_worker_ext::jk_uri_worker_map.c (1036): Attempting to map 
 URI 
 '/mywebapp/flex_wizard_project_test_script_server_550713325917236076.htm' 
 from 6 maps 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 find_match::jk_uri_worker_map.c (850): Attempting to map context URI 
 '/mywebapp/*=worker1' source 'JkMount' 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 find_match::jk_uri_worker_map.c (863): Found a wildchar match 
 '/mywebapp/*=worker1' 
 
 Notice the difference ? When you do this manually, that host3.. 
 prefix is not there, and the match succeeds. 
 
 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 jk_handler::mod_jk.c (2522): Into handler jakarta-servlet 
 worker=worker1 r-proxyreq=0 
 [Thu Feb 16 06:55:21 2012] [13725:140020322740160] [debug] 
 wc_get_worker_for_name::jk_worker.c (116): found a worker worker1 
 IN THIS CASE, MOD_JK DOES CORRECTLY SEND THIS ADDRESS TO THE WEB 
 CONTAINER FOR PROCESSING (THE QUESTION OF THIS POST IS: WHY DIDN'T IT 
 DO THIS WHEN ADOBE USED THE SAME ADDRESS ABOVE?) 
 
 
 Well actually, I don't think that mod_jk has anything to do with the 
 problem. 
 It seems to be the Adobe thing which gets things wrong. 
 When the request URI is fine, then mod_jk is doing its job. 
 
 
 Or perhaps, it is the way in which you are entering hostname in that 
 input box of the form, that confuses the Adobe thingy ? 
 Such as maybe : 
 - when you enter host3.mydomain.com:8080, it understands that this is 
 a hostname 
 - but when you enter host3.mydomain.com it doesn't 
 Have you tried entering host3.mydomain.com:80 ? or 
 http://host3.mydomain.com; ? 
 
 

Actually, when I think about it, both Rainer's explanation and mine here may be 
right. 
If the Adobe thing gets confused, and does not use the correct hostname for 
sending its 
request (say for example that it defaults to localhost), then we could have a 
mixture of 
the wrong URI being processed by the wrong VirtualHost, and really confusing 
everything.. 
(The first defined VirtualHost in Apache becoming the default VirtualHost, used 
if the 
hostname doesn't match..) 


- 
To unsubscribe, 

Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Thank you Chuck, I feel a lot better now :-) 

- Original Message -
From: Charles R Caldarale chuck.caldar...@unisys.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, February 16, 2012 11:17:05 AM 
Subject: RE: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

 From: modjkl...@comcast.net [mailto:modjkl...@comcast.net] 
 Subject: Re: mod_jk doesn't map to software-generated web 
 address, but maps to this address when I enter it into browser 

 Also interesting is the tcpdump I send out earlier reports two cksum 
 INCORRECTs when Adobe accesses port 80 (without Rainer's fix). No idea 
 what's going on there. 

That's quite common and usually just an indication that the checksumming 
operation is handled by the NIC, not software. 

- Chuck 


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY 
MATERIAL and is thus for use only by the intended recipient. If you received 
this in error, please contact the sender and delete the e-mail and its 
attachments from all computers. 



Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Thanks Andre, 

I'd still be interested is there's a way to have mod_jk only check for traffic 
coming into mydomain.com for folder /mywebapp. I think the current solution 
checks all domains, such as mydomain2.com and mydomain3.com, etc., for a map to 
mydomain.com/mywebapp. 

Couldn't I just have all those JkMounts defined globally, then within the 
VirtualHost tags for mydomain.com, include a JkMountCopy On? But that didn't 
work for me so I must be approaching this wrong.

- Original Message - 
From: André Warnier a...@ice-sa.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Thursday, February 16, 2012 11:41:25 AM 
Subject: Re: mod_jk doesn't map to software-generated web address, but maps to 
this address when I enter it into browser 

modjkl...@comcast.net wrote: 
 Hi Andre, yes I see your point (Rainer's solution would solve that too I 
 suppose). Also, believe me, I was trying all sorts of addresses in Adobe's 
 input field: 
 
 http://www.mydomain.com/mywebapp 
 http://mydomain.com/mywebapp 
 http://mydomain.com:80/mywebapp 
 http://host3.mydomain.com/mywebapp 
 http://host3.mydomain.com:80/mywebapp 
 http://xx.xxx.xxx.xxx/mywebapp 
 etc. 
 
 practically every permutation I could think of, all with the same result. 
 

Each of these permutations above can have the effect of landing upon a 
different 
VirtualHost, depending on how /exactly/ your Apache configuration is put 
together (and 
your DNS). 
The way you showed earlier, there seemed to be a mixture of IP-based 
VirtualHost's and 
name-based VirtualHost's, each one group with its own default VirtualHost. 
Since we never saw the whole configuration, it is difficult to tell what 
happened exactly. 
We don't even know if the Adobe thing is sending proper HTTP 1.1 requests, with 
a correct 
Host: header. 

What Rainer told you to do, essentially has the effect that all 
JkMount/JkUnmount 
directives are centralised (or defaulted) in the part of the Apache 
configuration that 
is outside of all VirtualHost sections. Along with the JkMountCopy All, 
this causes 
all these JkMount/JkUnmount to be copied to (or inherited by) /all/ the 
VirtualHosts 
(including the default one(s)). 

So this way, we are sure that no matter which VirtualHost is actually 
processing the Adobe 
request, the appropriate JkMount is there for /mywebapp. 
In other words, no matter if the Adobe app sends a correct HTTP 1.1 request 
with the 
correct Host: header, as long as it does connect to an IP address of your 
server on port 
80, the request will encounter a VirtualHost which knows how to proxy 
/mywebapp to Tomcat. 
This makes it work, but of course it also hides any defect of the Adobe 
thingy's 
request, if any. 

It also means that whichever (valid) hostname is used for a request to 
/mywebapp, it 
will work and end up in Tomcat's mywebapp. This may be what you want, or it 
may not. 


 Also interesting is the tcpdump I send out earlier reports two cksum 
 INCORRECTs when Adobe accesses port 80 (without Rainer's fix). No idea what's 
 going on there. 
 
Those are transmission errors at the TCP level. That packet should be repeated 
then 
automatically, and this should not play a role here. 

- 
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org 
For additional commands, e-mail: users-h...@tomcat.apache.org 


-
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org



Re: mod_jk doesn't map to software-generated web address, but maps to this address when I enter it into browser

2012-02-16 Thread modjklist
Thanks so much Andre for taking the time to help me understand this. It's VERY 
helpful! I've attached the section of httpd.conf below related to virtual 
hosts. I think I'm starting to get the picture now. 

Whatever I input into Adobe's software, I ALWAYS see in the mod_jk.log file the 
hostname: host3.mydomain.com. Based on your description below, Apache webserver 
would select the first virtual host associated with that name. In this case, 
the first VirtualHost section below would not match (since xx.xxx.xxx.196 does 
not match host3.mydomain.com). But I'm guessing the 2nd VirtualHost section 
below DOES match (since I interpret * to match anything). 

However, I was intending the 3rd VirtualHost section below (e.g. VirtualHost 
xx.xxx.xxx.196:80 to match the hostname used by Adobe (this where I originally 
had the JkMounts located) since it had the alias host3.mydomain.com. But you're 
right, Apache would have assigned it to the other VirtualHost before it even 
reached this point. This should explain why the Global JkMounts worked as they 
did.

One question: where we define NameVirtualHost below, is it better to use *:80 
instead of xx.xxx.xxx.196:80? The server has 2 IP addresses associated with it, 
although I *think* only 1 is used in practice. 

snippet from httpd.conf showing virtual-host related items-
PidFile logs/httpd.pid
LockFile logs/accept.lock
Listen 0.0.0.0:80
User nobody
Group nobody
ExtendedStatus On
ServerAdmin webmas...@webcompany.net
ServerName host3.mydomain.com
LogLevel warn
Timeout 300
ServerSignature On

NameVirtualHost xx.xxx.xxx.196:80
NameVirtualHost *

VirtualHost xx.xxx.xxx.196:80
ServerName host3.mydomain.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin webmas...@webcompany.net
IfModule mod_suphp.c
suPHP_UserGroup nobody nobody
/IfModule
/VirtualHost

# Default vhost for unbound IPs

VirtualHost *
ServerName host3.mydomain.com
DocumentRoot /usr/local/apache/htdocs
ServerAdmin webmas...@webcompany.net
IfModule mod_suphp.c
suPHP_UserGroup nobody nobody
/IfModule
/VirtualHost

VirtualHost xx.xxx.xxx.196:80
ServerName mydomain.com
ServerAlias www.mydomain.com host3.mydomain.com
DocumentRoot /home/gkk/public_html
ServerAdmin webmas...@webcompany.net
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/mydomain.com combined
CustomLog /usr/local/apache/domlogs/mydomain-bytes_log %{%s}t %I .\n%{%s}t 
%O .
## User gkk # Needed for Cpanel::ApacheConf
IfModule mod_suphp.c
suPHP_UserGroup gkk gkk
/IfModule
IfModule concurrent_php.c
php4_admin_value open_basedir 
/home/gkk:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp
 
php5_admin_value open_basedir 
/home/gkk:/usr/lib/php:/usr/local/lib/php:/tmp
/IfModule
IfModule !concurrent_php.c
IfModule mod_php4.c
php_admin_value open_basedir 
/home/gkk:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/
 
mp
/IfModule
IfModule mod_php5.c
php_admin_value open_basedir 
/home/gkk:/usr/lib/php:/usr/local/lib/php:/tmp
/IfModule
IfModule sapi_apache2.c
php_admin_value open_basedir 
/home/gkk:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/t
mp
/IfModule
/IfModule
IfModule !mod_disable_suexec.c
SuexecUserGroup gkk gkk
/IfModule
ScriptAlias /cgi-bin/ /home/gkk/public_html/cgi-bin/

Include /usr/local/apache/conf/userdata/*.conf  
Include /usr/local/apache/conf/userdata/*.owner-root 
Include /usr/local/apache/conf/userdata/std/*.conf 
Include /usr/local/apache/conf/userdata/std/*.owner-root 
Include /usr/local/apache/conf/userdata/std/2/*.conf 
Include /usr/local/apache/conf/userdata/std/2/*.owner-root 
Include /usr/local/apache/conf/userdata/std/2/gkk/*.conf  
Include /usr/local/apache/conf/userdata/std/2/gkk/mydomain.com/*.conf

/VirtualHost

VirtualHost xx.xxx.xxx.196:80
ServerName myotherdomain.com
ServerAlias www.myotherdomain.com
DocumentRoot /home/gkk2/public_html
ServerAdmin webmas...@webcompany.net
UseCanonicalName Off
CustomLog /usr/local/apache/domlogs/myotherdomain.com combined
CustomLog /usr/local/apache/domlogs/myotherdomain.com-bytes_log %{%s}t %I 
.\n%{%s}t %O .
## User gkk2 # Needed for Cpanel::ApacheConf
IfModule mod_suphp.c
suPHP_UserGroup gkk2 gkk2
/IfModule
IfModule concurrent_php.c
php4_admin_value open_basedir 
/home/gkk2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/
tmp
php5_admin_value open_basedir 
/home/gkk2:/usr/lib/php:/usr/local/lib/php:/tmp
/IfModule
IfModule !concurrent_php.c
IfModule mod_php4.c
php_admin_value open_basedir 
/home/gkk2:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/ph
p:/tmp

desperate for help to set up straightforward mod_jk connection between Apache2 webserver and web container

2012-02-11 Thread modjklist


I'm trying to get Apache2 Webserver talking to Glassfish3 using mod_jk on 
CentOS, where everything is a fresh install (new server), no load balancing, no 
clustering, and everything is all on one server (so no firewall between Apache 
and Glassfish). I'm quite desperate to get this working, and embarrased how 
long I'm spending on this with no end in sight. I'm a newbie so watch out for 
potentially something obvious. 


My system (I SSH into it from remote client): 


1. new CentOS 6.2 server 
2. Sun Java 1.6.0_30 
3. mod_jk.so built from tomcat-connectors-1.2.32-src.tar 
4. GlassFish 3.1.1 (note: Glassfish Embeds Tomcat) 
5. Apache Webserver 2.2.21 


Everything works great when using port 8080. For example, an example hello.war 
application ( http://docs.oracle.com/cd/E19798-01/821-1757/geyvr/index.html) 
deployed on GlassFish runs fine from: 


http://www.mydomain.com:8080/hello/ 


My question is, what do I need to change (or add) such that I can access the 
hello.war application using an address like this (and using port 80; so I can 
eventually close port 8080)? 


http://www.mydomain.com/hello/ 


The goal is to have all external traffic pass through Apache webserver port 80 
to access GlassFish. For what it's worth, I used this site's instructions ( 
http://www.codefactorycr.com/glassfish-behind-apache.html) as inspiration. 


When I restart Apache webserver and go to: 


http://www.mydomain.com/hello 


the website hangs (spinning wheel for 30s). What could be the problem? To 
confuse things, GlassFish 3.1.1 has a bug that leads to a error decoding 
request in the server log. I don't see this error in the server log. 
Nevertheless, I downloaded the bug fix file and I'm using it. It didn't change 
anything, still same error shown below. This bug is documented here: 
http://java.net/jira/browse/GLASSFISH-17068?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
 


Any help MUCH MUCH MUCH appreciated! 


For reference, my httpd.conf file includes the following (among other things): 


LoadModule jk_module /etc/httpd/modules/mod_jk.so 
JkWorkersFile /etc/httpd/conf/workers.properties 
JkLogFile /etc/httpd/logs/mod_jk.log 
JkLogLevel debug 
JkLogStampFormat [%a %b %d %H:%M:%S %Y]  
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories 
JkRequestLogFormat %w %V %T 
... 
Listen 0.0.0.0:80 
User nobody 
Group nobody 
ExtendedStatus On 
ServerAdmin n...@address.com 
ServerName host3.mydomain.com 
LogLevel warn 
Timeout 300 
ServerSignature On 
RewriteEngine On 
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect 
RewriteLock /usr/local/apache/logs/rewrite_lock 
UserDir public_html 

... 
NameVirtualHost xx.xxx.xxx.xxx:80 
NameVirtualHost * 
VirtualHost * 
ServerName host3.mydomain.com 
DocumentRoot /usr/local/apache/htdocs 
ServerAdmin n...@address.com 
/VirtualHost 
VirtualHost xx.xxx.xxx.xxx:80 
ServerName mydomain.com 
ServerAlias www.mydomain.com 
DocumentRoot /home/gkk/public_html 
ServeAdmin webmas...@mydomain.com 
UseCanonicalName Off 
Include /user/local/apache/conf/userdata/std/2/gkk/mydomain.com/*.conf 
/VirtualHost 


the file 
/user/local/apache/conf/userdata/std/2/gkk/mydomain.com/includethis.conf is as 
follows: 


JkMount /hello/* worker1 
JkMount /hello worker1 


and the glassfish-jk.properties file is: 


worker.list=worker1 
worker.worker1.type=ajp13 
worker.worker1.host=localhost 
worker.worker1.port=8009 


Here's the mod_jk log snippet (also attached for better readability) from 
attempting to access http://www.mydomain.com/hello (see the one error about 3/4 
of the way down; it looks like there was a 30 sec timeout just before the 
error; http.conf sets Timeout to 300s; maybe mod_jk or GlassFish has a 30s 
timeout?): 


[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
find_match::jk_uri_worker_map.c (863): Found a wildchar match '/hello=worker1' 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] jk_handler::mod_jk.c 
(2522): Into handler jakarta-servlet worker=worker1 r-proxyreq=0 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
wc_get_worker_for_name::jk_worker.c (116): found a worker worker1 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
wc_maintain::jk_worker.c (339): Maintaining worker worker1 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
wc_get_name_for_type::jk_worker.c (293): Found worker type 'ajp13' 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
init_ws_service::mod_jk.c (1024): Service protocol=HTTP/1.1 method=GET 
ssl=false host=(null) addr=xxx.xxx.xxx.xxx 
name=www.mydomain.com port=80 auth=(null) user=(null) laddr=xxx.xxx.xxx.xxx 
raddr=xxx.xxx.xxx.xxx uri=/glassfish-user/index.jsp 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
ajp_get_endpoint::jk_ajp_common.c (3161): acquired connection pool slot=0 after 
0 retries 
[Thu Feb 09 16:27:16 2012] [32475:140136270534592] [debug] 
ajp_marshal_into_msgb::jk_ajp_common.c (647): ajp marshaling done 

Re: desperate for help to set up straightforward mod_jk connection between Apache2 webserver and web container

2012-02-11 Thread modjklist
Hi Pid, 


1. When I say GlassFish embeds Tomcat I just mean it's derived from Tomcat 
(could be fork, etc.) 


2. I should have mentioned the configuration for GlassFish to talk to mod_jk. I 
used the example in the admin's document (go here: 
http://docs.oracle.com/cd/E18930_01/html/821-2416/ and click on PDF link, turn 
to page 150. This starts the section To enable mod_jk which I've been 
following to the letter. Specifically see steps 5 and 6 on page 151, and 
summarized below as): 




asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 
--defaultvs server jk-connector --port 4850 



asadmin create-network-listener --protocol http-listener-1 --listenerport 8009 
--jkenabled true jk-connector --port 4850 



asadmin set 
server-config.network-config.network-listeners.network-listener.jk-connector.jk-configuration-file=/home/glassfish/glassfish3/glassfish/domains/domain1/config/glassfish-jk.properties
 --port 4850 


3. When I look at the Glassfish server log, it has the following warning 
triggered at the exact time of the 30 second timeout seen in the mod_jk.log 
file below. 


[#|2012-02-11T15:44:03.620-0800|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=14;_ThreadName=Thread-2;|GRIZZLY0023:
 Interrupting idle Thread: http-thread-pool-8009(4).|#] 


- Original Message -
From: Pid * p...@pidster.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Saturday, February 11, 2012 3:44:12 PM 
Subject: Re: desperate for help to set up straightforward mod_jk connection 
between Apache2 webserver and web container 

On 11 Feb 2012, at 23:36, modjkl...@comcast.net modjkl...@comcast.net 
wrote: 

I'm trying to get Apache2 Webserver talking to Glassfish3 using mod_jk on 
CentOS, where everything is a fresh install (new server), no load 
balancing, no clustering, and everything is all on one server (so no 
firewall between Apache and Glassfish). I'm quite desperate to get this 
working, and embarrased how long I'm spending on this with no end in sight. 
I'm a newbie so watch out for potentially something obvious. 

My system (I SSH into it from remote client): 

1. new CentOS 6.2 server 
2. Sun Java 1.6.0_30 
3. mod_jk.so built from tomcat-connectors-1.2.32-src.tar 
4. GlassFish 3.1.1 (note: Glassfish Embeds Tomcat) 


Does it? I thought it was a fork, but I could be wrong... 


5. Apache Webserver 2.2.21 

Everything works great when using port 8080. For example, an example 
hello.war application ( 
http://docs.oracle.com/cd/E19798-01/821-1757/geyvr/index.html) deployed on 
GlassFish runs fine from: 

http://www.mydomain.com:8080/hello/ 

My question is, what do I need to change (or add) such that I can access 
the hello.war application using an address like this (and using port 80; so 
I can eventually close port 8080)? 


http://www.mydomain.com/hello/ 

The goal is to have all external traffic pass through Apache webserver port 
80 to access GlassFish. For what it's worth, I used this site's 
instructions (http://www.codefactorycr.com/glassfish-behind-apache.html) as 
inspiration. 

When I restart Apache webserver and go to: 

http://www.mydomain.com/hello 

the website hangs (spinning wheel for 30s). What could be the problem? To 
confuse things, GlassFish 3.1.1 has a bug that leads to a error decoding 
request in the server log. I don't see this error in the server log. 
Nevertheless, I downloaded the bug fix file and I'm using it. It didn't 
change anything, still same error shown below. This bug is documented here: 
http://java.net/jira/browse/GLASSFISH-17068?page=com.atlassian.jira.plugin.system.issuetabpanels%3Aall-tabpanel
 


How have you configured Glassfish to listen for AJP connections on port 
8009? 


p 




Any help MUCH MUCH MUCH appreciated! 

For reference, my httpd.conf file includes the following (among other 
things): 

LoadModule jk_module /etc/httpd/modules/mod_jk.so 
JkWorkersFile /etc/httpd/conf/workers.properties 
JkLogFile /etc/httpd/logs/mod_jk.log 
JkLogLevel debug 
JkLogStampFormat [%a %b %d %H:%M:%S %Y]  
JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories 
JkRequestLogFormat %w %V %T 
... 
Listen 0.0.0.0:80 
User nobody 
Group nobody 
ExtendedStatus On 
ServerAdmin n...@address.com 
ServerName host3.mydomain.com 
LogLevel warn 
Timeout 300 
ServerSignature On 
RewriteEngine On 
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect 
RewriteLock /usr/local/apache/logs/rewrite_lock 
UserDir public_html 

... 
NameVirtualHost xx.xxx.xxx.xxx:80 
NameVirtualHost * 
VirtualHost * 
ServerName host3.mydomain.com 
DocumentRoot /usr/local/apache/htdocs 
ServerAdmin n...@address.com 
/VirtualHost 
VirtualHost xx.xxx.xxx.xxx:80 
ServerName mydomain.com 
ServerAlias www.mydomain.com 
DocumentRoot /home/gkk/public_html 
ServeAdmin webmas...@mydomain.com 
UseCanonicalName Off 
Include /user/local/apache/conf/userdata/std/2/gkk/ 
mydomain.com/*.conf 
/VirtualHost 

the file 

Re: desperate for help to set up straightforward mod_jk connection between Apache2 webserver and web container

2012-02-11 Thread modjklist

Thanks everyone, some more info: 


1. Note that over the last week I've submitted to GlassFish forum here: 


http://www.java.net/forum/topic/glassfish/glassfish/need-help-glassfish-install-front-ended-apache2-modjk#comment-822040
 


to serverfault here: 


http://serverfault.com/questions/359218/mod-jk-log-error-message-what-does-it-hint-might-be-the-issue
 


to stackoverflow here: 


http://stackoverflow.com/questions/9220969/access-web-container-through-apache-webserver-port-80-using-mod-jk
 




but didn't get much feedback. I submitted here because I was hoping someone 
with mod_jk experience could interpret the log file lines below as to what it 
means, and brainstorm what could potentially be causing such an error. I don't 
know if the GlassFish folks would be as knowledgeable here. 


For example, if a socket connection is established and AJP transmission occurs, 
even though it's only one way, would GlassFish have to be listening for this to 
happen? Would GlassFish have to reply via AJP to establish a socket? That sort 
of thing. What does the log file tell us about the communication between Apache 
and GlassFish, and what does it not tell that we would need to know to pinpoint 
the problem, etc.? 


2. Note that port 4850 is an administrator port open simply for web-console 
administration of GlassFish (it can also be accessed from command line). 


3. Note that I can use netstat to verify tcp connection status ESTABLISHED in 
both directions (Apache to GlassFish, and GlassFish to Apache). 

- Original Message -
From: Pid * p...@pidster.com 
To: Tomcat Users List users@tomcat.apache.org 
Sent: Saturday, February 11, 2012 4:10:54 PM 
Subject: Re: desperate for help to set up straightforward mod_jk connection 
between Apache2 webserver and web container 

On 12 Feb 2012, at 00:03, modjkl...@comcast.net modjkl...@comcast.net 
wrote: 

 Hi Pid, 
 
 
 1. When I say GlassFish embeds Tomcat I just mean it's derived from Tomcat 
 (could be fork, etc.) 
 
 
 2. I should have mentioned the configuration for GlassFish to talk to mod_jk. 
 I used the example in the admin's document (go here: 
 http://docs.oracle.com/cd/E18930_01/html/821-2416/ and click on PDF link, 
 turn to page 150. This starts the section To enable mod_jk which I've been 
 following to the letter. Specifically see steps 5 and 6 on page 151, and 
 summarized below as): 

Sorry, I'm on an iPhone. Opening a 150+ page PDF is a bit unappealing. 


 asadmin create-http-listener --listenerport 8009 --listeneraddress 0.0.0.0 
 --defaultvs server jk-connector --port 4850 

Nothing like Tomcat then... 

 asadmin create-network-listener --protocol http-listener-1 --listenerport 
 8009 --jkenabled true jk-connector --port 4850 
 
 asadmin set 
 server-config.network-config.network-listeners.network-listener.jk-connector.jk-configuration-file=/home/glassfish/glassfish3/glassfish/domains/domain1/config/glassfish-jk.properties
  --port 4850 

From the above it's not clear to me whether AJP is running on port 
8009 or port 4580. 

As your minimal mod_jk config looks OK at first glance I'd suggest you 
need help from the Glassfish community. 

Or you could install Tomcat instead. 


p 


 3. When I look at the Glassfish server log, it has the following warning 
 triggered at the exact time of the 30 second timeout seen in the mod_jk.log 
 file below. 




 [#|2012-02-11T15:44:03.620-0800|WARNING|glassfish3.1.1|com.sun.grizzly.config.GrizzlyServiceListener|_ThreadID=14;_ThreadName=Thread-2;|GRIZZLY0023:
  Interrupting idle Thread: http-thread-pool-8009(4).|#] 
 
 
 - Original Message - 
 From: Pid * p...@pidster.com 
 To: Tomcat Users List users@tomcat.apache.org 
 Sent: Saturday, February 11, 2012 3:44:12 PM 
 Subject: Re: desperate for help to set up straightforward mod_jk connection 
 between Apache2 webserver and web container 
 
 On 11 Feb 2012, at 23:36, modjkl...@comcast.net modjkl...@comcast.net 
 wrote: 
 
 I'm trying to get Apache2 Webserver talking to Glassfish3 using mod_jk on 
 CentOS, where everything is a fresh install (new server), no load 
 balancing, no clustering, and everything is all on one server (so no 
 firewall between Apache and Glassfish). I'm quite desperate to get this 
 working, and embarrased how long I'm spending on this with no end in sight. 
 I'm a newbie so watch out for potentially something obvious. 
 
 My system (I SSH into it from remote client): 
 
 1. new CentOS 6.2 server 
 2. Sun Java 1.6.0_30 
 3. mod_jk.so built from tomcat-connectors-1.2.32-src.tar 
 4. GlassFish 3.1.1 (note: Glassfish Embeds Tomcat) 
 
 
 Does it? I thought it was a fork, but I could be wrong... 
 
 
 5. Apache Webserver 2.2.21 
 
 Everything works great when using port 8080. For example, an example 
 hello.war application ( 
 http://docs.oracle.com/cd/E19798-01/821-1757/geyvr/index.html) deployed on 
 GlassFish runs fine from: 
 
 http://www.mydomain.com:8080/hello/ 
 
 My question is, what do I need to change (or add)