# Secure logins + lighttpd

**URL:** <https://www.ruby-forum.com/t/secure-logins-lighttpd/47550>\
**Category:** Rails\
**Created:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550 "2005-11-12T12:49:24Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/1 "2005-11-12T12:49:24Z")

</div>

Hello all,

Searched the 'net and list to no avail, hoping someone can help me. It  
seems like this should be a HowTo, so maybe we can get this together  
here  
and I’ll write it up for the good of the people.

I’d like to provide secure logins for my users because clear text  
passwords make the baby Jesus cry (as a friend of mine says). But, I  
want  
to provide everything else via standard http, all via lighttpd.

My machine is dinky and so I want to run just two dispatch.fcgi  
processes  
and one instance of lighttpd that handles both the ssl and clear traffic  
lest I grind the disks to a horrible swap death.

Is this even possible, or must I run a separate lighttpd process for  
providing logins via ssl? Any help is greatly appreciated, particularly  
working config files :).

Thanks,

pt.

---

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/2 "2005-11-12T12:49:25Z")

</div>

Here’s my SSL config for the app:

$SERVER[“socket”] = “127.0.0.1:443” {  
ssl.engine = “enable”  
ssl.pemfile = “/home/pergesu/ssl/example.pem”  
server.name = “[example.com](http://example.com)”  
server.document-root = “/home/pergesu/app/public/”  
}

Also check the lighttpd site for a bit more info, as well as how to  
generate self signed certificates [1].

I’m not sure if this is the totally appropriate way of doing things,  
but it seems to be working perfectly fine for me.

Pat

[1] [http://www.lighttpd.net/documentation/ssl.html](http://www.lighttpd.net/documentation/ssl.html)

---

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/3 "2005-11-12T12:49:25Z")

</div>

That should be

$SERVER[“socket”] == “127.0.0.1:443” {

I had to type it, because I can’t figure out how to select and copy  
with cygwin. I hate windows.

Pat

---

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/4 "2005-11-12T12:49:32Z")

</div>

Pat,

What I’d like to do is define in the came conf file two virtual host  
entries, one for my http site, one for https (logins, registration,  
etc),  
that share dispatch.fcgi processes.

It looks like I would define listeners on 443/80 like so:

---

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 12:49pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/5 "2005-11-12T12:49:34Z")

</div>

I think you can just do this:

---

<div class="post-metadata">

**Author:** ![parker](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/c6cbf5/32.png) [@parker](https://www.ruby-forum.com/u/parker)\
**Post date:** [November 12, 2005, 8:42pm UTC](https://www.ruby-forum.com/t/secure-logins-lighttpd/47550/6 "2005-11-12T20:42:28Z")

</div>

Pat M. wrote:

> I had to type it, because I can’t figure out how to select and copy  
> with cygwin. I hate windows.

For the ordinary (non-X) cygwin bash window, use the drop-down menu on  
the top left icon in the title bar, select Edit, then select Mark.  
Drag to select and highlight text (title bar shows “Select” while in  
this mode). Drag again to reselect if need be. Double-click and  
shift-selection work as you would expect.  
Then choose Edit\>Copy from the same menu, or just press Enter.

In terms of keyboard shortcuts:

Alt-space e k Enter

(This is the same as for a Windows command window).

If you have Cygwin with X, just dragging and highlighting text seems to  
immediately place it on the Windows clipboard.

regards

```
Justin
```
