httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jérôme Tytgat <jerome.tyt...@asterion.fr>
Subject Re: [users@httpd] Mod_proxy and javascript problem
Date Fri, 26 Aug 2005 08:05:54 GMT
That's a good starting point.

I've redone the vhost like that :
<VirtualHost *:443>
        SSLEngine On
        SSLProxyEngine on
        SSLCACertificateFile /etc/apache2/ssl/cacert.pem
        #SSLCertificateFile /etc/apache2/ssl/www.toto.net.crt
        #SSLCertificateKeyFile /etc/apache2/ssl/www.toto.net.key
        SSLCertificateFile /etc/apache2/ssl/newcert.pem
        SSLCertificateKeyFile /etc/apache2/ssl/private.key

        ServerAdmin webmaster@toto.net
        ServerName www.toto.net
        ServerAlias toto.net

        CustomLog /var/log/apache2/https.toto.net.log combined
        ErrorLog /var/log/apache2/https.toto.net.error.log

        RewriteEngine on
        RewriteOptions inherit
        RewriteLog "/var/log/apache2/rewrite.https.toto.net.log"
        RewriteLogLevel 0

        ProxyRequests off
        ProxyVia Off
        ProxyErrorOverride Off
        ProxyPreserveHost Off
        <Proxy *>
                Order Deny,Allow
                Allow from all
        </Proxy>

        #ProxyPass /prod/ http://1.0.0.3/
        #ProxyPass /class/ http://1.0.0.2/
        ProxyHTMLURLMap http://1.0.0.2 /class
        ProxyHTMLURLMap http://1.0.0.3 /prod

        <Location "/prod/">
            ProxyPassReverse http://1.0.0.3/
            SetOutputFilter      proxy-html
            ProxyHTMLURLMap / /prod/
            ProxyHTMLURLMap /prod /prod
        </Location>
        <Location "/class/">
            ProxyPassReverse http://1.0.0.2/
            SetOutputFilter      proxy-html
            ProxyHTMLURLMap / /class/
            ProxyHTMLURLMap /class /class
        </Location>
        <Location "/">
        #    ProxyPass http://1.0.2.1/
            ProxyPassReverse http://1.0.2.1/
        </Location>


        #Stats

        Alias /sst/stats-icon/ /usr/share/stats/icon/
        ScriptAlias /sst/cgi-bin/ /usr/lib/cgi-bin/
        #ScriptAlias /sst/cgi-bin/ /usr/lib/cgi-bin/plouf/
        Alias /sst/     /usr/share/stats/
        <Location "/sst/">
                SecFilterEngine Off
                Options None
                AllowOverride None
                Order Deny,Allow
                Allow from all
                AuthName "Statistiques www.toto.net"
                AuthType Digest
                AuthDigestFile /var/www/plouf/.htpasswd-digest
                require valid-user
        </Location>

        <Directory /var/lib/stats>
                Options None
                AllowOverride None
                Order Deny,Allow
        </Directory>
        <Directory /usr/share/stats>
                Options None
                AllowOverride None
                Order Deny,Allow
        </Directory>

        # RewriteRules

        RewriteRule ^/sst$              https://www.toto.net/sst/stats.html [R,NC]
        RewriteRule ^/sst/$             https://www.toto.net/sst/stats.html [R,NC]

        RewriteRule ^/class$            https://www.toto.net/class/ [R,NC]
        RewriteRule ^/class/class(.*)$  https://www.toto.net/class$1 [R,NC]

        RewriteRule ^/prod$             https://www.toto.net/prod/ [R,NC]
        RewriteRule ^/prod/prod(.*)$    https://www.toto.net/prod$1 [R,NC]

        RewriteCond %{HTTP_REFERER}     ^https://(www\.)?toto.net/class/.*$ [NC]
        RewriteCond %{REQUEST_URI}      !^/class/.*$ [NC]
        RewriteRule ^/(.*)$             https://www.toto.net/class/$1 [R]

        RewriteCond %{HTTP_REFERER}     ^https://(www\.)?toto.net/prod/.*$ [NC]
        RewriteCond %{REQUEST_URI}      !^/prod/.*$ [NC]
        RewriteRule ^/(.*)$             https://www.toto.net/prod/$1 [R]

        RewriteRule ^/prod/(.*)$        http://1.0.0.3/$1 [P,L,NC]
        RewriteRule ^/class/(.*)$       http://1.0.0.2/$1 [P,L,NC]
        RewriteRule ^/totoloc/(.*)$   https://1.0.2.1/totoloc/$1 [P,L,NC]

        RewriteCond %{REQUEST_URI}      !^/sst/.*$ [NC]
        RewriteRule ^/(.*)$             http://1.0.2.1/$1 [P,L]

        #ProxyPassReverse /prod/         http://1.0.0.3/
        #ProxyPassReverse /class/        http://1.0.0.2/
        #ProxyPassReverse /totoloc/    https://1.0.2.1/totoloc/
        #ProxyPassReverse /              http://1.0.2.1/

        SecAuditLog /var/log/apache2/audit.https.toto.net.log
</VirtualHost>

I've first tested with only the proxy/proxypass directive and at least it's working like
before for the rest of the webservers but my rewriterules are not working anymore
(looks like mod_proxy have some precedence on mod_rewrite).

So i've put again the rewrite rules.

In both case the html page is somewhat messed up now :

