Google Mail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Simple production question
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  13 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
morellik  
View profile   Translate to Translated (View Original)
 More options 27 Oct, 15:37
From: morellik <enrico.more...@gmail.com>
Date: Tue, 27 Oct 2009 08:37:07 -0700 (PDT)
Local: Tues 27 Oct 2009 15:37
Subject: Simple production question
Dear all,

I'm a newbie and I started to write an application in Pylons.
When in the future the application will be used in a production
environment, can I use only paster to serve the application? In that
case, which are the steps to do that?

I'm sorry for the stupid question, but in my searches, I founded only
explanations for the use with apache, mod_wsgi, mod_python.

What is the better solution?

Thanks in advance
Enrico


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile   Translate to Translated (View Original)
 More options 27 Oct, 19:47
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Tue, 27 Oct 2009 12:47:41 -0700 (PDT)
Local: Tues 27 Oct 2009 19:47
Subject: Re: Simple production question
many people serve moderately trafficked sites through paster, myself
included.

the two things you'd need to do are:

1- Make a shell script to handle startup / shutdown
2- install something like nginx on port 80 , and have that handle the
static files or file directories ( js / css /images / etc ); then just
proxy everything else to paster

my ubuntu shell:

cd $$$PATH_NAME$$$/
case "$1" in
  start)
    paster serve \
        --daemon \
        --pid-file=$$$PATH_NAME$$$/log/production.pid \
        --log-file=$$$PATH_NAME$$$/log/production.log \
                   $$$PATH_NAME$$$/production.ini \
        start
    ;;
  stop)
    paster serve \
        --daemon \
        --pid-file=$$$PATH_NAME$$$/log/production.pid \
        --log-file=$$$PATH_NAME$$$/log/production.log \
                   $$$PATH_NAME$$$/production.ini \
        stop
    ;;
  restart)
    paster serve \
        --daemon \
        --pid-file=$$$PATH_NAME$$$/log/production.pid \
        --log-file=$$$PATH_NAME$$$/log/production.log \
                   $$$PATH_NAME$$$/production.ini \
        restart
    ;;
  *)
    echo $"Usage: $0 {start|stop|restart}"
    exit 1
esac


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile   Translate to Translated (View Original)
 More options 27 Oct, 19:58
From: Mike Orr <sluggos...@gmail.com>
Date: Tue, 27 Oct 2009 12:58:47 -0700
Local: Tues 27 Oct 2009 19:58
Subject: Re: Simple production question
On Tue, Oct 27, 2009 at 12:47 PM, Jonathan Vanasco

<jonat...@findmeon.com> wrote:

> many people serve moderately trafficked sites through paster, myself
> included.

> the two things you'd need to do are:

> 1- Make a shell script to handle startup / shutdown
> 2- install something like nginx on port 80 , and have that handle the
> static files or file directories ( js / css /images / etc ); then just
> proxy everything else to paster

He was asking about using Paster alone without a webserver.  Yes, you
can do this.  There are three reasons most people use Apache or Nginx:

1. To use its features: SSL, virtual hosts, rewriting, authentication,
fast static files, caching, etc.
2. Apache is very widely used and has a long track record, so many
people feel safer about letting it handle SSL.
3. Apache can clean up misformatted requests from substandard user
agents, which might inconvenience or crash the Paster routine.

I use Paster with ProxyPass, and run it under Supervisor rather than
using a startup script.

--
Mike Orr <sluggos...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wyatt Baldwin  
View profile   Translate to Translated (View Original)
 More options 27 Oct, 21:26
From: Wyatt Baldwin <wyatt.lee.bald...@gmail.com>
Date: Tue, 27 Oct 2009 14:26:17 -0700 (PDT)
Local: Tues 27 Oct 2009 21:26
Subject: Re: Simple production question
On Oct 27, 12:58 pm, Mike Orr <sluggos...@gmail.com> wrote:

