Page 1 of 1
Multiple Apache instances -- how?
Posted: Sat Apr 26, 2008 7:04 pm
by alex.barylski
I need to run a separate instance of Apache configured to minimize security issues. I have read this is possible several times but have not seen a example of how this is done...
I assume you simply start a new Apache daemon and point it to a new configuration file (httpd.conf) and bind to a port other than 80?
Can someone give me the basics as to how this is done as well as show me the commands I might execute?
For example:
Code: Select all
apache2 somenew.config.file -p 8088
Is something like the above how I might start a new Apache daemon which served requests over port 8088?
Re: Multiple Apache instances -- how?
Posted: Sat Apr 26, 2008 11:06 pm
by Chris Corbyn
I've only ever done it by compiling two self-contained versions into /usr/local. What do you need this for again? Can you elaborate on the security issues you envisage? If it's anything to do with user permissions look at PHP/CGI/SuExec.
EDIT | Also, many of the config settings you might change on a per-host basis are settable from within a <VirtualHost>, <Directory> or <Location> directive.
Re: Multiple Apache instances -- how?
Posted: Mon Apr 28, 2008 6:48 pm
by Doug G
If you want to see an operating example you could install ispconfig on a server. ISPConfig compiles and installs it's own apache in it's own directory with it's own conf file, and on port 81.
Re: Multiple Apache instances -- how?
Posted: Tue Apr 29, 2008 6:39 am
by VladSun
Apache 2.* for Debian:
copy /etc/apache2/apache2.conf directory to /etc/apache2_8080 for example
Edit /etc/apache2_8080/apache2.conf (and included files) so it conforms your needs, but you must have this done:
- change in "/etc/apache2_8080/apache2.conf " line "ServerRoot /etc/apache2/" to "ServerRoot /etc/apache2_8080/";
- change in "/etc/apache2_8080/apache2.conf " line "PidFile /var/run/apache2.pid" to "PidFile /var/run/apache2_8080.pid";
- change in "/etc/apache2_8080/ports.conf" to "Listen 8080"
Then run
Code: Select all
apache2 -f /etc/apache2_8080/apache2.conf -k start
That's it

Re: Multiple Apache instances -- how?
Posted: Wed Apr 30, 2008 2:40 pm
by alex.barylski
I've only ever done it by compiling two self-contained versions into /usr/local
Hmm...why did you need two installations of Apache? All modules in my current installation are loaded via config files...so I thought using the same copy of Apache would suffice.
Can you elaborate on the security issues you envisage
Using apache as a substitute to FTP and the book recommends running it as such. Basically to remove all the modules otherwise dynamically loaded. I know I can disable PHP with a directive in .htaccess but running under a resitrcted environment is probably best.
VladSun: Thats the setup I was looking for. I thought it might be possible to do that but I wasn't sure. Thanks for that.
