On 29.03.2013 13:10, Chris Arnold wrote:
> On 29.03.2013 00:24, Chris Arnold wrote:
>>
>>     # The following line mounts all JSP files and the /servlet/ uri to tomcat
>>     #JkMount /servlets-examples/servlet/* ajp13
>>     JkMount /share/*.jsp ajp13
> 
>>> Note that you only forward JSP-Requests here. might be OK, depending on
>>> the application.
> 
> The application, just for reference, is alfresco
> 
>>     #RewriteEngine On
>>     #RewriteCond %{REQUEST_URI} !^/share/
>>     #RewriteCond %{HTTPS} on
>>     #RewriteRule ^/. http://share.paradixent.com/share/ [P]
>>     #JkMount /share/* worker1
> 
>>> Although the proxy rewrite rules are commented out here, later down the
>>> log indicates you are still somewhere using mod_proxy instead of mod_jk.
> 
> mod_proxy is used on this installation of apache. I am told i need to use 
> mod_jk in this instance. I need users to access this application like so: 
> http://share.domain.com and using mod_jk is the easiest way to do this (thats 
> what i am told)

So mod_proxy is loaded but you don't want to use it to access alfresco,
instead just mod_jk, right? Then don't use any ReWriteRule with the [P}
flag or any Proxy... directive.

OK as above, since commented, so not active.

>> <IfModule mod_jk.c>
>>
>>
>>     # The following line makes apache aware of the location of
>>     # the /jsp-examples context
>>     Alias /share "/opt/alfresco/tomcat/webapps/share"
>>     <Directory "/opt/alfresco/tomcat/webapps/share">
>>     Options Indexes FollowSymLinks
>>     allow from all
>>     </Directory>
> 
>>> You can let Apache serve static content directly from an exploded
>>> webapp, but it is generally not recommended, because you then also open
>>> up stuff that's not expected to be made public to requests from outside.
> 
> I understand this
> 
>>> If below "share" there's anything that's not meant to be served by
>>> Apache, then it would be beter to copy the stuff that Apache should
>> serve to a separate directory, which would then be the one to put into
>>> the Alias.
> 
> but wouldn't this still have stuff below /share open?

Assume all static images, css, js are in some /path/to/my/folder/static
and there's nothing else underneath it, that folder would be a place to
publish directly via Alias in Apache.

>>     # The following line mounts all JSP files and the /servlet/ uri to tomcat
>>     #JkMount /servlets-examples/servlet/* ajp13
>>     JkMount /share/*.jsp ajp13
>>
>>     # The following line prohibits users from directly accessing WEB-INF
>>     <Location "/share/WEB-INF/">
>>     #AllowOverride None
>>     deny from all
>>     </Location>
> 
>>> That's one exampe for stuff you don't want to be served, META-INF as
>>> well (if existing), there could be other stuff as well.
> 
> 
>>     # if not specified, the global error log is used
>>     ErrorLog /var/log/apache2domain.com-error_log
>>     CustomLog /var/log/apache2/domain.com-access_log combined
>>
>> </IfModule>
>>
>> </VirtualHost>
>>
>>
>> httpd.conf-
>>
>> # mod_jk
>> Include /opt/alfresco/tomcat/conf/jk.conf
>>
>>
>> Mod_jk is loaded:
>>
>> web:~ # /usr/sbin/httpd2 -M
>> Loaded Modules:            
>> .......
>> jk_module (shared)
>>  perl_module (shared)
>>  php5_module (shared)
>> Syntax OK
>>
>>
>>
>>
>> Here is the log from apache:
>>
>> [Thu Mar 28 18:40:14 2013] [error] [client pub ip] proxy: Error reading from 
>> remote server returned by /error/HTTP_INTERNAL_SERVER_ERROR.html.var
>> [Thu Mar 28 18:40:28 2013] [error] [client pub ip] (70007)The timeout 
>> specified has expired: proxy: error reading status line from remote server 
>> share.paradixent.com
>> [Thu Mar 28 18:40:28 2013] [error] [client pub ip] proxy: Error reading from 
>> remote server returned by /error/HTTP_INTERNAL_SERVER_ERROR.html.var
> 
>>> What's the request you send?
> i assume you are asking for the link? Which is http://share.domain.com

I'm guessing here: what you want is that the request for
http://share.domain.com should be forwarded to the Tomcat web
application names "share".

For that I would put the following directives into the Apache
VirtualHost that actually serves the request.

- Add a redirect for the URI / to /share/ to the Apache config:

RedirectMatch ^/$ http://share.domain.com/share/

- Forward all requests that point below /share to Tomcat and let them be
served by the webapp:

JkMount /share|/* myworker

You can choose any name for "myworker", but see below for
workers.properties.

- Remove other JkMount, Alias etc.

At this step:

- do not try to serve static content from Apache, first get this to work
before adding the additional complexity.

- do not try to make the webapp /share/ directly available under the top
level directory. It is OK to redirect the a request for
http://share.domain.com/ to http://share.domain.com/share/ and proceed
from there as above, but it is harder to remove the "share" URI path
component from each request. If you really need to do this, then use
mod_proxy, not mod_jk.

>>> What's the expected response
> a login page
> 
>>> and what's the actual response?
> depending on whether i have the rewrite rules commented out or not, 
> uncommented is a directory listing. Commented out is eventually a 503 Bad 
> Gateway.
> 
>>> The above log snippet tells us that somewhere in your config you have
>>> mod_proxy active, which is an alternative way to connect to a backend.
>>> You should get your idea straight, for which URLs you are using
>>> mod_proxy and for which mod_jk. I would suggest to stick with one.
> 
> If it possible to use mod_proxy and have users access 
> http://share.domain.com, thats what i would like to do. I have been unable to 
> accomplish this result and therefore have tried mod_jk.
> 
>>> You didn't show us your worker.properties file.
> workers.properties-

Don't use this configuration. It is garbage.

Download a mod_jk source distribution (recent is version 1.2.37) which
contains a nive default workers.properties file. You can also get it here:

http://svn.apache.org/viewvc/tomcat/jk/trunk/conf/workers.properties?view=co

In that file, remove all lines referring to "node2" and replace "node1"
by whatever worker name you have chosen in JkMount (myworker or whatever).

Finally set "host" and "port" of that worker to whatever port and server
name your Tomcat listens to.


>>> You didn't show us your mod_jk log file.
> 
> [Thu Mar 28 10:00:12.913 2013] [4351:1530722048] [error] init_jk::mod_jk.c 
> (2781): Initializing shm:/srv/www/logs/jk-runtime-status.4351 errno=2. Load 
> balancing workers will not function properly.
> [Thu Mar 28 10:00:12.974 2013] [4353:1530722048] [error] init_jk::mod_jk.c 
> (2781): Initializing shm:/srv/www/logs/jk-runtime-status.4353 errno=2. Load 
> balancing workers will not function properly.

Your config directive

JkShmFile /var/log/alfresco/shm

has not worked. Check whether the directory /var/log/alfresco exists and
is writable.

If you can't solve this, you can set JkLogLevel to debug, which will
produce lots of startup and request handling output we can look at.

Are you using a relatively recent version of mod_jk (1.2.37)? Which
version of Apache are you using?

Regards,

Rainer

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

Reply via email to