> [...]

> I use Paster with ProxyPass, and run it under Supervisor rather than
> using a startup script.

+1

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile   Translate to Translated (View Original)
 More options 28 Oct, 17:36
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Wed, 28 Oct 2009 10:36:20 -0700 (PDT)
Local: Wed 28 Oct 2009 17:36
Subject: Re: Simple production question

On Oct 27, 3:58 pm, Mike Orr <sluggos...@gmail.com> wrote:

> I use Paster with ProxyPass, and run it under Supervisor rather than
> using a startup script.

that too!  i need to learn how to do that. i had a hellish experience
trying to get monit to work correctly for this; supervisor is likely
to be more portable and simpler.

> He was asking about using Paster alone without a webserver.  Yes, you
> can do this.  There are three reasons most people use Apache or Nginx:

my interpretation was that he didn't want to config apache or similar
to handle the application, and serve from paster -- which is what i
suggested.

perhaps i should have been more clear and said this:

   You can serve from paster alone, but it may not be a good idea to
do that.
   Paster can definitely handle the traffic for all of your dynamic
content on most sites quite easily; but each dynamic page usually has
a significant amount of static content - serving that static content
off Paster will slow everything down. You'll also run into issue with
'slow clients' or 'dropped connections' that tie up processes/threads/
etc -- which is really universal to all web applications no matter the
framework or language.  For that reason many people like to run some
sort of webserver on Port 80 in front of their dynamic server(s) ;
this server is usually responsible for serving static content and
proxying the request for dynamic content to a Paster / Apache / FCGI /
etc  server operating on a different port or even a different
machine.  The benefits of this setup are that the dynamic server
receives a completed request and can quickly process it and return it
to the proxy server on port 80, freeing up memory/cpu resources
quickly.  The proxy essentially only serves static content, and is
usually highly optimized code that can handle thousands of
simultaneous connections ( ie: nginx, lighttpd, etc ).


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Andre Stechert  
View profile   Translate to Translated (View Original)
 More options 28 Oct, 17:51
From: Andre Stechert <stech...@gmail.com>
Date: Wed, 28 Oct 2009 10:51:29 -0700
Local: Wed 28 Oct 2009 17:51
Subject: Re: Simple production question
I'd add the following 2 reasons:

