Tag Info

Hot answers tagged

8

Both methods forward requests from apache to tomcat. mod_proxy uses the HTTP that we all know an love. mod_jk uses a binary protocol AJP. The main advantages of mod_jk are: AJP is a binary protocol, so is slightly quicker for both ends to deal with and uses slightly less overhead compared to HTTP, but this is minimal. AJP includes information like original ...


4

The first location you should take a look at is catalina.out, it will tell you what might be wrong. If you can't make it works with multicast, just try static membership (I think it will simpler). Below is my config: Put the <Cluster node inside the <Host element: <Engine name="Catalina" defaultHost="localhost" jvmRoute="tomcat1"> ...


3

Maybe your configuration is wrong. Documentation is not specified sticky-session working only cookies. stickysession - Balancer sticky session name. The value is usually set to something like JSESSIONID or PHPSESSIONID, and it depends on the backend application server that support sessions. If the backend application server uses different name for ...


3

I've successfully used: SetEnvIf Origin "http(s)?://(domaine1\.com|domain2\.com)$" AccessControlAllowOrigin=$0 Header set Access-Control-Allow-Origin %{AccessControlAllowOrigin}e env=AccessControlAllowOrigin from http://www.cameronstokes.com/2010/12/26/cross-origin-resource-sharing-and-apache-httpd/


3

Yes there is some difference. However, which you choose to use would depend on your application. As an example, *mod_proxy* will function as a normal reverse proxy which will forward only regular headers across while *mod_jk* would function as a special connector that forwards not only regular headers but also certain other environment variables. A simile ...


3

