You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Tom Evans <te...@googlemail.com> on 2010/02/25 15:56:29 UTC

Re: [users@httpd] Re: Can I have 2 httpd servers running on 2 different ports?

On Thu, Feb 25, 2010 at 2:00 PM, LuKreme <kr...@kreme.com> wrote:
> On 24-Feb-10 10:49, Sheryl wrote:
>>
>> Instead, just have a different directory for each instance.  For instance
>>
>> /usr/local/apache -- where you install your software
>>
>> /opt/server1 -- first server
>>     bin, build, error, icons, include, lib, man, manual, modules,
>> mime-types, magic are links to equivalent in /usr/local/apache
>>     cgi-bin, conf, htdocs, logs are directories; conf should be a copy of
>> /usr/local/apache/conf
>
> What benefit does this give you over running VirtualHost?
>

(I wouldn't set up a second instance like suggested, but..)

1) You can load different modules in different instances
2) Separation of concerns
3) Different global configuration options
4) Different compile time options

For instance, on our reverse proxies, we run two instances of apache,
one handles SSL and runs prefork MPM, and one handles regular HTTP and
runs the event MPM.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Can I have 2 httpd servers running on 2 different ports?

Posted by Sheryl <gu...@his.com>.
> When a developers needs an apache instance to play with, they would
> typically just do something like this:
> '/usr/local/sbin/httpd -f /home/foo/proj/conf/httpd.conf'. The only
> things they need in conf are the httpd.conf, mime.types and magic.
> Typically, they'll declare a server root in the conf file, with a logs
> folder below server root. That's pretty muc hall that is needed.

Developer playgrounds are something else, and they run them as they please
on their workstations.  I was describing what we do for shared servers
with dev/qa/production workflow stacks.  Per security policy, nobody is
allowed to run a site out of their home directory (or even have a login on
QA or production), and we don't have any of the stack software in
/usr/local even on sites which haven't been merged into an
/opt/site/sitename stack so they can easily be copied from machine to
machine.

As with anything else, YMMV with your environment.  I probably would
consider your setup a little crazy with the kind of superficial exposure
we get here, starting with running httpd out of /usr/local (assuming
you'll ever want to compile a second version for any reason).

> However, we don't do this so much anymore. Now typically, we will
> configure a separate freebsd jail for each service.

I'd like to be doing something like that, or VMs, but unfortunately those
methods have not been so easy to get approved.

Sheryl


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Can I have 2 httpd servers running on 2 different ports?

Posted by Tom Evans <te...@googlemail.com>.
On Thu, Feb 25, 2010 at 7:00 PM, Sheryl <gu...@his.com> wrote:
>
>>> What benefit does this give you over running VirtualHost?
>>>
>>
>> (I wouldn't set up a second instance like suggested, but..)
>
> Curious about why not...
>
> BTW, my example was a little simplified.  In practice we actually make a
> link "base" which points to the apache directory and the link bin to
> base/bin, etc.  That way, when we compile a new version we put it in its
> own directory and change the link.  Easy to upgrade, easy to back off if
> it doesn't work.
>

Because it isn't needed. If you don't need to change compile time
options, all apache needs to run is a different config file, not a
replication of the /usr/local/ hierarchy.

In fact, we use freebsd, and install apache from ports, using the
supplied rc script to manage 'profiles', which define the separate
instances of apache to run, with all necessary configuration in
/usr/local/etc/apache22-{profile-name}. No crazy symlinks required!

When a developers needs an apache instance to play with, they would
typically just do something like this:
'/usr/local/sbin/httpd -f /home/foo/proj/conf/httpd.conf'. The only
things they need in conf are the httpd.conf, mime.types and magic.
Typically, they'll declare a server root in the conf file, with a logs
folder below server root. That's pretty muc hall that is needed.

However, we don't do this so much anymore. Now typically, we will
configure a separate freebsd jail for each service.

Cheers

Tom

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: Can I have 2 httpd servers running on 2 different ports?

Posted by Sheryl <gu...@his.com>.
>> What benefit does this give you over running VirtualHost?
>>
>
> (I wouldn't set up a second instance like suggested, but..)

Curious about why not...

BTW, my example was a little simplified.  In practice we actually make a
link "base" which points to the apache directory and the link bin to
base/bin, etc.  That way, when we compile a new version we put it in its
own directory and change the link.  Easy to upgrade, easy to back off if
it doesn't work.

More recently we have been moving toward multiple compiles because we're
trying to put everything in its own stack in preparation for moving to
VMs. But we still do the linking in order to make upgrades easier.

> 1) You can load different modules in different instances
> 2) Separation of concerns
> 3) Different global configuration options
> 4) Different compile time options

All of those apply, but most of it has to do with what I assume you mean
by (2).  We have several different customer groups and many applications.
Although we do run VirtualHost, each instance of apache belongs to one
organizational entity.  That way, two groups with different missions don't
have to agree on a restart for changing a paramter (and for that matter
don't have to agree to the change, which relates to (3) above).  Also,
easier to co-ordinate software upgrades.

> For instance, on our reverse proxies, we run two instances of apache,
> one handles SSL and runs prefork MPM, and one handles regular HTTP and
> runs the event MPM.
>
> Cheers
>
> Tom
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org