1. mod_security or its equivalent (sub-bullet of Mike's #1 but I think
it's important to call out)
2. if you light up paster with a load balancer on a quad core machine
(at least, if you did it two years ago like we did), only one CPU will
reach 100% utilization.  we were set up to proxy to four paster
instances per box, using apache as a front end.  worked like a dream.

cheers,
andre


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
morellik  
View profile   Translate to Translated (View Original)
 More options 30 Oct, 11:54
From: morellik <enrico.more...@gmail.com>
Date: Fri, 30 Oct 2009 04:54:07 -0700 (PDT)
Local: Fri 30 Oct 2009 11:54
Subject: Re: Simple production question
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.

Thanks again


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wyatt Baldwin  
View profile   Translate to Translated (View Original)
 More options 30 Oct, 15:45
From: Wyatt Baldwin <wyatt.lee.bald...@gmail.com>
Date: Fri, 30 Oct 2009 08:45:23 -0700 (PDT)
Local: Fri 30 Oct 2009 15:45
Subject: Re: Simple production question
On Oct 30, 4:54 am, morellik <enrico.more...@gmail.com> wrote:

I was going to say that I don't think that's possible, but perhaps you
can add 'Listen 5001' to your Apache config and set up a virtualhost
using that port (don't know; never tried it). Of course, if that did
work, you'd have to run your Paste server on a different port.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile   Translate to Translated (View Original)
 More options 30 Oct, 17:16
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Fri, 30 Oct 2009 10:16:11 -0700 (PDT)
Local: Fri 30 Oct 2009 17:16
Subject: Re: Simple production question

> On Oct 30, 4:54 am, morellik <enrico.more...@gmail.com> wrote:
> > 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 forhttps://www.cerm.unifi.it:5001orhttp://www.cerm.unifi.it:5001hasto be redirect to my pylons
> > application. I cannot understand how do that. Because from the example
> > seems that all request towww.pylonsbook.comareredirect 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.

Most people wouldn't do that.  It's an odd setup.

Typically people do this :
- Front-End server on port 80
- All "upper level" ports locked down to localhost only
- Front-end server proxies certain traffic on port 80 -- based on
virtual host settings, location match, etc , to Paster or other
application running on port 5000, 8080, etc

to get your behavior - which is odd - you can do two things :

- run paster on port 5001 , and open up that port on iptables or
whatever ; paster will respond to those requests and there's no need
to run them through apache.  apache will only bind to the ports you
request, which by default is 80.  unless you tell it to listen to
5001, it's not going to -- and paster can run on that and handle
traffic directly.

- in apache put:
-- Listen 5001
-- <VirtualHost domainname.it:5001> proxy to pylons on 8080 </
VirtualHost>

personally, I'd keep all the external traffic on port 80.  it's
simpler , cleaner urls, and you won't have do deal with the potential
of firewalls of your consumers's employers/isps blocking the higher
ports.  i'd just set up a virtual host, and proxy everything but
static content or specific directories to the paster server on the
higher port.


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Mike Orr  
View profile   Translate to Translated (View Original)
 More options 30 Oct, 18:24
From: Mike Orr <sluggos...@gmail.com>
Date: Fri, 30 Oct 2009 11:24:39 -0700
Local: Fri 30 Oct 2009 18:24
Subject: Re: Simple production question

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 <sluggos...@gmail.com>


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
morellik  
View profile   Translate to Translated (View Original)
 More options 2 Nov, 09:44
From: morellik <enrico.more...@gmail.com>
Date: Mon, 2 Nov 2009 01:44:33 -0800 (PST)
Local: Mon 2 Nov 2009 09:44
Subject: Re: Simple production question
Thanks to all for yours replies.

> 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).

Excuse me for my bad English. I dont' explain well the problem. The
Pylons applications is running on port 5001. But there aren't problems
to change the port to another (over 8000).

I wrote a lot of CherryPy applications where I set the port, start its
server and that's all.

Using Pylons, seems to be better use a web server (like Apache) to
serve the application instead using Paster directly.
Now, I have an Apache web server that serve the main  web site of our
center and other virtual sites. So, I haven't a domain to bind to
Pylon application but only a port.
My question is:  is there a way to configure Apache to proxy calls to
the specific port where Paster is running?

Enrico


    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jonathan Vanasco  
View profile   Translate to Translated (View Original)
 More options 2 Nov, 14:58
From: Jonathan Vanasco <jonat...@findmeon.com>
Date: Mon, 2 Nov 2009 06:58:15 -0800 (PST)
Local: Mon 2 Nov 2009 14:58
Subject: Re: Simple production question

On Nov 2, 4:44 am, morellik <enrico.more...@gmail.com> wrote:

> My question is:  is there a way to configure Apache to proxy calls to
> the specific port where Paster is running?

See mike's post above.

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
morellik  
View profile   Translate to Translated (View Original)
 More options 3 Nov, 09:15
From: morellik <enrico.more...@gmail.com>
Date: Tue, 3 Nov 2009 01:15:15 -0800 (PST)
Local: Tues 3 Nov 2009 09:15
Subject: Re: Simple production question

On Nov 2, 3:58 pm, Jonathan Vanasco <jonat...@findmeon.com> wrote:

> On Nov 2, 4:44 am, morellik <enrico.more...@gmail.com> wrote:

> > My question is:  is there a way to configure Apache to proxy calls to
> > the specific port where Paster is running?

> See mike's post above.

Ok. I'll try. Thanks to all :-))

    Reply    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google