You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Mandy Singh <ma...@gmail.com> on 2008/01/18 15:22:38 UTC

[users@httpd] Multiple Instances of Apache

Hi Everyone,

I would like to know the experts thoughts on having multiple instances of
apache on the same box.

Suppose I run an app off an instance of apache, then using VHosts add 2-3
diff mini sites to it.

If due to some reason one of the app causes apache to get hung, all my apps
become inaccessible.

In such a scenario, since app 3 is extremely important is it adivisable to
have another instance of apache running off the same box and serving app3 so
that is away from my main app (that sometimes causes problems)?

Thanks,
Mandy.

Re: [users@httpd] Multiple Instances of Apache

Posted by Dragon <dr...@crimson-dragon.com>.
Mandy Singh wrote:
>Thanks ascs. This is a good explanation.
>
>The only other question that partially remains unanswered is that if 
>I run apacheN on port 80 (and access my site as 
><http://mysite.com>http://mysite.com) and run apacheN+1 on port 8080 
>(and access site as 
><http://mysecondsite.com:8080>http://mysecondsite.com:8080) - what 
>can i do special to access 
><http://mysecondsite.com:8080>http://mysecondsite.com:8080 without 
>the port number (as if it was running on port 80). Did you get what 
>I was trying to say? Is this a legtimate question? :)
---------------- End original message. ---------------------

As the person who replied to your first post mentioned, you use a 
reverse proxy to do this.

Instructions on how you do it are here:

http://www.apachetutor.org/admin/reverseproxies



Dragon

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  Venimus, Saltavimus, Bibimus (et naribus canium capti sumus)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~


---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
...to which I replied in great details.

However, others later suggested IP-based VH.

-ascs
-----Message d'origine-----
De : Michael Clark [mailto:michael@metaparadigm.com] 
Envoyé : dimanche 20 janvier 2008 00:57
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache

Axel-Stephane SMORGRAV wrote:
>  Name-based virtual hosting saves IP addresses and does exactly the same.
>   
No. Not when you specifically want to isolate apps running in different instances of apache - this was what the orignal poster was asking.


---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Michael Clark <mi...@metaparadigm.com>.
Axel-Stephane SMORGRAV wrote:
>  Name-based virtual hosting saves IP addresses and does exactly the same.
>   
No. Not when you specifically want to isolate apps running in different 
instances of apache - this was what the orignal poster was asking.



---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
 Name-based virtual hosting saves IP addresses and does exactly the same.


-ascs

-----Message d'origine-----
De : Michael Clark [mailto:michael@metaparadigm.com] 
Envoyé : samedi 19 janvier 2008 02:10
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache

Mandy Singh wrote:
> The only other question that partially remains unanswered is that if I 
> run apacheN on port 80 (and access my site as http://mysite.com) and 
> run apacheN+1 on port 8080 (and access site as
> http://mysecondsite.com:8080) - what can i do special to access 
> http://mysecondsite.com:8080 without the port number (as if it was 
> running on port 80). Did you get what I was trying to say? Is this a 
> legtimate question? :)

The alternative to reverse proxy is to have each apache listen on a different IP address and have different DNS entries for each site. This way they are completely isolated (no dependancy on the master instance for reverse proxy).

In 1st apache:

  # Listen 80
  # by default, if no address is specified in Listen, apache will bind INADDR_ANY (which is 0.0.0.0 and means all addresses)
  Listen 1.2.3.4:80

In 2nd apache:

  Listen 1.2.3.5:80


---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Michael Clark <mi...@metaparadigm.com>.
Mandy Singh wrote:
> The only other question that partially remains unanswered is that if I 
> run apacheN on port 80 (and access my site as http://mysite.com) and 
> run apacheN+1 on port 8080 (and access site as 
> http://mysecondsite.com:8080) - what can i do special to access 
> http://mysecondsite.com:8080 without the port number (as if it was 
> running on port 80). Did you get what I was trying to say? Is this a 
> legtimate question? :)

The alternative to reverse proxy is to have each apache listen on a 
different IP address and have different DNS entries for each site. This 
way they are completely isolated (no dependancy on the master instance 
for reverse proxy).

In 1st apache:

  # Listen 80
  # by default, if no address is specified in Listen, apache will bind 
INADDR_ANY (which is 0.0.0.0 and means all addresses)
  Listen 1.2.3.4:80

In 2nd apache:

  Listen 1.2.3.5:80


---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
Given the nature of your question I am starting to suspect that what you actually want is name-based virtual hosting. If you are only doing HTTP (as opposed to httpS) you can serve as many sites as you like on the same IP/ports combination. In that case you only need one instance containing two or more virtual hosts for the same IP/port, each with a different ServerName. You would also need to declare the ip/port as NameVirtualHost.
 
Read http://httpd.apache.org/docs/2.0/vhosts/name-based.html for more details.

-ascs

________________________________

De : Mandy Singh [mailto:mandys@gmail.com] 
Envoyé : vendredi 18 janvier 2008 18:48
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache


Thanks ascs. This is a good explanation.

The only other question that partially remains unanswered is that if I run apacheN on port 80 (and access my site as http://mysite.com) and run apacheN+1 on port 8080 (and access site as http://mysecondsite.com:8080) - what can i do special to access http://mysecondsite.com:8080 without the port number (as if it was running on port 80). Did you get what I was trying to say? Is this a legtimate question? :) 


---------------------------------------------------------------------
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: [SPAM] - Re: [users@httpd] Multiple Instances of Apache - Email found in subject

Posted by jm...@fxdd.com.
Hmm...  with sum assumptions..

 

From: jmacaranas@fxdd.com [mailto:jmacaranas@fxdd.com] 
Sent: Friday, January 18, 2008 12:56 PM
To: users@httpd.apache.org
Subject: [users@httpd] RE: [SPAM] - Re: [users@httpd] Multiple Instances of Apache - Email found in subject

 

Do a port translation... J

 

From: Mandy Singh [mailto:mandys@gmail.com] 
Sent: Friday, January 18, 2008 12:48 PM
To: users@httpd.apache.org
Subject: [SPAM] - Re: [users@httpd] Multiple Instances of Apache - Email found in subject

 

Thanks ascs. This is a good explanation.

The only other question that partially remains unanswered is that if I run apacheN on port 80 (and access my site as http://mysite.com) and run apacheN+1 on port 8080 (and access site as http://mysecondsite.com:8080) - what can i do special to access http://mysecondsite.com:8080 without the port number (as if it was running on port 80). Did you get what I was trying to say? Is this a legtimate question? :) 

On Jan 18, 2008 11:13 PM, Axel-Stephane SMORGRAV <Ax...@europe.adp.com> wrote:

You can have as many instances of Apache as you wish on a Unix box. On Windows, I do not know but I suppose you can. Just like two Vhosts, two servers cannot bind the same IP/port combo.

What I do is that I make a server root for each instance of Apache. In that server root I create the directories bin, conf, cgi-bin and htdocs. I create a log directory on another disk partition. 

In the bin directory you need a copy of apachectl which will somehow start httpd pointing to the right configuration file. You may for example hard-code the paths to log directory, conf directory etc.  In my case I modified apachectl so that it automatically figures out where to get the config file from based on the directory in which the script is located. 

By typing "/servers/apacheN/bin/apachectl start", I start instance N. My apachectl script determines the script path, does 'dirname' to find the name of the parent directory which is the server root. A 'filename' on the server root will yield the instance name which can be appended to the log root path /logs to obtain /logs/apacheN. 

Instance configurations:

/servers
       |----->apacheN
       |               |-----> bin (contains only apachectl and an envvars file with LD_LIBRARY_PATH and some other environment vars)
       |               |-----> conf
       |               |-----> htdocs (the document root of this instance)
       |               |-----> cgi-bin
       |
       |----->apacheN+1
                       |-----> bin 
                       |-----> conf
                       |-----> htdocs
                       |-----> cgi-bin

Log files:
/logs
       |----->apacheN
       |----->apacheN+1 


Apache distribution:
/opt/apache2
       |-----> bin
       |-----> lib
       |-----> modules
       |-----> include
       |-----> manual
     |-----> icons

Hope this helps

-ascs

-----Message d'origine-----
De : Krist van Besien [mailto:krist.vanbesien@gmail.com]
Envoyé : vendredi 18 janvier 2008 15:49
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache


On Jan 18, 2008 3:22 PM, Mandy Singh < mandys@gmail.com <ma...@gmail.com> > wrote:
> Hi Everyone,
>
> I would like to know the experts thoughts on having multiple instances
> of apache on the same box.
>
> Suppose I run an app off an instance of apache, then using VHosts add 
> 2-3 diff mini sites to it.
>
> If due to some reason one of the app causes apache to get hung, all my
> apps become inaccessible.
>
> In such a scenario, since app 3 is extremely important is it 
> adivisable to have another instance of apache running off the same box
> and serving app3 so that is away from my main app (that sometimes causes problems)?

You can have multiple apaches on one box. They will all have to be bound to a different port however. 
What you could do is have for example a main apache on port 80, and three separate apaches for each app on eg. ports 8080, 8081, and 8082.
In you main apache you then proxy requests for the three different apps to the correct server. 
This gives you a couple of things:
- Each app runs in its own space.
- Each app can run under a different user.
- With port nrs > 1024 a non root user can start - stop the server.

Krist

--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation. 
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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 <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

 

-----------------------------------------------------------------------------
This message and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is
addressed. It may contain sensitive and private proprietary or legally
privileged information. No confidentiality or privilege is waived or
lost by any mistransmission. If you are not the intended recipient,
please immediately delete it and all copies of it from your system,
destroy any hard copies of it and notify the sender. You must not,
directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. 
FXDirectDealer, LLC reserves the right to monitor all e-mail 
communications through its networks. Any views expressed in this 
message are those of the individual sender, except where the 
message states otherwise and the sender is authorized to state them.

Unless otherwise stated, any pricing information given in this message
is indicative only, is subject to change and does not constitute an
offer to deal at any price quoted. Any reference to the terms of
executed transactions should be treated as preliminary only and subject
to our formal confirmation. FXDirectDealer, LLC is not responsible for any
recommendation, solicitation, offer or agreement or any information
about any transaction, customer account or account activity contained in
this communication.


[users@httpd] RE: [SPAM] - Re: [users@httpd] Multiple Instances of Apache - Email found in subject

Posted by jm...@fxdd.com.
Do a port translation... J

 

From: Mandy Singh [mailto:mandys@gmail.com] 
Sent: Friday, January 18, 2008 12:48 PM
To: users@httpd.apache.org
Subject: [SPAM] - Re: [users@httpd] Multiple Instances of Apache - Email found in subject

 

Thanks ascs. This is a good explanation.

The only other question that partially remains unanswered is that if I run apacheN on port 80 (and access my site as http://mysite.com) and run apacheN+1 on port 8080 (and access site as http://mysecondsite.com:8080) - what can i do special to access http://mysecondsite.com:8080 without the port number (as if it was running on port 80). Did you get what I was trying to say? Is this a legtimate question? :) 

On Jan 18, 2008 11:13 PM, Axel-Stephane SMORGRAV <Ax...@europe.adp.com> wrote:

You can have as many instances of Apache as you wish on a Unix box. On Windows, I do not know but I suppose you can. Just like two Vhosts, two servers cannot bind the same IP/port combo.

What I do is that I make a server root for each instance of Apache. In that server root I create the directories bin, conf, cgi-bin and htdocs. I create a log directory on another disk partition. 

In the bin directory you need a copy of apachectl which will somehow start httpd pointing to the right configuration file. You may for example hard-code the paths to log directory, conf directory etc.  In my case I modified apachectl so that it automatically figures out where to get the config file from based on the directory in which the script is located. 

By typing "/servers/apacheN/bin/apachectl start", I start instance N. My apachectl script determines the script path, does 'dirname' to find the name of the parent directory which is the server root. A 'filename' on the server root will yield the instance name which can be appended to the log root path /logs to obtain /logs/apacheN. 

Instance configurations:

/servers
       |----->apacheN
       |               |-----> bin (contains only apachectl and an envvars file with LD_LIBRARY_PATH and some other environment vars)
       |               |-----> conf
       |               |-----> htdocs (the document root of this instance)
       |               |-----> cgi-bin
       |
       |----->apacheN+1
                       |-----> bin 
                       |-----> conf
                       |-----> htdocs
                       |-----> cgi-bin

Log files:
/logs
       |----->apacheN
       |----->apacheN+1 


Apache distribution:
/opt/apache2
       |-----> bin
       |-----> lib
       |-----> modules
       |-----> include
       |-----> manual
     |-----> icons

Hope this helps

-ascs

-----Message d'origine-----
De : Krist van Besien [mailto:krist.vanbesien@gmail.com]
Envoyé : vendredi 18 janvier 2008 15:49
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache


On Jan 18, 2008 3:22 PM, Mandy Singh < mandys@gmail.com <ma...@gmail.com> > wrote:
> Hi Everyone,
>
> I would like to know the experts thoughts on having multiple instances
> of apache on the same box.
>
> Suppose I run an app off an instance of apache, then using VHosts add 
> 2-3 diff mini sites to it.
>
> If due to some reason one of the app causes apache to get hung, all my
> apps become inaccessible.
>
> In such a scenario, since app 3 is extremely important is it 
> adivisable to have another instance of apache running off the same box
> and serving app3 so that is away from my main app (that sometimes causes problems)?

You can have multiple apaches on one box. They will all have to be bound to a different port however. 
What you could do is have for example a main apache on port 80, and three separate apaches for each app on eg. ports 8080, 8081, and 8082.
In you main apache you then proxy requests for the three different apps to the correct server. 
This gives you a couple of things:
- Each app runs in its own space.
- Each app can run under a different user.
- With port nrs > 1024 a non root user can start - stop the server.

Krist

--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation. 
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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 <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

 


--------------------------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom it is
addressed. It may contain sensitive and private proprietary or legally
privileged information. No confidentiality or privilege is waived or
lost by any mistransmission. If you are not the intended recipient,
please immediately delete it and all copies of it from your system,
destroy any hard copies of it and notify the sender. You must not,
directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. 
FXDirectDealer, LLC reserves the right to monitor all e-mail 
communications through its networks. Any views expressed in this 
message are those of the individual sender, except where the 
message states otherwise and the sender is authorized to state them.

Unless otherwise stated, any pricing information given in this message
is indicative only, is subject to change and does not constitute an
offer to deal at any price quoted. Any reference to the terms of
executed transactions should be treated as preliminary only and subject
to our formal confirmation. FXDirectDealer, LLC is not responsible for any
recommendation, solicitation, offer or agreement or any information
about any transaction, customer account or account activity contained in
this communication.


Re: [users@httpd] Multiple Instances of Apache

Posted by Krist van Besien <kr...@gmail.com>.
On Jan 18, 2008 6:48 PM, Mandy Singh <ma...@gmail.com> wrote:
> Thanks ascs. This is a good explanation.
>
> The only other question that partially remains unanswered is that if I run
> apacheN on port 80 (and access my site as http://mysite.com) and run
> apacheN+1 on port 8080 (and access site as http://mysecondsite.com:8080) -
> what can i do special to access http://mysecondsite.com:8080 without the
> port number (as if it was running on port 80). Did you get what I was trying
> to say? Is this a legtimate question? :)


What we are proposing is not that you run your second app on
http://mysecondsite.comn:8080, but run it on http://mysite:8080. Ie,
running two (or more) instances _on the same_ host. I thought that is
what you would need.

Of course, if you have two hosts, or two IPs pointing to the same
host, you can set up two seperate apaches on each IP. If you don't you
will need to use virtual hosts.

You don't want one app to be able to take down the others aparently,
and that is why I suggested not to just isolate one app, but to
isolate all of them. Or to isolate the important app in on server, and
the others in another.

Basically the wy I would do this is as follow:

Suppose you have three apps, that you access as follow:
http:/mysite.com/app1
http:/mysite.com/app2
http:/mysite.com/app3

You want to isolate app3 three from all the others. You will need
three instances:

One apache on port 8080, has app1 and app2
One apache on port 8081, with app3
(Ports aren't really that important)
And then one apache on port 80.
This last apache will have statements like:

ProxyPass /app1  http://localhost:8080/app1
ProxyPass /app2  http://localhost:8080/app2
ProxyPass /app3  http://localhost:8081/app3

Since this last apache does nothing but move bits back and forth it
will be very stable, and you can expect it to be always available.

You can however access your three apps like this:
http://mysite.com/app1
http://mysite.com/app2
http://myothersite.com/

In this case you set up your secondary apache instances as in the
previous example, but the main one you set up with name base virtual
hosts.

<virtualhost *.*>
Servername mysite.com
ProxyPass /app1  http://localhost:8080/app1
ProxyPass /app2  http://localhost:8080/app2

</virtualhost>

<virtualhost *.*>
Servername myothersite.com
ProxyPass /  http://localhost:8081/

</virtualhost>

There are many other scenarios possible, but basically they all amount
the the following:
- Seperate your applications in "back end" apaches.
- Have one front end apache that does nothing but dispatch requests to
the proper backend.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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] Multiple Instances of Apache

Posted by Mandy Singh <ma...@gmail.com>.
Thanks ascs. This is a good explanation.

The only other question that partially remains unanswered is that if I run
apacheN on port 80 (and access my site as http://mysite.com) and run
apacheN+1 on port 8080 (and access site as http://mysecondsite.com:8080) -
what can i do special to access http://mysecondsite.com:8080 without the
port number (as if it was running on port 80). Did you get what I was trying
to say? Is this a legtimate question? :)

On Jan 18, 2008 11:13 PM, Axel-Stephane SMORGRAV <
Axel-Stephane.SMORGRAV@europe.adp.com> wrote:

> You can have as many instances of Apache as you wish on a Unix box. On
> Windows, I do not know but I suppose you can. Just like two Vhosts, two
> servers cannot bind the same IP/port combo.
>
> What I do is that I make a server root for each instance of Apache. In
> that server root I create the directories bin, conf, cgi-bin and htdocs. I
> create a log directory on another disk partition.
>
> In the bin directory you need a copy of apachectl which will somehow start
> httpd pointing to the right configuration file. You may for example
> hard-code the paths to log directory, conf directory etc.  In my case I
> modified apachectl so that it automatically figures out where to get the
> config file from based on the directory in which the script is located.
>
> By typing "/servers/apacheN/bin/apachectl start", I start instance N. My
> apachectl script determines the script path, does 'dirname' to find the name
> of the parent directory which is the server root. A 'filename' on the server
> root will yield the instance name which can be appended to the log root path
> /logs to obtain /logs/apacheN.
>
> Instance configurations:
>
> /servers
>        |----->apacheN
>        |               |-----> bin (contains only apachectl and an envvars
> file with LD_LIBRARY_PATH and some other environment vars)
>        |               |-----> conf
>        |               |-----> htdocs (the document root of this instance)
>        |               |-----> cgi-bin
>        |
>        |----->apacheN+1
>                        |-----> bin
>                        |-----> conf
>                        |-----> htdocs
>                        |-----> cgi-bin
>
> Log files:
> /logs
>        |----->apacheN
>        |----->apacheN+1
>
>
> Apache distribution:
> /opt/apache2
>        |-----> bin
>        |-----> lib
>        |-----> modules
>        |-----> include
>        |-----> manual
>      |-----> icons
>
> Hope this helps
>
> -ascs
>
> -----Message d'origine-----
> De : Krist van Besien [mailto:krist.vanbesien@gmail.com]
> Envoyé : vendredi 18 janvier 2008 15:49
> À : users@httpd.apache.org
> Objet : Re: [users@httpd] Multiple Instances of Apache
>
> On Jan 18, 2008 3:22 PM, Mandy Singh <ma...@gmail.com> wrote:
> > Hi Everyone,
> >
> > I would like to know the experts thoughts on having multiple instances
> > of apache on the same box.
> >
> > Suppose I run an app off an instance of apache, then using VHosts add
> > 2-3 diff mini sites to it.
> >
> > If due to some reason one of the app causes apache to get hung, all my
> > apps become inaccessible.
> >
> > In such a scenario, since app 3 is extremely important is it
> > adivisable to have another instance of apache running off the same box
> > and serving app3 so that is away from my main app (that sometimes causes
> problems)?
>
> You can have multiple apaches on one box. They will all have to be bound
> to a different port however.
> What you could do is have for example a main apache on port 80, and three
> separate apaches for each app on eg. ports 8080, 8081, and 8082.
> In you main apache you then proxy requests for the three different apps to
> the correct server.
> This gives you a couple of things:
> - Each app runs in its own space.
> - Each app can run under a different user.
> - With port nrs > 1024 a non root user can start - stop the server.
>
> Krist
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ---------------------------------------------------------------------
> 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
>
>

RE: [users@httpd] Multiple Instances of Apache

Posted by Axel-Stephane SMORGRAV <Ax...@europe.adp.com>.
You can have as many instances of Apache as you wish on a Unix box. On Windows, I do not know but I suppose you can. Just like two Vhosts, two servers cannot bind the same IP/port combo.

What I do is that I make a server root for each instance of Apache. In that server root I create the directories bin, conf, cgi-bin and htdocs. I create a log directory on another disk partition. 

In the bin directory you need a copy of apachectl which will somehow start httpd pointing to the right configuration file. You may for example hard-code the paths to log directory, conf directory etc.  In my case I modified apachectl so that it automatically figures out where to get the config file from based on the directory in which the script is located.

By typing "/servers/apacheN/bin/apachectl start", I start instance N. My apachectl script determines the script path, does 'dirname' to find the name of the parent directory which is the server root. A 'filename' on the server root will yield the instance name which can be appended to the log root path /logs to obtain /logs/apacheN.

Instance configurations:

/servers
	|----->apacheN
	|		|-----> bin (contains only apachectl and an envvars file with LD_LIBRARY_PATH and some other environment vars)
	|		|-----> conf
	|		|-----> htdocs (the document root of this instance)
	|		|-----> cgi-bin
	|
	|----->apacheN+1
			|-----> bin
			|-----> conf
			|-----> htdocs
			|-----> cgi-bin

Log files:
/logs
	|----->apacheN
	|----->apacheN+1


Apache distribution:
/opt/apache2
	|-----> bin
	|-----> lib
	|-----> modules
	|-----> include
	|-----> manual
      |-----> icons

Hope this helps

-ascs
 
-----Message d'origine-----
De : Krist van Besien [mailto:krist.vanbesien@gmail.com] 
Envoyé : vendredi 18 janvier 2008 15:49
À : users@httpd.apache.org
Objet : Re: [users@httpd] Multiple Instances of Apache

On Jan 18, 2008 3:22 PM, Mandy Singh <ma...@gmail.com> wrote:
> Hi Everyone,
>
> I would like to know the experts thoughts on having multiple instances 
> of apache on the same box.
>
> Suppose I run an app off an instance of apache, then using VHosts add 
> 2-3 diff mini sites to it.
>
> If due to some reason one of the app causes apache to get hung, all my 
> apps become inaccessible.
>
> In such a scenario, since app 3 is extremely important is it 
> adivisable to have another instance of apache running off the same box 
> and serving app3 so that is away from my main app (that sometimes causes problems)?

You can have multiple apaches on one box. They will all have to be bound to a different port however.
What you could do is have for example a main apache on port 80, and three separate apaches for each app on eg. ports 8080, 8081, and 8082.
In you main apache you then proxy requests for the three different apps to the correct server.
This gives you a couple of things:
- Each app runs in its own space.
- Each app can run under a different user.
- With port nrs > 1024 a non root user can start - stop the server.

Krist

--
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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


Re: [users@httpd] Multiple Instances of Apache

Posted by Mandy Singh <ma...@gmail.com>.
Thank you Kris for a quick reply.

However, if my other apache's are dependant on a master apache (which has
it's own app running) and was the cause of failure at time because of which
I want other instances, then I am still dependant on the master
(troublesome) one - right?

Also, if master was http://mysite.com

and second was http://mysecondsite.com:8080

How can I still access second one as http://mysecondsite.com/ - this can be
configured in apache (to skip the port)?

Or will this be done at DNS level?

Or can this be done at all?

Thanks,
Mandy.

On Jan 18, 2008 8:18 PM, Krist van Besien <kr...@gmail.com> wrote:

> On Jan 18, 2008 3:22 PM, Mandy Singh <ma...@gmail.com> wrote:
> > Hi Everyone,
> >
> > I would like to know the experts thoughts on having multiple instances
> of
> > apache on the same box.
> >
> > Suppose I run an app off an instance of apache, then using VHosts add
> 2-3
> > diff mini sites to it.
> >
> > If due to some reason one of the app causes apache to get hung, all my
> apps
> > become inaccessible.
> >
> > In such a scenario, since app 3 is extremely important is it adivisable
> to
> > have another instance of apache running off the same box and serving
> app3 so
> > that is away from my main app (that sometimes causes problems)?
>
> You can have multiple apaches on one box. They will all have to be
> bound to a different port however.
> What you could do is have for example a main apache on port 80, and
> three separate apaches for each app on eg. ports 8080, 8081, and 8082.
> In you main apache you then proxy requests for the three different
> apps to the correct server.
> This gives you a couple of things:
> - Each app runs in its own space.
> - Each app can run under a different user.
> - With port nrs > 1024 a non root user can start - stop the server.
>
> Krist
>
> --
> krist.vanbesien@gmail.com
> krist@vanbesien.org
> Bremgarten b. Bern, Switzerland
> --
> A: It reverses the normal flow of conversation.
> Q: What's wrong with top-posting?
> A: Top-posting.
> Q: What's the biggest scourge on plain text email discussions?
>
> ---------------------------------------------------------------------
> 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] Multiple Instances of Apache

Posted by Krist van Besien <kr...@gmail.com>.
On Jan 18, 2008 3:22 PM, Mandy Singh <ma...@gmail.com> wrote:
> Hi Everyone,
>
> I would like to know the experts thoughts on having multiple instances of
> apache on the same box.
>
> Suppose I run an app off an instance of apache, then using VHosts add 2-3
> diff mini sites to it.
>
> If due to some reason one of the app causes apache to get hung, all my apps
> become inaccessible.
>
> In such a scenario, since app 3 is extremely important is it adivisable to
> have another instance of apache running off the same box and serving app3 so
> that is away from my main app (that sometimes causes problems)?

You can have multiple apaches on one box. They will all have to be
bound to a different port however.
What you could do is have for example a main apache on port 80, and
three separate apaches for each app on eg. ports 8080, 8081, and 8082.
In you main apache you then proxy requests for the three different
apps to the correct server.
This gives you a couple of things:
- Each app runs in its own space.
- Each app can run under a different user.
- With port nrs > 1024 a non root user can start - stop the server.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
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