[Zope3-Users] virtual hosting

2006-10-11 Thread Hector Miuler Malpica Gallegos




Hello friends, as I can have virtual hosting of easy form? like in zope2 




-- 
Hector Miuler Malpica Gallegos [EMAIL PROTECTED]







signature.asc
Description: Esta parte del mensaje está firmada	digitalmente
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] virtual hosting

2006-10-11 Thread Darryl Cousins
On Wed, 2006-10-11 at 04:57 -0500, Hector Miuler Malpica Gallegos wrote:
 Hello friends, as I can have virtual hosting of easy form? like in
 zope2 
 
 -- 
 Hector Miuler Malpica Gallegos [EMAIL PROTECTED]


Sure.

VirtualHost *
 ServerName zope3.theshire
 RewriteRule ^(/?.*) http://localhost:8031/++vh++http:zope3.theshire:80/++$1 
[P,L]
/VirtualHost


Hope that helps.
Darryl

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] virtual hosting

2006-10-11 Thread Hector Miuler Malpica Gallegos
I do not have apache, I have zope3: ( 

seemed to /virtual_hosting of zope2 :
01domainzope3.com  /miuler/01
02domainzope3.com  /miuler/02


El mié, 11-10-2006 a las 22:05 +1300, Darryl Cousins escribió: 
 On Wed, 2006-10-11 at 04:57 -0500, Hector Miuler Malpica Gallegos wrote:
  Hello friends, as I can have virtual hosting of easy form? like in
  zope2 
  
  -- 
  Hector Miuler Malpica Gallegos [EMAIL PROTECTED]
 
 
 Sure.
 
 VirtualHost *
  ServerName zope3.theshire
  RewriteRule ^(/?.*) http://localhost:8031/++vh++http:zope3.theshire:80/++$1 
 [P,L]
 /VirtualHost
 
 
 Hope that helps.
 Darryl
 


signature.asc
Description: Esta parte del mensaje está firmada	digitalmente
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


[Zope3-Users] Virtual hosting problem

2006-08-30 Thread Lorenzo Gil Sanchez
Hi,

I know Zope3 has great support for virtual hosting and you can easily
set it up using the Rewrite module of Apache as described here:

http://www.zope.org/Wikis/DevSite/Projects/ComponentArchitecture/Zope3Book/virtualhosting.html

My problem is that my hosting provider does not allow me to create
custom rewrite rules so I need to do the same in Zope3 side.

Basically I want to change all request with the form
http://www.mysite.com/$1 to http://localhost:8080/site_folder/++vh
++http:www.mysite.com:80/++$1

I guess I need to slightly change Zope publishing mechanism and I saw
IVirtualHostRoot in zope.publisher.interfaces.http. Probably calling
setVirtualHostRoot when the traversal is at 'site_folder' is what I need
but I have no clue about where should I do that.

Any help?

Thanks in advance

Lorenzo

___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users


Re: [Zope3-Users] Virtual hosting problem

2006-08-30 Thread Martijn Pieters

On 8/30/06, Lorenzo Gil Sanchez [EMAIL PROTECTED] wrote:

I guess I need to slightly change Zope publishing mechanism and I saw
IVirtualHostRoot in zope.publisher.interfaces.http. Probably calling
setVirtualHostRoot when the traversal is at 'site_folder' is what I need
but I have no clue about where should I do that.


You could register an event listener for
zope.app.publication.interfaces.IBeforeTraverseEvent, and manipulate
the request if event.object implements
zope.app.folder.interfaces.IRootFolder. You'll need a hack to find the
request though; you can get it from the security interaction:

from zope.publisher.interfaces.http import IHTTPRequest
from zope.security.management import getInteraction

def _getHTTPRequest():
   Attempt to get the current request, if it exists
   interaction = getInteraction()
   if not interaction.participations:
   return
   for participant in interaction.participations:
   if IHTTPRequest.providedBy(participant):
   return participant

That way you can detect the start of a request (before traverse event
on the root folder), grab the request, and manipulate it to suit your
virtual host needs.

--
Martijn Pieters
___
Zope3-users mailing list
Zope3-users@zope.org
http://mail.zope.org/mailman/listinfo/zope3-users