Hello, zope users. I need help. i have apache + zope + VHM configuration: <VirtualHost www.is.lg.ua:5000> ServerName www.is.lg.ua RewriteEngine On RewriteRule ^/(.*) http://192.168.1.1:6080/VirtualHostBase/ http/www.is.lg.ua:5000/is/VirtualHostRoot/$1 [L,P] ProxyVia on </VirtualHost> In root of zope i have /is folder. All this works, but in apache /cgi-bin directory i have irc.cgi script and i need to call www.is.lg.ua:5000/chat so that www.is.lg.ua:5000/cgi-bin/irc.cgi will be called. I tried 'ScriptAlias /chat /cgi-bin/irc.cgi' inside VirtualHost, but that doesn't work, because all mapping goes to zope, so i need probably the rewrite rule, but dunno how to make it work. Maybe you can help me with that? Your help is very, very appreciated. Thanks in advance, Ruslan
Ruslan Spivak wrote:
<VirtualHost www.is.lg.ua:5000> ServerName www.is.lg.ua RewriteEngine On # next 2 lines added to omit http://www.is.lg.ua:5000/chat from Zope's influence RewriteCond %{REQUEST_URI} ^/chat RewriteRule .* - [L] RewriteRule ^/(.*) http://192.168.1.1:6080/VirtualHostBase/ http/www.is.lg.ua:5000/is/VirtualHostRoot/$1 [L,P] ProxyVia on </VirtualHost>
In a production environment, I also suggest adding "/_" "/VirtualHostBase/" and "/VirtualHostRoot/" to your set of regular expressions which dictate what should not be allowed to be sent to Zope via the request URI. See the mailing list archives for more on why. See the apache mod_rewrite docs for how to implement it. -- Jamie Heilman http://audible.transient.net/~jamie/ "Paranoia is a disease unto itself, and may I add, the person standing next to you may not be who they appear to be, so take precaution." -Sathington Willoughby
Jamie Heilman wrote:
Ruslan Spivak wrote:
<VirtualHost www.is.lg.ua:5000> ServerName www.is.lg.ua RewriteEngine On
# next 2 lines added to omit http://www.is.lg.ua:5000/chat from Zope's influence RewriteCond %{REQUEST_URI} ^/chat RewriteRule .* - [L]
RewriteRule ^/(.*) http://192.168.1.1:6080/VirtualHostBase/ http/www.is.lg.ua:5000/is/VirtualHostRoot/$1 [L,P] ProxyVia on </VirtualHost>
In a production environment, I also suggest adding "/_" "/VirtualHostBase/" and "/VirtualHostRoot/" to your set of regular expressions which dictate what should not be allowed to be sent to Zope via the request URI. See the mailing list archives for more on why. See the apache mod_rewrite docs for how to implement it.
Thanks a lot for your answer, but when i added: # next 2 lines added to omit http://www.is.lg.ua:5000/chat from Zope's influence RewriteCond %{REQUEST_URI} ^/chat RewriteRule .* - [L] ScriptAlias /chat /cgi-bin I get: Not Found The requested URL /chat was not found on this server. Can you tell me about this something? and could you describe more precisely using '/_' in production? (where to insert that?) Thanks a lot for your help. Ruslan
Ruslan Spivak wrote:
ScriptAlias /chat /cgi-bin
Did you read the documentation?
Not Found
Thats probably because $ ls /cgibin ls: /cgibin: No such file or directory
Can you tell me about this something? and could you describe more precisely using '/_' in production? (where to insert that?)
read the list archives, search for my name -- Jamie Heilman http://audible.transient.net/~jamie/ "You came all this way, without saying squat, and now you're trying to tell me a '56 Chevy can beat a '47 Buick in a dead quarter mile? I liked you better when you weren't saying squat kid." -Buddy
In root of zope i have /is folder. All this works, but in apache /cgi-bin directory i have irc.cgi script and i need to call www.is.lg.ua:5000/chat so that www.is.lg.ua:5000/cgi-bin/irc.cgi will be called.
try something like: <VirtualHost *> ServerName foo.bar RewriteEngine On RewriteRule ^/cgi-bin - [l] RewriteRule ^/(.*) http://localhost:8080/VirtualHostBase/http/foo.bar/plone/VirtualHostRoot/$1 [L,P] ErrorLog /var/log/foo.bar-error.log TransferLog /var/log/foo.bar-access.log ProxyVia on </VirtualHost>
participants (3)
-
Jamie Heilman -
PieterB -
Ruslan Spivak