Link to home
Start Free TrialLog in
Avatar of Mohit_t
Mohit_t

asked on

Starting multiple instances of apache2 on server reboot

Hi,
I have multiple instances of apache2 reunning on a solaris 10 box. I want all the apache instances to automatically start once the physical server is rebooted.
Appreciete if someone can guide me how to modify the rc3.d script for doing this.

Thanks,
Mohit
Avatar of Papertrip
Papertrip
Flag of United States of America image

Is there a specific reason you are running multiple Apache instances on the same box?
Avatar of arnold
You can configure a single controlled instance to listen on multiple IPs, and ports.
Please provide additional details on your question.
Avatar of Mohit_t
Mohit_t

ASKER

Hi,
Yes we are using multiple websites as one site caters to normail users and the other website is for text base browsers. We use the same code base but filter out JS and other fancy stuff for text base browsers. I think running multiple websites on one box vs running them on different boxes is not negotiable.

We are running virtual solaris 10 containers and have one VIP assigned to each virtual box, so we are running multiple apache instances on one box on different ports. Also there are FW and Load Balancers in between.

arnold please let me know what further details you need.
We are running multiple apache instances and want to modify rc3.d script so that all the apache instances come up on server reboot. Right now we have to manually start all the apache instances.
OS: Solaris 10
Apache: apache2.2

Appreciate help of all the gurus and geniuses.

Thanks
You can run both websites from the same Apache instance using virtual hosts.  It's a very common practice with lots of documentation and examples.  I don't even remember the last time I setup Apache and not used virtual hosts.

Check out http://httpd.apache.org/docs/2.0/vhosts/
You will want to setup name-based vhosts -  http://httpd.apache.org/docs/2.0/vhosts/name-based.html

Examples -- http://httpd.apache.org/docs/2.0/vhosts/examples.html

You should be able to get all you need accomplished by reading through those links, it even has examples of exactly what you are trying to do with the multiple instances.
If you don't want to consolidate the multiple configuration into a single instance that will include the various others, you should copy the apache2 start script and adjust each start script to match the settings you want.
Another option depending on your scripting skills, you could modify the apache2 to have the capacity to start all the instances you want.

You are using the svcadm, rather than the legacy scripting.
You can use svccfg to export the existing apache service and then import a modified one as a new service per instance.

http://www.cims.nyu.edu/cgi-systems/man.cgi?section=1M&topic=svccfg



Do you have a reverse proxy that handles the differentiation between the regular access and the text only?

ASKER CERTIFIED SOLUTION
Avatar of xterm
xterm

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
SOLUTION
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
In my previous post...

If the command
# svcs http

If it returns disabled, you'll want to follow previous poster about copying the legacy /etc/init.d script.

If it returns enabled, you may want to consider my advice.