Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 08 Jun 2001 10:03:04 -0500
From:      Tony Wells <awells@journalstar.com>
To:        Odhiambo Washington <wash@wananchi.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: Different document roots for secure HTTP and HTTP
Message-ID:  <3B20E928.55F69232@journalstar.com>
References:  <200106070516.f575Fxh08890@xyzzy.intranet.snsonline.net> <Pine.BSF.4.32.0106070840510.44838-100000@www.stelesys.com> <20010607210538.A6275@gecadsoftware.com> <20010608122237.K98797@everest.wananchi.com>

next in thread | previous in thread | raw e-mail | index | archive | help

To run two servers, one for SSL and one for regular connections:

%> httpd -f /path/to/httpd.conf
%> httpsd -f /path/to/httpsd.conf

You setup your config files so that httpd.conf listens on port 80 and
httpsd.conf listens on port 443.  There are some advantages to this
setup.  Most sites have the majority of connections coming across port
80, so you can have those connections served by a daemon that doesn't
have the additional bloat of mod_ssl included.  You can also keep fewer
httpsd processes lingering around if you don't really need many.

As far as starting the daemons at boot-time, if you compile the two
daemons with a different --prefix=, say:

./configure --prefix=/usr/local/apache 
./configure --prefix=/usr/local/apache+ssl

For the regular and secure server respectively.  You can rename the ssl
server httpsd (helps when you ps) and have a shell script in
/usr/local/etc/rc.d:  

#!/bin/sh
/usr/local/apache/bin/apachectl start
/usr/local/apache+ssl/bin/apachectl start

(You'll have to monkey with the apachectl script for the secure server a
little bit if you rename the secure version of Apache to httpsd, but I
find it more convienent when running two Apache binaries to have the
secure version show up with a different name during a 'ps')

Ouila!  Two binaries, many children, and the ability to start and stop
just the secure or standard web services.

Odhiambo Washington wrote:
> 
> * teo@gecadsoftware.com <teo@gecadsoftware.com> [20010607 21:06]: writing on the subject 'Re: Different document roots for secure HTTP and HTTP'
> teo> Hi Jim!
> teo> On Thu, 07 Jun 2001, Jim Freeze wrote:
> teo>
> teo> > > On Thu, 07 Jun 2001 15:06:47 +1000, BSD Freak said:
> teo> > >
> teo> > > :: Hi all
> teo> > > ::
> teo> > > ::  Does anyone know if it possible to run Apache with different ports for
> teo> > > ::  secure HTTP and ordinary HTTP. For example I want to run my web server
> teo> > > ::  as follows:
> teo> > > ::
> teo> > > ::  port 443 (HTTPS) directed to document root /var/www-secure
> teo> > > ::  port 80 (HTTP) directed to document root /var/www
> teo> >
> teo> > I don't think this can be done through the config file directly.
> teo> > You probably will have to resort to mod_rewrite.
> teo> > With rewrite you can essentially map any url to any other url.
> teo> >
> teo> yes, it is possible.
> teo>
> teo> for 443 (secure) you have a default virtual host, see the added config
> teo> stuff done by mod_ssl. You can configure a different documentRoot.
> teo> same goes with 80 (http), which defaults to your documentRoot setting.
> teo>
> teo>
> teo> give some more detail of what you want to achive.
> 
> How does one start/run TWO binaries of the same app like apache? I am
> interested in knowing HOWTO do that, especially stsrting them from rc.d/
> 
> TIA
> 
> -Wash
> 
> --
> Odhiambo Washington
> Wananchi Online Ltd.,
> wash@wananchi.com 1st Flr Loita Hse.
> Tel: 254 2 313985 Loita Street.,
> Fax: 254 2 313922 PO Box 10286,00100-NAIROBI,KE.
> 
> Earth is a beta site.
> 
>   ------------------------------------------------------------------------
>    Part 1.2Type: application/pgp-signature

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3B20E928.55F69232>