Link to home
Start Free TrialLog in
Avatar of skumar123
skumar123

asked on

Want to run each virtual server as uniqe peocess in Solaris

Hi,

I'm using Apache 1.3 in Solaris. I have configured a virtual server in Apache. I'm able to succesfully browse the default page & the virtual server. As you all know that, when you start the Apache server it will run a process with a process ID in Solaris. So, when i stop the default server, I'm also not able to access the Virtual Server, since the Apache is running with one process ID.

Here is my requirement. I need to create mutiple virtual servers and want to run every virtual server as a seperate process with seperate process ID. So when I stop one virtual server, the other virtual servers will work with out stopping. Please can any one help me in this? I have searched a lot & couldn't find any answer for this.

Thanks
Siva.
Avatar of samri
samri
Flag of Malaysia image

no you can't.

Avatar of skumar123
skumar123

ASKER

Thanks for the responce. I would like to know one more thing. Is there any way to run multiple Apache servers in a single solaris server with uniqe process ID (not as virtaul server)?

why should this not work? samri

simply create a httpd.conf for each of your virtual servers.
Then start apache with the apropriate conf file, ready.
It sounds good. If it is possible, can you please tell me how to perform that? Any documents or tips? Please.

Thanks in advance.
make a copy of httpd.conf for each your virtual servers.
In each copy remove the other virtual servers, just leave the definitions for one in it.
Then start apache with each config file
    httpd -f /etc/httpd/vserv-1.conf
    httpd -f /etc/httpd/vserv-2.conf
    ...

in each *.conf make shure that the server does **not** bind
to all interfaces, but only exacly one.
You either need a own IP for each server, or each server needs to run on another port.
Virtual IPs on the NIC might be the simplest solution.
ahoffmann/smukar123,

apology on not elaborating the answer (lazy brat!).  I just assumed that apache alone cannot do that, unless, something is done at the OS layer.

and yes, you are correct on the explanation.  

Another approach (Not virtual IP approacah) would be running one apache, and let's called this the "master", to listen on port 80, and have have a separate apache for each Vhost that you want to run (just like ahoffmann proposed), but the apache for the Vhost will be listening on port other than 80. Let's pick 10001,10002, etc.

In the master config, create a Vhost container for each Vhost, and redirect request for each Vhost, to it's respective Apache (which is listeing on different port).  Mod_rewrite can be used, Redirect, or even ProxyPass/ProxyPassReverse could be used.

Thanks ahoffmann,

It works. I have configured individual httpd.conf file for another server and started by using httpd -f /etc/apache/test/httpd.conf. Noe that server is running with a seperate process ID. If want to stop this specific instance, what should I do? Now i'm stopping this server by simply killing the process IDs. Since i can stop the default server by using the ./apachect1 stop command, is it possible to stop the other servers also like this?

Also I have another querry. After i start the server, when i type ps -ef and check the processes, I observed that the same server process is running with nearly six precesses. There is one parent process ID and rest of them are using that process ID as parent ID with unique child process IDs. I can't understand why more than one process is running for a server. Can you please clarrify me?

Thanks in
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
it's 5 (again a guess).