Click to See Complete Forum and Search --> : Apache Guide: Two Apache servers on machine?


KevinReichard
07-17-2002, 03:50 PM
These talkbacks are in response to the article Apache Guide: Configuring Your Apache Server Installation (http://www.serverwatch.com/stypes/servers/article.php/1126821).

Narayan Banda writes:
Dear Sir,
Can I load two apache servers on my single linux server? This is required to serve / protect files/print between departments. If yes, then send us the detail instruction on how to proceed to achieve the same.

angelo Genovese responds:
yes,
install them as usual (in different directories)
set different port numbers for each (ie: 10080 & 10081)
in a browser type:

www.mydomain.com:10080/

or

www.mydomain.com:10080/

to reach the servers respectively.

I still don't see why you'd use two servers as opposed to virtual servers though

Jason Lee writes:
Probably a bit old, but I'll take a shot. If you need to run two different apache installations on the same box, the quickest way, IMO, is to have two separate conf files for the servers (/usr/local/apache/conf/httpd-server1.conf and /usr/local/apache/conf/httpd-server2.conf). In your startup script, you will need to tell apache where to find the conf file, which I think is -f, but that's off the top of my head. The drawback here is that if both servers need to share the machine name (both departments use http://foo), then at least one server will need to be on a non-standard port, giving you something like http://foo and http://foo:8080. That's fine. It works. It's just extra work for one department.

Now, if one machine will run both servers, but under different names (i.e., foo1 and foo2) you can use apache's vhosting capabilites. I've never had to do this, so I don't know how to. :) The conf file that comes with the distro is pretty well documented, so it shouldn't be too difficult to figure.

A third option is to use .htaccess. I'm going to assume that some form of authentication is going to be used. If not, one department could just as easily look at http://foo1 as changing from http://foo/dept1 to http://foo/dept2. Using .htaccess, you can restrict access to the directories on a per-user basis (which can present maintenance issues) and serve all content off one server. I don't know all the particulars of your situation, but this is what I would lean toward if I could.

Hope that helps (and I hope I made sense ;).