The pattern /console/* wont match /console. Normally it's easiest to set up the JkMounts as JkMount /console ajp13 JkMount /console/* ajp13 For debugging things like this it's very useful to increase the logging level, so set JkLogLevel debug and have a read through the log you specified.


3

How good is Glassfish at serving static content? Name-based vhosting? Redirects? I'm willing to bet that Apache is better at it all. If you're particularly interested in a small footprint frontend webserver, though, look at nginx instead of Apache.


3

From the look of things, I would guess that it's the mod_proxy sections in the middle: ProxyPass /ourapp http://127.0.0.1:8180/ourapp ProxyPassReverse /ourapp http://127.0.0.1:8180/ourapp ProxyPass /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequester ProxyPassReverse /pbsEasyRequester http://127.0.0.1:8180/pbsEasyRequest ProxyPass /ordertracking ...


3

Over the years there have been a number of connectors developed to enable Apache httpd to communicate with Tomcat that have used a variety of protocols. When searching the web for information on how to do this, it isn't unusual to stumble across some really bad, out of date advice. So first of all the only options you should consider for this are: mod_jk ...


3

There's a problem initializing the shared memory that is needed by the workers. Check whether the directory /etc/httpd/logs/ exists and is writable by the user that's running the tomcat instance. If it isn't, either change the permissions on the directory, or create a separate directory to keep the shm files in. (I'd recommend the latter, simply because ...


2

JIRA don't officially support putting tomcat behind apache unless you use mod_proxy_http. The recommended configuration goes something like this /etc/httpd/vhosts.d/jira.company.com.conf ... ProxyPreserveHost On <Location /> ProxyPass http://localhost:8080/ </Location> ... /opt/j2ee/domains/company.com/jira/tomcat/conf/server.xml ... ...


2

mod_proxy will truely "proxy" all requests to tomcat using the normal http connectors. mod_jk opens up "ajp13" connections to the tomcat server which are separate from the normal tomcat http connectors and passes traffic that way.


2

It works fine and is very simple to setup. Only problem I found is that there is no way to attach a root domain name to Amazon's ELB because ELB IP's changes. For me this is critical so I'm testing other solutions like HA Proxy. ELB + Elastic IP would be a great solution for load balancing.


2

After a long search I have found the answer to this one. The rewrite directive must be placed globally for the (virtual) host not in the or in a .htaccess. Apache appears not to actually parse those files as the files served out of mod_jk are not part of that structure; which makes sense if you think about it. It will however apply mod_rewrite rules that ...


2

Don't use mod_jk2 (which is deprecated anyway), but use mod_proxy with ProxyPass and ProxyReversePass. Much easier to configure, even your exception for static content can be expressed easily: ProxyPass /statics ! ProxyPass / http://localhost:8080 ProxyPassReverse / http://localhost:8080 The drawback is obviously that if the Java application wants to read ...


2

Since it's a redirect, you need "header set always ..." due to some unfortunate Apache internals. As long as you're not editing/overwriting an existing header, "always" is reasonable to just slap in there w/o much worry.


2

If you're going with mod_jk, which is a popular option, Oscar's answer is correct. You need to limit what gets processed by Tomcat by changing something like this: JkMount /* ajp13_worker ...to just the paths you'd like processed by Tomcat, e.g.: JkMount /*.jsp ajp13_worker JkMount /*.cfc ajp13_worker JkMount /*.cfm ajp13_worker If you're looking for ...


2

For creating the sticky we need to add the following line in your configuration(mod_proxy) Header add Set-Cookie "BALANCEID=hej.%{BALANCER_WORKER_ROUTE}e; path=/;" env=BALANCER_ROUTE_CHANGED Then specify the route name in the config <Proxy balancer://mycluster> BalancerMember http://tomcat sever1.ip:8080 route=AcZxv BalancerMember ...


2

Well, you can do it in two ways: Using apache mod_rewrite to rewrite the URLs, it's not very easy but works Using something in front of apache to provide a reverse proxy. nginx is a very popular option, very fast and easy do configure. Varnish is a caching reverse proxy, it's harder to configure than nginx but provides cache. There are some examples: ...


2

Setup another Tomcat instance that just displays the maintenance page. Run it instead of your application Tomcat. BTW you can gracefully restart the Apache HTTP server which recycles each thread serving requests once each thread has finished it's current request, so no requests are dropped.


2

Is this a precompiled mod_jk that you found? If so, then it's simple enough to just grab the latest source for mod_jk and compile it, I suspect this is where your problem is - I've compiled mod_jk against the vendor supplied (Red Hat) Apache a lot of times without segfaults. Make sure httpd-devel is installed (Red Hat/CentOS) Unpack the real JDK to some ...


2

With mod_jk you'll want to do something like this:- RewriteEngine On RewriteRule ^/(.*)$ /portal/$1 [PT] The PT flag is needed so it Passes Through and hit's the JkMount stuff. This will rewrite everything to go to the portal context in tomcat, which is fine if you only have one application in tomcat, but if you start adding other contexts you'll need to ...


2

Given that you're using Ubuntu 10.04, have you tried sudo apt-get install libapache2-mod-jk? That should work, and then all you need to do is sudo a2enmod jk and sudo /etc/init.d/apache2 restart And it should work..


2

These are not error, but informational messages ("info"). As you can see here, here or here, a message like sending request to tomcat failed (unrecoverable), because of client write error (attempt=1) usually means means that the client disconnected by pressing the stop or back button in their browser during or after a request, thus Tomcat cannot ...


2

http proxy would open many connections between your balabcer and app server. mod_jk should be less resource hungry because AJP protocol handles many requests through a single connection. Also with mod_jk should be easier to serve static contents through the apache httpd. btw mod_cluster has advantages dealing with dynamically adding and removing servers ...


2

Dynamic Shared Objects might solve your problem more readily. This not only would allow you to use a statically compiled mod_rails, but also any other compiled module you wish to load as you need. Essentially once you statically compile the mod_so module, any other statically compiled modules can be added or removed via the LoadModule command in httpd.conf. ...


2

You have a couple of questions here, i'll try and answer them in order. That is, I thought the concept of ports was to facilitate machine-to-machine communication. If everything's on the same machine, do they even need a port number open to communicate? Yes, and no. What ports are used for is to allow multiple IP based services talk to each other. It ...


2

You place the JkMount directives inside the httpd.conf virtual host you want them to apply to.


2

SSL is used to encrypted communications between a client and your web service. If you are putting Apache in front of Tomcat, then you need to configure Apache with the SSL certificate...and you don't need it at all for Tomcat, because Apache is handling all of the client communication. If certificate paths need to be configured in both apache and ...


2

Generally Varnish can deliver a cache hit several orders of magnitude faster than Tomcat - typically TTFB is microseconds for Varnish and milliseconds for Tomcat. So, the performance of the connector (AJP vs HTTP) probably won't matter when Varnish is involved. So, go for the simpler setup - have Tomcat speak directly to Varnish. The marginal effect AJP ...



Only top voted, non community-wiki answers of a minimum length are eligible