Linode Forum
Linode Community Forums
 FAQFAQ    SearchSearch    MembersMembers      Register Register 
 LoginLogin [ Anonymous ] 
Post new topic  Reply to topic
Author Message
PostPosted: Wed Aug 01, 2007 3:47 pm 
Offline
Senior Member

Joined: Wed May 16, 2007 12:46 am
Posts: 71
Hi,

I'm a bit out of my league here so I was wondering how I might go about this.. First, my goal: run 2 instances of lighttpd - one SSL and the other non-SSL.

I got instructions here:

http://wiki.archlinux.org/index.php/Lig ... ghttpd_SSL

Only problem is that the instructions don't seem to work with Debian. Specifically:

Quote:
Step 2: Copy things

Now we need to setup a seperate config script, and init script for the ssl version.

[[root@computer]]$ cp /usr/sbin/lighttpd /usr/sbin/lighttpd-ssl
[[root@computer]]$ cp /etc/rc.d/lighttpd /etc/rc.d/lighttpd-ssl
[[root@computer]]$ cp /etc/conf.d/lighttpd /etc/conf.d/lighttpd-ssl
[[root@computer]]$ cp /etc/lighttpd/lighttpd.conf /etc/lighttpd/lighttpd-ssl.conf


rc.d and conf.d don't exist on my Debian system. Only rc.local, rc0.d, rc1.d, etc.. Is there a way to copy & manage all the K20lighttpd's in each of these directories or am I going to have to manually copy & edit every single one of them?


Top
   
 Post subject:
PostPosted: Wed Aug 01, 2007 6:33 pm 
Offline
Senior Member

Joined: Wed Aug 13, 2003 10:24 am
Posts: 55
On Debian, startup scripts go into /etc/init.d. You can use update-rc.d to set up the symbolic links from /etc/rcN.d, e.g.

# update-rc.d lighttpd-ssl defaults

If you installed lighttpd using apt-get, there will already be one startup script installed. That script references a .conf file in /etc/lighttpd.

Roy


Top
   
 Post subject:
PostPosted: Wed Aug 01, 2007 10:31 pm 
Offline
Senior Newbie

Joined: Fri Feb 03, 2006 2:20 am
Posts: 17
You don't need to run 2 instances of lighttpd for non-ssl/ssl. Setting up some checks on $SERVER["socket"] you can have one process do non-ssl and ssl.


Top
   
PostPosted: Fri Aug 03, 2007 9:21 am 
Offline
Senior Newbie

Joined: Thu Jul 19, 2007 6:48 am
Posts: 8
Website: http://miru.hk
Location: Hong Kong
A32 wrote:
I got instructions here:

http://wiki.archlinux.org/index.php/Lig ... ghttpd_SSL

Only problem is that the instructions don't seem to work with Debian.

Well look for notes on distro's resource site first, then look at the software's project page. The latter has all the details needed in this case:

http://trac.lighttpd.net/trac/wiki/Docs%3ASSL

Debian's wiki is unfortunately one of the poorest, they only have a generic section on web servers:

http://wiki.debian.org/WebServers

Which points to a Debian LUG site in the UK with very minimal details:

http://www.debianhelp.co.uk/lighttpd.htm

Note that Ubuntu doesn't do much better either, it borrows from Gentoo's wiki:

https://wiki.ubuntu.com/Lighttpd+PHP


Top
   
 Post subject:
PostPosted: Sat Aug 04, 2007 7:28 pm 
Offline
Senior Member

Joined: Wed May 16, 2007 12:46 am
Posts: 71
Thanks guys.. I think I should be able to run 2 servers now.

The reason I have to run 2 separate servers is because I need to serve a secure subdomain on a non secure domain.

Quote:
$SERVER["socket"] == "10.0.0.1:443" {
ssl.engine = "enable"
ssl.pemfile = "www.example.org.pem"
ssl.ca-file = "/etc/CA.crt"

server.name = "www.example.org"

server.document-root = "/www/servers/www.example.org/pages/"
}


I am thick headed so I tried anyways. It didn't work because I host example.org, www.example.org AND secure.example.org .. secure.example.org is the only SSL one.

With both, socket & host declared, it just defaults to the example.org's document root.


Top
   
 Post subject:
PostPosted: Mon Aug 06, 2007 9:27 am 
Offline
Senior Newbie

Joined: Thu Jul 19, 2007 6:48 am
Posts: 8
Website: http://miru.hk
Location: Hong Kong
A32 wrote:
I need to serve a secure subdomain on a non secure domain.

Try this:
Code:
$HTTP["host"] == "chocco.org" {
        url.redirect = ( "^/.*" => "http://www.chocco.org/" )
}
$HTTP["host"] == "www.chocco.org" {
        server.document-root = "/srv/www.chocco.org"
}
$HTTP["host"] == "secure.chocco.org" {
        url.redirect = ( "^/.*" => "https://secure.chocco.org/" )
}
$SERVER["socket"] == "10.0.0.1:443" {
        ssl.engine = "enable"
        ssl.ca-file = "/etc/ssl/certs/ca-certs.crt"
        ssl.pemfile = "/etc/ssl/certs/ssl.pem"

       $HTTP["host"] == "secure.chocco.org" {
               server.document-root = "/srv/secure.chocco.org"
       }
}


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
RSS

Powered by phpBB® Forum Software © phpBB Group