Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm looking for a simple way to serve my pylons application in both HTTP & HTTPS (for the administration section). I had come across some tutorials on serving pylons applications through an Apache web-server but I don't need that kind of overhead for something so simple. This got me thinking, is it possible to do it with one of the lighter web-servers out there lighttpd?

I don't know much about either outside of pylons so any help would be appreciated. I already have a server certificate (self-signed) that I use for my pylons <-> postgresql connection.

Thanks.

Edit: Seemingly I cannot create a new tag "pylons" so I will add it when I am able.

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I had never heard of Pylons, so I Googled it with Apache and came across the Pylons wiki page for Pylons+SSL+Apache... One of these howtos might be what you're looking for.

share|improve this answer
    
Thanks, the second link about serving a pylons web-application through lighttpd will be useful. Now it should be as simple as figuring out how to direct non-SSL requests to an arbitrary administration URL like "/admin/*" to it's SSL equivalent. I've seen in a discussion somewhere about using lighttpd to modify the request headers before it reaches my pylons web-application to set a flag saying this request was using SSL, but I am clueless as to how to accomplish that. Thanks though. –  user6623 Jun 1 '09 at 6:43

If you don't need to distinguish between a HTTP and HTTPS connection in Pylons, you can quite easily do this with stunnel. The sample stunnel.conf file that is distributed with all versions of stunel already contains commented configuration to do this.

share|improve this answer
    
I've checked out Stunnel and while it is very useful I really need a way to require that people connecting to /admin/* be using a secure socket layer. Thanks. –  user6623 Jun 1 '09 at 6:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.