Return-Path: Delivered-To: apmail-httpd-users-archive@www.apache.org Received: (qmail 8132 invoked from network); 2 Oct 2008 14:49:57 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 2 Oct 2008 14:49:57 -0000 Received: (qmail 6338 invoked by uid 500); 2 Oct 2008 14:49:44 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 6320 invoked by uid 500); 2 Oct 2008 14:49:44 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 6309 invoked by uid 99); 2 Oct 2008 14:49:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 07:49:44 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of jmedina@e-dialog.com designates 64.28.75.202 as permitted sender) Received: from [64.28.75.202] (HELO corp-mail.e-dialog.com) (64.28.75.202) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 Oct 2008 14:48:44 +0000 X-MimeOLE: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Date: Thu, 2 Oct 2008 10:48:56 -0400 Message-ID: <9DD36C99332AB7438F8D73C048D8C62C01602266@sneezy.ad.e-dialog.com> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [users@httpd] Proxy to Tomcat AJP Thread-Index: AckkDHyurrkUR8CLQsiPf8cI8SibOgAkGSVg References: <9DD36C99332AB7438F8D73C048D8C62C0160214B@sneezy.ad.e-dialog.com> From: "Jorge Medina" To: X-Virus-Checked: Checked by ClamAV on apache.org Subject: RE: [users@httpd] Proxy to Tomcat AJP No, you don't strictly need the Tomcat Native library to run the AJP = connector. It is optional; it increases the performance of your Tomcat = server according to the documentation. Nevertheless, it is recommended = for production settings.=20 "When APR is enabled, the AJP connector will use a socket poller = for keepalive, increasing scalability of the server. As AJP is designed = around a pool of persistent (or almost persistent) connections, this = will reduce significantly the amount of processing threads needed by = Tomcat. Unlike the HTTP connector, the AJP connector cannot use sendfile = to optimize static file processing. "=20 -Jorge ________________________________________ From: gmashini@gmail.com [mailto:gmashini@gmail.com] On Behalf Of George = Mashini Sent: Wednesday, October 01, 2008 5:27 PM To: users@httpd.apache.org Subject: Re: [users@httpd] Proxy to Tomcat AJP Jorge, Thank you for the feedback.=A0 I was going to look at the native APR = once I got everything configured correctly.=A0 Is this necessary for = running the AJP connector?=A0 Does anyone run Apache to Tomcat in = production?=A0 If so, can you please share your experience and some = feedback on how you configured it. Thank you, George On Wed, Oct 1, 2008 at 10:43 AM, Jorge Medina = wrote: Not sure if this help: =A0 Are you using Tomcat Native Library (based in APR too)? It would allow you to specify some parameters of the AJP connector. =A0 http://tomcat.apache.org/tomcat-6.0-doc/printer/apr.html =A0 =A0 -Jorge =A0 ________________________________________ From: George Mashini [mailto:gmashini@gmail.com]=20 Sent: Tuesday, September 30, 2008 8:34 PM To: users Subject: [users@httpd] Proxy to Tomcat AJP =A0 Hello, I setup Apache to proxy to Tomcat using AJP, currently without SSL.=A0 = This is being used to connect a Flex application that uses AMF to Java = on the back end.=A0 All AMF calls are done using a POST to a servlet.=A0 = I have 3 tomcat instances running on separate ports.=A0 Login is used = for logging into the application.=A0 NA1 and NA2 are the application = servers.=A0 This is running on RH Enterprise Linux 5, Apache HTTPD 2.2.3 = and Tomcat 6.0.14 It all appears to work fine until I try to stress test it or someone = uses the application for an extended period of time.=A0 The errors that = we encounter are either connection refused or hung connections, where = the connection is alive but never returns a response.=A0 At one point = the connection would drop after a few minutes when it got hung and I = would get APR errors in Apache and Broken pipe errors in Tomcat, but = after changing some HTTPD configuration settings it now just stays hung = forever.=A0 I run the same stress tests against Tomcat directly and they = all complete without errors.=A0 I researched the configuration for each = side of the connection, but I cannot find what I am doing wrong.=A0 I am = including each piece of the configuration.=A0 Any help would be really = appreciated.=A0 Sorry for the lengthy email. Thank you, HTTPD.conf ####################################### # START HTTPD.CONF ####################################### ServerTokens OS ServerRoot "/etc/httpd" PidFile run/httpd.pid Timeout 120 KeepAlive Off MaxKeepAliveRequests 0 KeepAliveTimeout 15 StartServers=A0=A0=A0=A0=A0=A0 8 MinSpareServers=A0=A0=A0 5 MaxSpareServers=A0=A0 20 ServerLimit=A0=A0=A0=A0=A0 256 MaxClients=A0=A0=A0=A0=A0=A0 256 MaxRequestsPerChild=A0 4000 StartServers=A0=A0=A0=A0=A0=A0=A0=A0 2 MaxClients=A0=A0=A0=A0=A0=A0=A0=A0 150 MinSpareThreads=A0=A0=A0=A0 25 MaxSpareThreads=A0=A0=A0=A0 75=20 ThreadsPerChild=A0=A0=A0=A0 25 MaxRequestsPerChild=A0 0 Listen 80 LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_alias_module modules/mod_authn_alias.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_default_module modules/mod_authn_default.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_default_module modules/mod_authz_default.so LoadModule ldap_module modules/mod_ldap.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule include_module modules/mod_include.so LoadModule log_config_module modules/mod_log_config.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule expires_module modules/mod_expires.so LoadModule deflate_module modules/mod_deflate.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule mime_module modules/mod_mime.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule cache_module modules/mod_cache.so LoadModule suexec_module modules/mod_suexec.so LoadModule disk_cache_module modules/mod_disk_cache.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule mem_cache_module modules/mod_mem_cache.so LoadModule cgi_module modules/mod_cgi.so LoadModule version_module modules/mod_version.so Include conf.d/*.conf User apache Group apache ServerAdmin root@localhost #ServerName www.example.com:80 UseCanonicalName Off DocumentRoot "/srv/www" =A0=A0=A0 Options FollowSymLinks =A0=A0=A0 AllowOverride None =A0=A0=A0 Options Indexes FollowSymLinks =A0=A0=A0 AllowOverride None =A0=A0=A0 Order allow,deny =A0=A0=A0 Allow from all =A0=A0=A0 UserDir disable DirectoryIndex index.html index.html.var AccessFileName .htaccess =A0=A0=A0 Order allow,deny =A0=A0=A0 Deny from all TypesConfig /etc/mime.types DefaultType text/plain #=A0=A0 MIMEMagicFile /usr/share/magic.mime =A0=A0=A0 MIMEMagicFile conf/magic HostnameLookups Off ErrorLog logs/error_log LogLevel warn LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" = combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%{Referer}i -> %U" referer LogFormat "%{User-agent}i" agent CustomLog logs/access_log combined ServerSignature On Alias /icons/ "/var/www/icons/" =A0=A0=A0 Options Indexes MultiViews =A0=A0=A0 AllowOverride None =A0=A0=A0 Order allow,deny =A0=A0=A0 Allow from all =A0=A0=A0 # Location of the WebDAV lock database. =A0=A0=A0 DAVLockDB /var/lib/dav/lockdb ScriptAlias /cgi-bin/ "/var/www/cgi-bin/" =A0=A0=A0 AllowOverride None =A0=A0=A0 Options None =A0=A0=A0 Order allow,deny =A0=A0=A0 Allow from all IndexOptions FancyIndexing VersionSort NameWidth=3D* HTMLTable AddIconByEncoding (CMP,/icons/compressed.gif) x-compress x-gzip AddIconByType (TXT,/icons/text.gif) text/* AddIconByType (IMG,/icons/image2.gif) image/* AddIconByType (SND,/icons/sound2.gif) audio/* AddIconByType (VID,/icons/movie.gif) video/* AddIcon /icons/binary.gif .bin .exe AddIcon /icons/binhex.gif .hqx AddIcon /icons/tar.gif .tar AddIcon /icons/world2.gif .wrl .wrl.gz .vrml .vrm .iv AddIcon /icons/compressed.gif .Z .z .tgz .gz .zip AddIcon /icons/a.gif .ps .ai .eps AddIcon /icons/layout.gif .html .shtml .htm .pdf AddIcon /icons/text.gif .txt AddIcon /icons/c.gif .c AddIcon /icons/p.gif .pl .py AddIcon /icons/f.gif .for AddIcon /icons/dvi.gif .dvi AddIcon /icons/uuencoded.gif .uu AddIcon /icons/script.gif .conf .sh .shar .csh .ksh .tcl AddIcon /icons/tex.gif .tex AddIcon /icons/bomb.gif core AddIcon /icons/back.gif .. AddIcon /icons/hand.right.gif README AddIcon /icons/folder.gif ^^DIRECTORY^^ AddIcon /icons/blank.gif ^^BLANKICON^^ DefaultIcon /icons/unknown.gif ReadmeName README.html HeaderName HEADER.html IndexIgnore .??* *~ *# HEADER* README* RCS CVS *,v *,t AddLanguage ca .ca AddLanguage cs .cz .cs AddLanguage da .dk AddLanguage de .de AddLanguage el .el AddLanguage en .en AddLanguage eo .eo AddLanguage es .es AddLanguage et .et AddLanguage fr .fr AddLanguage he .he AddLanguage hr .hr AddLanguage it .it AddLanguage ja .ja AddLanguage ko .ko AddLanguage ltz .ltz AddLanguage nl .nl AddLanguage nn .nn AddLanguage no .no AddLanguage pl .po AddLanguage pt .pt AddLanguage pt-BR .pt-br AddLanguage ru .ru AddLanguage sv .sv AddLanguage zh-CN .zh-cn AddLanguage zh-TW .zh-tw LanguagePriority en ca cs da de el eo es et fr he hr it ja ko ltz nl nn = no pl pt pt-BR ru sv zh-CN zh-TW ForceLanguagePriority Prefer Fallback AddDefaultCharset UTF-8 AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddHandler type-map var AddType text/html .shtml Alias /error/ "/var/www/error/" =A0=A0=A0 =A0=A0=A0=A0=A0=A0=A0 AllowOverride None =A0=A0=A0=A0=A0=A0=A0 Options IncludesNoExec =A0=A0=A0=A0=A0=A0=A0 AddOutputFilter Includes html =A0=A0=A0=A0=A0=A0=A0 AddHandler type-map var =A0=A0=A0=A0=A0=A0=A0 Order allow,deny =A0=A0=A0=A0=A0=A0=A0 Allow from all =A0=A0=A0=A0=A0=A0=A0 LanguagePriority en es de fr =A0=A0=A0=A0=A0=A0=A0 ForceLanguagePriority Prefer Fallback =A0=A0=A0 BrowserMatch "Mozilla/2" nokeepalive BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0 BrowserMatch "RealPlayer 4\.0" force-response-1.0 BrowserMatch "Java/1\.0" force-response-1.0 BrowserMatch "JDK/1\.0" force-response-1.0 BrowserMatch "Microsoft Data Access Internet Publishing Provider" = redirect-carefully BrowserMatch "MS FrontPage" redirect-carefully BrowserMatch "^WebDrive" redirect-carefully BrowserMatch "^WebDAVFS/1.[0123]" redirect-carefully BrowserMatch "^gnome-vfs/1.0" redirect-carefully BrowserMatch "^XML Spy" redirect-carefully BrowserMatch "^Dreamweaver-WebDAV-SCM1" redirect-carefully =A0=A0=A0 ServerName xyz.net =A0=A0=A0 ServerName login.xyz.net =A0=A0=A0 ProxyPass / ajp://localhost:8009/ =A0=A0=A0 ProxyRequests Off =A0=A0=A0 ProxyPassReverse / ajp://localhost:8009/ =A0=A0=A0 ProxyPreserveHost On =A0=A0=A0 ServerName na1.xyz.net =A0=A0=A0 ProxyPass / ajp://localhost:8010/ max=3D5 =A0=A0=A0 ProxyRequests Off =A0=A0=A0 ProxyPassReverse / ajp://localhost:8010/ =A0=A0=A0 ProxyPreserveHost On =A0=A0=A0 ServerName na2.xyz.net =A0=A0=A0 ProxyPass / ajp://localhost:8011/ max=3D20 =A0=A0=A0 ProxyPassReverse / ajp://localhost:8010/=20 =A0=A0=A0 ProxyVia On=A0=20 =A0=A0=A0 ProxyPreserveHost On ####################################### # END HTTPD.CONF ####################################### workers.properties in httpd/conf ####################################### # START workers.properties ####################################### # List workers worker.list=3Dlogin, NA1, NA2=20 # # Define loginn worker.login.port=3D8009 worker.login.host=3Dlocalhost worker.login.type=3Dajp13 worker.login.cachesize=3D10 worker.login.cache_timeout=3D600 worker.login.socket_timeout=3D300 # Define NA1 worker.NA1.port=3D8010 worker.NA1.host=3Dlocalhost worker.NA1.type=3Dajp13 worker.NA1.cachesize=3D10 worker.NA1.cache_timeout=3D600 worker.NA1.socket_timeout=3D300 # Define NA2 worker.NA2.port=3D8011 worker.NA2.host=3Dlocalhost worker.NA2.type=3Dajp13 worker.NA2.cachesize=3D10 worker.NA2.cache_timeout=3D600 worker.NA2.socket_timeout=3D300 ####################################### # END workers.properties ####################################### proxy_ajp.conf in httpd/conf.d ####################################### # START proxy_ajp.conf ####################################### LoadModule proxy_ajp_module modules/mod_proxy_ajp.so ####################################### # END proxy_ajp.conf ####################################### Server.xml for NA1 tomact ####################################### # START server.xml ####################################### =A0 =A0 =A0 =A0 =A0 =A0=A0=A0 =A0 =A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0 =A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0 =A0=A0=A0=A0=A0 =A0=A0=A0 =A0 ####################################### # END server.xml #######################################EN =A0 --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See for more info. To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org " from the digest: users-digest-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org