1

I know this has been covered before and I've spent hours on this site and others trying to be sure I am doing everything correctly, but the bottom line is the rewrite isn't working - I keep on seeing the Apache default page and not the Zope page, and I am not getting any errors (I have trace5 on)

Here's the background: I finally had to move an ancient instance of Zope (2.4.4 w/Python 2.1) off an ancient server-the last move was in 2005! I actually managed to get Zope running on a 32 bit 16.04 VM using Azure's new nested Hyper-V - but that's another story :)

I basically copied everything over from the old server to the new one (including Python 2.1, Zope 2.4.4 and the Zope instance) to get this working, along with the Apache configuration files. The only thing new besides Ubuntu 16.04 (I had dapper on the old machine - no evil comments please :)) was Apache.

I've checked that I have rewrite, proxy and proxy_http mods enabled. In the proxy.conf I have proxyposts on and allowed from localhost. In the enabled-sites conf file for the document root / and /var/www/html I AllowOverride All and Require all granted

The condition I use is this:

RewriteEngine On RewriteRule ^/(.*) http://127.0.0.1:8083/VirtualHostBase/http/%{SERVER_NAME}:80/websites/jhom/VirtualHostRoot/$1 [L,P]

As note above, when I enter the site URL defined in the server name, I get the default Apache page without a rewrite. When I enter the URL defined in the rewrite into my browser (substituting the server name for localhost) I do get the site! So my assumption is there is something I am missing in the rewrite rule (I tried alternatives with that as well btw) or in getting rewrites to work at all.

If anyone has any good ideas I would greatly appreciate the help!

17
  • You didn't mention it, but how is your Virtual Host Monster set up within Zope?
    – Feneric
    Aug 9, 2017 at 18:59
  • There is a VHM at the top level. When I click on the VHM I don't see a mappings tab so I have no clue how to or if I can change the settings. I assume this is because it's an ancient Zope version
    – Aron T
    Aug 14, 2017 at 19:35
  • You don't really need to change anything with it, but it needs to be present at the top level for rewrite rules like the one you're describing to work. Your syntax looks generally reasonable although I'd probably use ^/(.*)$ to force match the whole thing. I personally usually use Apache's ProxyPassMatch & ProxyPassReverse syntax, but rewrite rules with the P flag (like you've got) ought to work, too. Look for path mismatches & the like.
    – Feneric
    Aug 19, 2017 at 19:38
  • I've tried ProxyPass as well. No go. I actually have two Zope instances, and neither work with Apache and the VHM. One instance is Zope 2.8.x and the VHM has the mappings tab there - so I can connect by doing http://name.of.site:8082 w/o Apache.The Zope 2.4.4 seems hopeless although I can use view to see a page. That's good enough since the point of bringing these sites up is more to easily extract content for modernizing the sites.
    – Aron T
    Aug 21, 2017 at 20:27
  • Where are your virtual hosts within the ZODB? You may have a path mismatch somewhere. I've got access to something very similar to this that works, so I'm guessing that there's something just a little off somewhere.
    – Feneric
    Aug 22, 2017 at 19:29

0

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.