• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2870
  • Last Modified:

SLES 10 - running multiple instances of apache

Hi All,

We are running SLES 10 SP1.  Using as a web server

I have multiple ips attached to the network device: so for this example 19.168.0.10, 192.168.0.11, 192.168.0.12 etc.

What I would like to do is have 2 apache services running - the main one would have 1 web site with the ip of .10 the 2nd instance would have .11 and .12 in the apache config.

Why I want to do this, is I have a php app that uses XML-RPC and because I have a apache config that uses multiple IPs and Virtual Hosts, it returns the wrong ip and won't do what it needs to do. So I figured I'd try running multiple instances of apache and see if that fixes my problem.

My Questions:

How do I go about installing multiple instances on SLES 10?
How do I configure apache? -- I think know most of this -- is there anything special?



0
Tigger996
Asked:
Tigger996
  • 4
  • 4
1 Solution
 
giltjrCommented:
You should be able to start apache pointing to a unique configuration file for each instance.  In each intance you sepcify the IP address you want that to listen on.

You don't need to install Apache more than once.

What you do need to do is start Apache differently.

You can add something like:

/usr/local/apache2/bin/apachectl -f /usr/local/apache2/instance2/httpd.conf
/usr/local/apache2/bin/apachectl -f /usr/local/apache2/instance1/httpd.conf


to your rc.local file.  In instance1.conf you have:

     listen 19.168.0.10:80

in instance2.conf you have:

    listen 192.168.0.11:80

and a virtual host definition for 192.168.0.12.
0
 
Tigger996Author Commented:
Ok, I will try that out.

How would you restart and stop a specific instance?
0
 
giltjrCommented:
http://httpd.apache.org/docs/2.2/programs/apachectl.html

Depends on the type of restart you want to do, I beleive it would be:

/usr/local/apache2/bin/apachectl -f /usr/local/apache2/instance2/httpd.conf restart

or

/usr/local/apache2/bin/apachectl -f /usr/local/apache2/instance2/httpd.conf graceful


0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
alextoftCommented:
I think personally I'd fix the php app!
0
 
giltjrCommented:
I agree, but it is a heck of a lot easier for me to tell him how to run two Apache instances than it is do debug PHP code.  

:)
0
 
Tigger996Author Commented:
I'm not sure how to fix the app.  The app I'm talking about is Moodle.  They've come out with a new thing called moodle networking.  In a nutshell, you can login to one instance and jump to another instance using the same login.  They use XML-RPC and openssl to keep the connection secure.  With my current apache config, I have all my moodle instances on 1 ip.  So when it tries to jump, it can verify the ip.  As soon as I move one of my instances to a new ip, openssl returns that the ip doesn't match to what is on record. So I figured it is be if ny apache config listening to multiple ip's.  

That's why I wanted  to test this out with 2 instances of apache and see if it will work or not.  I have posted to the moodle tracker, but it's an open source project and getting an answer can take some time.

0
 
Tigger996Author Commented:
Ok I copied over my config files and changed the settings but I'm getting httpd is already running.

So maybe I do need a 2nd install??
0
 
giltjrCommented:
In each httpd.conf file you will need to make sure that you have specifided either a unique path or file name for the PidFile parameter.
0
 
Tigger996Author Commented:
Thank you  I got it to work, but I'm still having trouble with the app even on another instance of apache -- so maybe it's not the apache config that's giving me the error.   Here's the error I'm getting :

RPC auth/mnet/user_authorise:Payload not signed: faultCode 7017  faultString Your IP address does not match the address we have on record. ERROR 2:2:Payload not signed: faultCode 7017  faultString Your IP address does not match the address we have on record.

 I will post in the php area with regards to XML-RPC.

Thanks for all your help.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now