Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 94632 invoked from network); 5 Aug 2010 01:30:38 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 5 Aug 2010 01:30:38 -0000 Received: (qmail 711 invoked by uid 500); 5 Aug 2010 01:30:35 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 635 invoked by uid 500); 5 Aug 2010 01:30:34 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 625 invoked by uid 99); 5 Aug 2010 01:30:34 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 01:30:34 +0000 X-ASF-Spam-Status: No, hits=4.7 required=10.0 tests=FREEMAIL_FROM,FREEMAIL_REPLY,HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lkolchin@gmail.com designates 209.85.161.173 as permitted sender) Received: from [209.85.161.173] (HELO mail-gx0-f173.google.com) (209.85.161.173) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 05 Aug 2010 01:30:29 +0000 Received: by gxk19 with SMTP id 19so2577324gxk.18 for ; Wed, 04 Aug 2010 18:30:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=SQpPZ4FdWl7hU5VU9VX2h2+Zupz4tBf62bRVa+JQQmA=; b=eTwUqsCTXYPt8CqOmL9YXZe8b82YjoOWpzgewUOTa4QXG+cED4t0V9ckpsfGMVk0+h 36EhA14QHpKBO8wfoxecEOdO76XoqTCney2U8hgFIooGrTu62r77LKYcXw8T45So9d7u 2nmSxyXL4466E3dtE8jGjoYlR8YdiSudC/sUo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=K/yH5q3jMTWRUSLDMZtQvJqO/mSrVIm8nIVfuTj8z6+y1IYZGrYt9oGWF/C1NizDN/ HhvAuaiD/Ay+sCupLl6tLSGfhfHejMv5l3flgJCdIzh70j0MlQVMVSH22BD7yy68O/Is eFks1X9S91DCYgP4UF5DaaoPed/ZQ1425ulkI= MIME-Version: 1.0 Received: by 10.231.15.68 with SMTP id j4mr11014649iba.184.1280971807539; Wed, 04 Aug 2010 18:30:07 -0700 (PDT) Received: by 10.231.178.214 with HTTP; Wed, 4 Aug 2010 18:30:07 -0700 (PDT) In-Reply-To: <4C597223.5080609@christopherschultz.net> References: <4C567B39.4010308@kippdata.de> <33234cfc0f6a529ecec454f4f158bf67@localhost> <4C569A79.8010305@kippdata.de> <4C597223.5080609@christopherschultz.net> Date: Thu, 5 Aug 2010 11:30:07 +1000 Message-ID: Subject: Re: Rewrite URLs inside HTML pages? From: Leon Kolchinsky To: Tomcat Users List Content-Type: multipart/alternative; boundary=00221532c4fc8e4372048d097d34 --00221532c4fc8e4372048d097d34 Content-Type: text/plain; charset=ISO-8859-1 Hi, Hmm. Interesting. Of course I'd like to make it work with "simple configuration" or/and with JkHTTPSIndicator. I'm just not clear on how to make this "simple configuration". As I've said there is no SSL handling on the server side. All SSL request handled on the load balance level which in turn talks to Apache (configured to talk to Tomcat via mod_jk) via http. myserv.mydomain.com - Tomcat server's Domain name sakai-stg.mydomain.com - Load balancer's Domain name Clients coming to Load Balancer's URL https://sakai-stg.mydomain.com need to use internal links (submit forms etc.) which appear as http:// sakai-stg.mydomain.com/..... on the served pages. Submitting forms is not working in that scenario since the links should look like this inside the pages - https://sakai-stg.mydomain.com/..... Please see my mod_jk.conf, workers.properties, 01myserv.mydomain.com.conf files below. Can you come up with a solution without using mod_substitute as I do now? [root@myserv mod_sed]# cat /etc/httpd/conf/mod_jk.conf LoadModule jk_module modules/mod_jk.so # mod_jk config # Where to find workers.properties # Update this path to match your conf directory location (put workers.properties next to httpd.conf) JkWorkersFile /etc/httpd/conf/workers.properties # Where to put jk shared memory # Update this path to match your local state directory or logs directory JkShmFile /var/log/httpd/mod_jk.shm # Where to put jk logs # Update this path to match your logs directory location (put mod_jk.log next to access_log) JkLogFile /var/log/httpd/mod_jk.log # Set the jk log level [debug/error/info] JkLogLevel info # Select the timestamp log format JkLogStampFormat "[%a %b %d %H:%M:%S %Y] " #JkOptions indicate to send SSL KEY SIZE, JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories # JkRequestLogFormat set the request format JkRequestLogFormat "%w %V %T" # Globally deny access to the WEB-INF directory AllowOverride None deny from all [root@myserv mod_sed]# [root@myserv mod_sed]# cat /etc/httpd/conf/workers.properties # # This file provides minimal jk configuration properties needed to # connect to Tomcat. # # We define a workers named worker1 and worker2 workers.tomcat_home=/srv/tomcat/ workers.java_home=/srv/jdk ps=/ worker.list=worker1 worker.worker1.type=ajp13 worker.worker1.host=localhost worker.worker1.port=8009 worker.worker1.lbfactor=1 # Load-balancing behaviour (add when you have more than 1 worker and change worker.workerX.host and worker.list accordingly) # worker.loadbalancer.type=lb # Status worker for managing load balancer (add when you have more than 1 worker) worker.status.type=status [root@myserv mod_sed]# [root@myserv mod_sed]# cat /etc/httpd/conf/vhosts.d/01myserv.mydomain.com.conf LoadModule substitute_module modules/mod_substitute.so NameVirtualHost *:80 ServerName myserv.mydomain.com ServerAdmin Leon.Kolchinsky@mydomain.com ServerAlias sakai-stg # Just in case DocumentRoot /srv/sakai # if not specified, the global error log is used ErrorLog /var/log/httpd/myserv.mydomain.com-error_log CustomLog /var/log/httpd/myserv.mydomain.com-access_log combined # don't loose time with IP address lookups HostnameLookups Off # needed for named virtual hosts UseCanonicalName Off # Add index.jsp to DirectoryIndex files DirectoryIndex index.php index.html index.htm index.shtml index.php4 index.php3 index.phtml index.cgi index.jsp JkMount /* worker1 AddOutputFilterByType SUBSTITUTE text/html Substitute "s|http://myserv|https://sakai-stg|i" Substitute "s|http://sakai-stg|https://sakai-stg|i" Best Regards, Leon On Wed, Aug 4, 2010 at 23:58, Christopher Schultz < chris@christopherschultz.net> wrote: > -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Leon, > > On 8/3/2010 2:45 AM, Leon Kolchinsky wrote: > > Thanks for your help Rainer/Felix, > > > > I've tested several options including mod_substitute and mod_sed and it > > seems that mod_substitute is a way to go. > > Yuk: why go through the kludge of re-writing the pages when simple > configuration can make it so the pages are correct in the first place? > > - -chris > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.4.10 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ > > iEYEARECAAYFAkxZciMACgkQ9CaO5/Lv0PBqtQCgqVkecwM/GcfFnpZY4CeQ5M+g > weIAnjBkSVjFNpyHaRJ6b58XRXjwIu41 > =x21u > -----END PGP SIGNATURE----- > > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org > For additional commands, e-mail: users-help@tomcat.apache.org > > -- Leon Kolchinsky Senior Software Specialist (Collaborative Applications) ITS Research Support Services Monash e-Research Centre (MeRC) Monash University tel: +61 3 99059560 --00221532c4fc8e4372048d097d34--