Apache2 MPM-prefork MPM-worker multiple instances on same Ubuntu host machine possible?switching to worker mpm for apache 2 on RHEL 4How do I add php support to apache2 without breaking my current installation?Installing Apache MPM Worker on Centos 5.5Single fastcgi/php-cgi server for multiple virtualhosts?Apache crashes a few seconds after the startHow to build (configure options) latest apache on ubuntuConfiguring Apache2/mpm-worker not to eat up all the server's RAMThread Safe php-pecl-memcache and php-pecl-mongoWhich of these packages am I looking for to install Apache on Ubuntu?Change apache MPM prefork to worker on Amazon Linux AMI
Are white and non-white police officers equally likely to kill black suspects?
Infinite past with a beginning?
Chess with symmetric move-square
I probably found a bug with the sudo apt install function
DOS, create pipe for stdin/stdout of command.com(or 4dos.com) in C or Batch?
A function which translates a sentence to title-case
Is Social Media Science Fiction?
What do you call something that goes against the spirit of the law, but is legal when interpreting the law to the letter?
Email Account under attack (really) - anything I can do?
Is it legal to have the "// (c) 2019 John Smith" header in all files when there are hundreds of contributors?
declaring a variable twice in IIFE
How can I fix this gap between bookcases I made?
Why don't electron-positron collisions release infinite energy?
What typically incentivizes a professor to change jobs to a lower ranking university?
Closed subgroups of abelian groups
How is the claim "I am in New York only if I am in America" the same as "If I am in New York, then I am in America?
Motorized valve interfering with button?
Shell script can be run only with sh command
If Manufacturer spice model and Datasheet give different values which should I use?
How do I create uniquely male characters?
Download, install and reboot computer at night if needed
A newer friend of my brother's gave him a load of baseball cards that are supposedly extremely valuable. Is this a scam?
How do we improve the relationship with a client software team that performs poorly and is becoming less collaborative?
I’m planning on buying a laser printer but concerned about the life cycle of toner in the machine
Apache2 MPM-prefork MPM-worker multiple instances on same Ubuntu host machine possible?
switching to worker mpm for apache 2 on RHEL 4How do I add php support to apache2 without breaking my current installation?Installing Apache MPM Worker on Centos 5.5Single fastcgi/php-cgi server for multiple virtualhosts?Apache crashes a few seconds after the startHow to build (configure options) latest apache on ubuntuConfiguring Apache2/mpm-worker not to eat up all the server's RAMThread Safe php-pecl-memcache and php-pecl-mongoWhich of these packages am I looking for to install Apache on Ubuntu?Change apache MPM prefork to worker on Amazon Linux AMI
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have a live Apache2/MPM-Worker instance running Django. I want to also run an Apache2/MPM-prefork instance to run some Drupal6 applications on the same host machine and utilize a vast selection of PHP modules that run on the prefork model.
I plan to use my MPM-worker instance to reverse proxy to the Apache2-prefork instance for URLS starting with myhost.com/drupal6/. It seems theoretically doable/configurable by having the second Apache2-prefork instance configured to listen on an internal port, say 127.0.0.1:8080 and having my current Apache2-worker configured to proxy pass and reverse pass to it for the 'drupal6' URLs.
However, how do I compile or install the apache2-prefork version so it has a different executable name than /usr/sbin/apache2, for example /usr/sbin/apache2p, and so apache2ctl has a different name, say apache2pctl, and that apache2pctl invokes the /usr/sbin/apache2p instead of /usr/sbin/apache2... and so on down the line (eg /etc/apache2p) so I can start and restart my two instances independently?
As I understand it, no one executable of 'apache2' can be compiled with both the MPM-prefork and MPM-worker modules, so it seems I need two separate versions of the apache2 MPM flavors. But then I need to invoke and control them by separate names, I assume. I looked at the configuration options for apache2 and I am a bit queasy about compiling a second apache2 version with prefork because I am not sure I can set all the options so that none of my current apache2 files is overwritten. Is there a way?
Is there a standard solution to separately installing and controlling prefork and worker apache2 executables on the same machine without them stepping on each other during installation or operation?
apache-2.2 configuration multi-threading
add a comment |
I have a live Apache2/MPM-Worker instance running Django. I want to also run an Apache2/MPM-prefork instance to run some Drupal6 applications on the same host machine and utilize a vast selection of PHP modules that run on the prefork model.
I plan to use my MPM-worker instance to reverse proxy to the Apache2-prefork instance for URLS starting with myhost.com/drupal6/. It seems theoretically doable/configurable by having the second Apache2-prefork instance configured to listen on an internal port, say 127.0.0.1:8080 and having my current Apache2-worker configured to proxy pass and reverse pass to it for the 'drupal6' URLs.
However, how do I compile or install the apache2-prefork version so it has a different executable name than /usr/sbin/apache2, for example /usr/sbin/apache2p, and so apache2ctl has a different name, say apache2pctl, and that apache2pctl invokes the /usr/sbin/apache2p instead of /usr/sbin/apache2... and so on down the line (eg /etc/apache2p) so I can start and restart my two instances independently?
As I understand it, no one executable of 'apache2' can be compiled with both the MPM-prefork and MPM-worker modules, so it seems I need two separate versions of the apache2 MPM flavors. But then I need to invoke and control them by separate names, I assume. I looked at the configuration options for apache2 and I am a bit queasy about compiling a second apache2 version with prefork because I am not sure I can set all the options so that none of my current apache2 files is overwritten. Is there a way?
Is there a standard solution to separately installing and controlling prefork and worker apache2 executables on the same machine without them stepping on each other during installation or operation?
apache-2.2 configuration multi-threading
add a comment |
I have a live Apache2/MPM-Worker instance running Django. I want to also run an Apache2/MPM-prefork instance to run some Drupal6 applications on the same host machine and utilize a vast selection of PHP modules that run on the prefork model.
I plan to use my MPM-worker instance to reverse proxy to the Apache2-prefork instance for URLS starting with myhost.com/drupal6/. It seems theoretically doable/configurable by having the second Apache2-prefork instance configured to listen on an internal port, say 127.0.0.1:8080 and having my current Apache2-worker configured to proxy pass and reverse pass to it for the 'drupal6' URLs.
However, how do I compile or install the apache2-prefork version so it has a different executable name than /usr/sbin/apache2, for example /usr/sbin/apache2p, and so apache2ctl has a different name, say apache2pctl, and that apache2pctl invokes the /usr/sbin/apache2p instead of /usr/sbin/apache2... and so on down the line (eg /etc/apache2p) so I can start and restart my two instances independently?
As I understand it, no one executable of 'apache2' can be compiled with both the MPM-prefork and MPM-worker modules, so it seems I need two separate versions of the apache2 MPM flavors. But then I need to invoke and control them by separate names, I assume. I looked at the configuration options for apache2 and I am a bit queasy about compiling a second apache2 version with prefork because I am not sure I can set all the options so that none of my current apache2 files is overwritten. Is there a way?
Is there a standard solution to separately installing and controlling prefork and worker apache2 executables on the same machine without them stepping on each other during installation or operation?
apache-2.2 configuration multi-threading
I have a live Apache2/MPM-Worker instance running Django. I want to also run an Apache2/MPM-prefork instance to run some Drupal6 applications on the same host machine and utilize a vast selection of PHP modules that run on the prefork model.
I plan to use my MPM-worker instance to reverse proxy to the Apache2-prefork instance for URLS starting with myhost.com/drupal6/. It seems theoretically doable/configurable by having the second Apache2-prefork instance configured to listen on an internal port, say 127.0.0.1:8080 and having my current Apache2-worker configured to proxy pass and reverse pass to it for the 'drupal6' URLs.
However, how do I compile or install the apache2-prefork version so it has a different executable name than /usr/sbin/apache2, for example /usr/sbin/apache2p, and so apache2ctl has a different name, say apache2pctl, and that apache2pctl invokes the /usr/sbin/apache2p instead of /usr/sbin/apache2... and so on down the line (eg /etc/apache2p) so I can start and restart my two instances independently?
As I understand it, no one executable of 'apache2' can be compiled with both the MPM-prefork and MPM-worker modules, so it seems I need two separate versions of the apache2 MPM flavors. But then I need to invoke and control them by separate names, I assume. I looked at the configuration options for apache2 and I am a bit queasy about compiling a second apache2 version with prefork because I am not sure I can set all the options so that none of my current apache2 files is overwritten. Is there a way?
Is there a standard solution to separately installing and controlling prefork and worker apache2 executables on the same machine without them stepping on each other during installation or operation?
apache-2.2 configuration multi-threading
apache-2.2 configuration multi-threading
edited Sep 6 '15 at 1:49
Falcon Momot
22.7k104879
22.7k104879
asked Nov 21 '10 at 22:03
user60985user60985
1
1
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The apache wiki at wiki.apache.org has the answer for me. My main concern was not clobbering files in my current version of apache2 when creating a new apache2, and I had not seen a configuration option before to control where apache2ctl is copied to. However, it's there, and this page leads me to believe that all apache2 files are accounted for and that config.layout allows one to direct where all of them go. http://wiki.apache.org/httpd/DistrosDefaultLayout#Apache_httpd_2.2_default_layout_.28apache.org_source_package.29:
add a comment |
You don't have to have two installed copies, but you do need two different configurations.
This all depends on the OS you're using, I can tell you how to do it in Debian and Ubuntu:
- Decide on a name for your new instance. Let's say DRUPAL.
- Create a new configuration directory for your new instance, copy the original:
cp -a /etc/apache2 /etc/apache2-DRUPAL
- create startup script link:
ln -s /etc/init.d/apache2 /etc/init.d/apache2-DRUPAL
Now edit your new configuration in /etc/apache2-DRUPAL. You can change the web server username in /etc/apache2-DRUPAL/envvars, listening ports in /etc/apache2-DRUPAL/ports.conf etc.
With Apache 2.4 you can also have different MPMs installed at the same time so you can use different ones in your instances, which is your requirement.
After you're done with the configuration, run these commands:
service apache2-DRUPAL start
update-rc.d apache2-DRUPAL defaults
The first one checks the configuration and start your new instance. If it doesn't work, do the usual Apache debugging to get it working.
The second line just creates default rc links for startup.
If you wan't to run Apache commands without going through /etc/init.d/apache2-DRUPAL, you have to run . /etc/apache2-DRUPAL/envvars
before running them. I think this is Debian/Ubuntu specific. When you do that, you'll notice that apache2ctl
, apache2 -S
and others are operating from your new configuration.
That's it. No need for manual installation and cluttering of your system :)
HTH.
P.S.: https://wiki.apache.org/httpd/RunningMultipleApacheInstances seems like a good starting point to explore further.
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f204520%2fapache2-mpm-prefork-mpm-worker-multiple-instances-on-same-ubuntu-host-machine-po%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The apache wiki at wiki.apache.org has the answer for me. My main concern was not clobbering files in my current version of apache2 when creating a new apache2, and I had not seen a configuration option before to control where apache2ctl is copied to. However, it's there, and this page leads me to believe that all apache2 files are accounted for and that config.layout allows one to direct where all of them go. http://wiki.apache.org/httpd/DistrosDefaultLayout#Apache_httpd_2.2_default_layout_.28apache.org_source_package.29:
add a comment |
The apache wiki at wiki.apache.org has the answer for me. My main concern was not clobbering files in my current version of apache2 when creating a new apache2, and I had not seen a configuration option before to control where apache2ctl is copied to. However, it's there, and this page leads me to believe that all apache2 files are accounted for and that config.layout allows one to direct where all of them go. http://wiki.apache.org/httpd/DistrosDefaultLayout#Apache_httpd_2.2_default_layout_.28apache.org_source_package.29:
add a comment |
The apache wiki at wiki.apache.org has the answer for me. My main concern was not clobbering files in my current version of apache2 when creating a new apache2, and I had not seen a configuration option before to control where apache2ctl is copied to. However, it's there, and this page leads me to believe that all apache2 files are accounted for and that config.layout allows one to direct where all of them go. http://wiki.apache.org/httpd/DistrosDefaultLayout#Apache_httpd_2.2_default_layout_.28apache.org_source_package.29:
The apache wiki at wiki.apache.org has the answer for me. My main concern was not clobbering files in my current version of apache2 when creating a new apache2, and I had not seen a configuration option before to control where apache2ctl is copied to. However, it's there, and this page leads me to believe that all apache2 files are accounted for and that config.layout allows one to direct where all of them go. http://wiki.apache.org/httpd/DistrosDefaultLayout#Apache_httpd_2.2_default_layout_.28apache.org_source_package.29:
answered Nov 23 '10 at 22:35
user60985user60985
1
1
add a comment |
add a comment |
You don't have to have two installed copies, but you do need two different configurations.
This all depends on the OS you're using, I can tell you how to do it in Debian and Ubuntu:
- Decide on a name for your new instance. Let's say DRUPAL.
- Create a new configuration directory for your new instance, copy the original:
cp -a /etc/apache2 /etc/apache2-DRUPAL
- create startup script link:
ln -s /etc/init.d/apache2 /etc/init.d/apache2-DRUPAL
Now edit your new configuration in /etc/apache2-DRUPAL. You can change the web server username in /etc/apache2-DRUPAL/envvars, listening ports in /etc/apache2-DRUPAL/ports.conf etc.
With Apache 2.4 you can also have different MPMs installed at the same time so you can use different ones in your instances, which is your requirement.
After you're done with the configuration, run these commands:
service apache2-DRUPAL start
update-rc.d apache2-DRUPAL defaults
The first one checks the configuration and start your new instance. If it doesn't work, do the usual Apache debugging to get it working.
The second line just creates default rc links for startup.
If you wan't to run Apache commands without going through /etc/init.d/apache2-DRUPAL, you have to run . /etc/apache2-DRUPAL/envvars
before running them. I think this is Debian/Ubuntu specific. When you do that, you'll notice that apache2ctl
, apache2 -S
and others are operating from your new configuration.
That's it. No need for manual installation and cluttering of your system :)
HTH.
P.S.: https://wiki.apache.org/httpd/RunningMultipleApacheInstances seems like a good starting point to explore further.
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
add a comment |
You don't have to have two installed copies, but you do need two different configurations.
This all depends on the OS you're using, I can tell you how to do it in Debian and Ubuntu:
- Decide on a name for your new instance. Let's say DRUPAL.
- Create a new configuration directory for your new instance, copy the original:
cp -a /etc/apache2 /etc/apache2-DRUPAL
- create startup script link:
ln -s /etc/init.d/apache2 /etc/init.d/apache2-DRUPAL
Now edit your new configuration in /etc/apache2-DRUPAL. You can change the web server username in /etc/apache2-DRUPAL/envvars, listening ports in /etc/apache2-DRUPAL/ports.conf etc.
With Apache 2.4 you can also have different MPMs installed at the same time so you can use different ones in your instances, which is your requirement.
After you're done with the configuration, run these commands:
service apache2-DRUPAL start
update-rc.d apache2-DRUPAL defaults
The first one checks the configuration and start your new instance. If it doesn't work, do the usual Apache debugging to get it working.
The second line just creates default rc links for startup.
If you wan't to run Apache commands without going through /etc/init.d/apache2-DRUPAL, you have to run . /etc/apache2-DRUPAL/envvars
before running them. I think this is Debian/Ubuntu specific. When you do that, you'll notice that apache2ctl
, apache2 -S
and others are operating from your new configuration.
That's it. No need for manual installation and cluttering of your system :)
HTH.
P.S.: https://wiki.apache.org/httpd/RunningMultipleApacheInstances seems like a good starting point to explore further.
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
add a comment |
You don't have to have two installed copies, but you do need two different configurations.
This all depends on the OS you're using, I can tell you how to do it in Debian and Ubuntu:
- Decide on a name for your new instance. Let's say DRUPAL.
- Create a new configuration directory for your new instance, copy the original:
cp -a /etc/apache2 /etc/apache2-DRUPAL
- create startup script link:
ln -s /etc/init.d/apache2 /etc/init.d/apache2-DRUPAL
Now edit your new configuration in /etc/apache2-DRUPAL. You can change the web server username in /etc/apache2-DRUPAL/envvars, listening ports in /etc/apache2-DRUPAL/ports.conf etc.
With Apache 2.4 you can also have different MPMs installed at the same time so you can use different ones in your instances, which is your requirement.
After you're done with the configuration, run these commands:
service apache2-DRUPAL start
update-rc.d apache2-DRUPAL defaults
The first one checks the configuration and start your new instance. If it doesn't work, do the usual Apache debugging to get it working.
The second line just creates default rc links for startup.
If you wan't to run Apache commands without going through /etc/init.d/apache2-DRUPAL, you have to run . /etc/apache2-DRUPAL/envvars
before running them. I think this is Debian/Ubuntu specific. When you do that, you'll notice that apache2ctl
, apache2 -S
and others are operating from your new configuration.
That's it. No need for manual installation and cluttering of your system :)
HTH.
P.S.: https://wiki.apache.org/httpd/RunningMultipleApacheInstances seems like a good starting point to explore further.
You don't have to have two installed copies, but you do need two different configurations.
This all depends on the OS you're using, I can tell you how to do it in Debian and Ubuntu:
- Decide on a name for your new instance. Let's say DRUPAL.
- Create a new configuration directory for your new instance, copy the original:
cp -a /etc/apache2 /etc/apache2-DRUPAL
- create startup script link:
ln -s /etc/init.d/apache2 /etc/init.d/apache2-DRUPAL
Now edit your new configuration in /etc/apache2-DRUPAL. You can change the web server username in /etc/apache2-DRUPAL/envvars, listening ports in /etc/apache2-DRUPAL/ports.conf etc.
With Apache 2.4 you can also have different MPMs installed at the same time so you can use different ones in your instances, which is your requirement.
After you're done with the configuration, run these commands:
service apache2-DRUPAL start
update-rc.d apache2-DRUPAL defaults
The first one checks the configuration and start your new instance. If it doesn't work, do the usual Apache debugging to get it working.
The second line just creates default rc links for startup.
If you wan't to run Apache commands without going through /etc/init.d/apache2-DRUPAL, you have to run . /etc/apache2-DRUPAL/envvars
before running them. I think this is Debian/Ubuntu specific. When you do that, you'll notice that apache2ctl
, apache2 -S
and others are operating from your new configuration.
That's it. No need for manual installation and cluttering of your system :)
HTH.
P.S.: https://wiki.apache.org/httpd/RunningMultipleApacheInstances seems like a good starting point to explore further.
answered May 25 '14 at 13:38
Borut MrakBorut Mrak
212
212
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
add a comment |
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
I'm just trying this out (haven't used it before) and it seems you have to also set the environment variable APACHE_CONFIDIR=/etc/apache2-DRUPAL before sourcing /etc/apache2-DRUPAL/envvars.
– Borut Mrak
May 25 '14 at 13:48
add a comment |
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f204520%2fapache2-mpm-prefork-mpm-worker-multiple-instances-on-same-ubuntu-host-machine-po%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown