On Fri, Oct 30, 2009 at 4:54 AM, morellik <[email protected]> wrote:
>
> Thanks to all for your suggestions and comments.
> So, I'll use Apache to proxy requests to pylons.
>
> At this point I have another question. I'm reading the Pylons Book and
> in the chapter that explain it, there is an apache configuration
> example:
>
> <VirtualHost *>
> ServerName www.pylonsbook.com
> ServerAlias pylonsbook.com
>
> # Logfiles
> ErrorLog /home/simplesite/log/error.log
> CustomLog /home/simplesite/log/access.log combined
>
> # Proxy
> ProxyPass / http://localhost:8080/ retry=5
> ProxyPassReverse / http://localhost:8080/
> ProxyPreserveHost On
> <Proxy *>
> Order deny,allow
> Allow from all
> </Proxy>
> </VirtualHost>
>
> Now, the apache web server that I'll use, serve a principal domain
> (www.cerm.unifi.it) and other virtual host based on its names.
> I would that all coming requests for https://www.cerm.unifi.it:5001 or
> http://www.cerm.unifi.it:5001 has to be redirect to my pylons
> application. I cannot understand how do that. Because from the example
> seems that all request to www.pylonsbook.com are redirect to the port
> 8080 where the paster is listen. Instead I want the only the requests
> to the 5001 port of the base site are to be redirected.
If I understand correctly, your Pylons application is running on port
8080, and you want Apache to proxy port 5001 to it but not port 80
(i.e., port 80 will be used for a different website).
In this case you'd need two VirtualHost stanzas. You would also need
"Listen" lines for all IPs/ports you want Apache to listen to. E.g.,
===
Listen *:80
Listen *:5001
<VirtualHost *:80>
DocumentRoot /var/www
</VirtualHost>
<VirtualHost *:5001>
DocumentRoot /home/wwwadmin/myapp/myapp/public
ProxyPass /images !
ProxyPass /javascripts !
ProxyPass /stylesheets !
ProxyPass /robots.txt !
ProxyPass /favicon.ico !
ProxyPass / http://localhost:8080/
ProxyPassReverse / http://locahost:8080/
</VirtualHost>
===
If you want to publish the Pylons site on *both* ports 80 and 5001
(though why would you want to?), you'd have two VirtualHost stanzas
with identical directives inside them.
In any case, your Pylons application should listen only on localhost,
so it gets requests only from Apache or from a console webbrowser, not
from the Internet.
If you want to be tricky, you can run the Pylons app on
"localhost:8080" and have Apache listen on "my-public-ip:8080", but
that will probably be confusing. What you *can't* do is have two
processes listen on the same IP:port combination simultaneously.
--
Mike Orr <[email protected]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"pylons-discuss" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/pylons-discuss?hl=en
-~----------~----~----~----~------~----~------~--~---