<!-- Copyright (c) Microsoft Corporation. All rights reserved. -->
<!-- _localBinding --><!-- _lcid="1036" _version="" -->
<!--html>
<!--head>
<script language="jscript" src="/class/CSInc/Admin/Admin.js"></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="GENERATOR" content="Microsoft Visual Studio 6.0">
<title>Microsoft Class Server - Page d'accueil de l'administrateur</title>
<!--/head>
<!--body border="0" bordercolor="silver" leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0"
class="clsTopFrameBody" style="border:0px; margin:0px;"><form action="StudentBrowse.htm"
method="POST" id="HOME" name="HOME">

<link rel="stylesheet" type="text/css" href="/class/CSInc/Admin/Admin.css">

<table class="clsTable" style="color:white; width:100%; height=42pt" cellpadding="0" cellspacing="0">
	<tr style="background-color:#663333; height:8%;" cellpadding="0" cellspacing="0">
		<td colspan="3" class="clsOperationTitleTD" style="vertical-align:middle;">Administrateur
Microsoft Class Server </td>
		<td align="right" style="font-weight:normal">
			<span style="color:#CC9999;" name="HOMEREF" id="HOMEREF" align="left"><b>Accueil</b></span>&amp;nbsp
| &amp;nbsp
			<span class="clsSpanLink" tabindex="1" name="LOGOFFREF" id="LOGOFFREF" m_straction="Signout.htm"
style="behavior:url(/CSInc/Admin/link.htc);" title="Cliquez pour quitter le site Web de l'administrateur
sans fermer votre navigateur">Déconnexion</span>&amp;nbsp | &amp;nbsp
			<a tabindex="2" href="Help.htm" target="_search" title="Afficher l'aide en ligne"><b>Aide</b></a>&amp;nbsp&amp;nbsp
		</td>
	</tr>
	<tr style="color:#996666; height:12%;" cellpadding="0" cellspacing="0">
		<td valign="bottom"></td>
	</tr>
	<tr style="line-height:0pt;">
		<td>
			<table width="250" border="0" cellspacing="0" cellpadding="0">
				<tr style="line-height:0pt;">
					<td>&amp;nbsp</td>
				</tr>
			</table>
		</td>
	</tr>
</table>	
<table style="color:blue; width:100%;height=40pt" cellpadding="0" cellspacing="0">
	<tr cellpadding="0" cellspacing="0">
		<td>&amp;nbsp</td>
	</tr>
</table>	

<table style="color:blue; width:100%; font-size:9pt" cellpadding="0" cellspacing="0" border="0">
	<tr style="color:#663333; height: 26pt;" cellpadding="0" cellspacing="0">
		<td width="20%">&amp;nbsp</td>
		<td colspan="2" class="clsOperationTitleTD" style="vertical-align:middle;"> Les administrateurs
peuvent ajouter ou modifier :</td>
	</tr>
	<tr style="height:26pt;" cellpadding="0" cellspacing="0">
		<td>&amp;nbsp</td>
		<td m_straction="TeacherBrowse.htm" style="behavior:url(/CSInc/Admin/link.htc);" tabindex="3"><span
name="TREF" id="TREF">&amp;nbsp <li><u><b>Informations sur les enseignants</b></u></li></span></td>
		<td width="40%">&amp;nbsp</td>
	</tr>
	<tr style="height:26pt;" cellpadding="0" cellspacing="0">
		<td>&amp;nbsp</td>
		<td m_straction="ClassBrowse.htm" style="behavior:url(/CSInc/Admin/link.htc);" tabindex="4"><span
name="CREF" id="CREF">&amp;nbsp <li></li><u><b>Informations
sur les classes</b></u></span></td>
		<td>&amp;nbsp</td>
	</tr>
	<tr style="height:26pt;" cellpadding="0" cellspacing="0">
		<td>&amp;nbsp</td>
		<td m_straction="StudentBrowse.htm" style="behavior:url(/CSInc/Admin/link.htc);" tabindex="5"><span
name="SREF" id="SREF">&amp;nbsp <li></li><u><b>Informations
sur les élèves</b></u></span></td>
		<td>&amp;nbsp</td>
	</tr>
	
	<tr style="height:26pt;" cellpadding="0" cellspacing="0">
		<td>&amp;nbsp</td>
		<td colspan="2" m_straction="School/Home.htm" style="behavior:url(/CSInc/Admin/link.htc);"
tabindex="5"><span name="SREF" id="Span1">&amp;nbsp <li></li><b><u>Page
d'accueil de l'établissement</u></b></span></td>
	</tr>
	
</table>	

<input type="hidden" value="0" id="InList1Hid" name="InList1Hid" style="width:0px; height:0px;
display:none">
	
</form>
<!--/body>
<!--/html>

the "&nbsp" are transformed in "&amp;nbsp" and it's not working better...

I wonder what I should but in ProxyHTMLURLMap (BTW i've followed the directives
found here : http://www.apacheweek.com/features/reverseproxies)

I've also noted that enabling "ProxyHTMLExtended On" makes the authentification
on the application impossible with this error (sorry in french...) :

"Votre navigateur Internet n'est pas configuré actuellement pour l'exécution des scripts
sur les pages Web.
Dans Internet Explorer, vous devez modifier ce paramètre via l'onglet Sécurité de la boîte
de dialogue
Options Internet pour continuer à utiliser l'Administrateur Class Server. Pour plus d'informations,
consultez l'aide en ligne de Internet Explorer. "

It's telling me that my browser is not correctly configured for javascript,
disabling "ProxyHTMLExtended" let me get rid of this error.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> 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


Mime
View raw message