logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Setting up more than 1 version of Apache?
Author
mrcullers



Joined: 16 Jun 2012
Posts: 22
Location: USA, Bradenton FL

PostPosted: Fri 29 Jun '12 4:18    Post subject: Setting up more than 1 version of Apache? Reply with quote

These questions are probably quite advanced and looking for help from well seasoned experts. These questions are not for the intermediate or new comers to attempt to answer though all support is greatly appreciated.

Considering conf has "Listen" I would assume I could run more than one version of Apache on the same machine. I have heard of using a smaller simpler server to direct or redirect to other Apache servers in large setups.

Ok, basically what I want to be able to do is run both x64 and x32 Apache servers. Both with the option of running x64 & x32 PHP as well as the ability to switch between different versions of PHP 5.x.x as well.

Obviously this is a 100% pure development server for programming only. Serves no "Real" web sites, only things in development. So that will answer your question on why would I even want to do this? It is all about being able to test and prove software packages will/will not work under different environments. And to be able to produce adequate results in software setup packages when the environment is not adequate for the given package.

The Question:
Does anyone have any tips on how to setup an easy way to switch between different environments?

The only thing I can think of is setting up different configs where the main config is like so...

httpd.conf
Code:

#include ServerSetup1.conf
#include ServerSetup2.conf
 include ServerSetup3.conf
#include ServerSetup4.conf


Then by changing the conf called, I can have different versions of php called and all I have to do is restart apache.

I am sure I am not the first to want something like this so I would assume there may be something out there to do this in a more programmatic, non-manual effort.

Now as for different versions of Apache is there a way to have domain.com go to apache x32 and anotherdomain.com go to apache x64? And can this be done without the need of a DNS on the machine. Or is a DNS actually the solution to point different domains to different setups of apache/php?

Any ideas or solutions would be greatly appreciated.

UPDATE:

So I look around and see I am not the first person to ask this question. Yes I am guilty of not reading enough before posting a question. So yes, I will do a little more reading. However, I will assume at this point that the complexity of my question may have not been asked by others so I don't feel that bad quite yet. But then again, I am making this statement before I precede to do more reading. Heheheh Smile


Last edited by mrcullers on Fri 29 Jun '12 6:12; edited 1 time in total
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 29 Jun '12 5:56    Post subject: Reply with quote

I have this, they're live though. Because I only have 1 IP outbound I have to do it with ports.

Apache 2.4.2: https://www.apachehaus.net/
Apache 2.2.22: http://www.apachehaus.net:85/

But you say this "no real websites" so if you have two internal IPs it shouldn't be hard. Everyone has 2 pretty much these days, 127.0.0.1 & 192.168.xxx.xxx

Set one to listen to 127.0.0.1 and another to listen to 192.168.xxx.xxx

If no real websites, and no real domains, using the hosts file just point

127.0.0.1 domain.com
192.168.xxx.xxx someother.com

I do not see how having the different confs would help when it comes to one x64 and one x86, but having different configs for one Apache, you could also use <IfDefine> and not have to even comment and uncomment

<IfDefine Setup1>
Include ServerSetup1.conf
</IfDefine>
<IfDefine Setup2>
Include ServerSetup2.conf
</IfDefine>
<IfDefine SetupN>
Include ServerSetupN.conf
</IfDefine>

Then just start Apache with
httpd -DSetup1
see http://httpd.apache.org/docs/2.2/mod/core.html#ifdefine

More than one actual instance require more than one IP or Port since only one thing can listen on any one port/IP combo
Back to top
mrcullers



Joined: 16 Jun 2012
Posts: 22
Location: USA, Bradenton FL

PostPosted: Fri 29 Jun '12 6:17    Post subject: Reply with quote

Awesome, someone with experience and understands exactly my intentions. Thank you for answering. I have only read your answer 1 time and it has not sunk in yet, but let me reply with, if it helps you answer further, with...

I am running this server on virtualbox on win7 x64 using the bridged networking adapter. I have 1 IP (local ip) under the NIC and 1 IP via a wireless card. So I have 2 IP's along with the 127.0.0.1.

I am also running with reserved IP's under port forwarding via the router.

UPDATE:

Ok, the ports sound like a very good solution. I do have .com's pointing my way via changeip.com dns sub domains. So not sure how the host file can help. I do have about 30 different domains pointing to my server.


Last edited by mrcullers on Fri 29 Jun '12 7:09; edited 1 time in total
Back to top
mrcullers



Joined: 16 Jun 2012
Posts: 22
Location: USA, Bradenton FL

PostPosted: Fri 29 Jun '12 7:01    Post subject: Reply with quote

Another question that has been on my mind for over 2 years now....

When I setup my virtual hosts file, I always setup the first virtual host as the "Titled as Default" account on the server. Simply because a long time ago I caught on to the fact that any unknown domains pointing to my server always default to the first account listed under virtual hosts.

The question is, is there any more to this theory I should know about? Is this really what is going on? Or is the effect to something else going on I am not aware of?
Back to top
glsmith
Moderator


Joined: 16 Oct 2007
Posts: 2268
Location: Sun Diego, USA

PostPosted: Fri 29 Jun '12 7:56    Post subject: Reply with quote

No, that is the default host, anything to your IP with a hostname not configured will fall there as well as http://IPaddress

I used to keep script that would produce a big fat red GO AWAY! there when someone went to http://myIPaddress.

Different real domains to different Apache's:
Unless you have a router that supports it(are there any?), you need more than 1 IP out into the world so you can point the DNS to different IP addresses.
Back to top


Reply to topic   Topic: Setting up more than 1 version of Apache? View previous topic :: View next topic
Post new topic   Forum Index -> Apache