View previous topic :: View next topic |
Author |
Message |
pavel.stratil Tux's lil' helper

Joined: 23 Oct 2005 Posts: 134
|
Posted: Tue Aug 07, 2007 2:30 pm Post subject: different php/apache combinations |
|
|
hi!
on one machine, i'd like to have two apache servers running, each listening on a different port, each using a different php.ini for its mod_php. sofar i have been using hand compiled apache and php, but compiling php by hand is getting a hell with a few extensions... i'd like to do the same using portage. did anyone try this? or isnt portage designed to do these kinds of tricks...
if this isnt real, what would you suggest? i arrived to gentoo from solaris where zones where an elegant solution... the alternative on linux seems to be the vserver and openvz. but sofar it seems one needs to use a modified kernel. does anyone know if vserver or openvz (or anything else similar) will be merged into the kernel sometime soon?
thanks... |
|
Back to top |
|
 |
Dan Veteran

Joined: 25 Oct 2005 Posts: 1302
|
Posted: Tue Aug 07, 2007 3:04 pm Post subject: |
|
|
Can you try to explain why you would need multiple instances of apache and different php.ini's? You can specify php variables per virtual host to accomplish different php specifications per site. I highly recommend not using src compiled apache and or php without portage, simply emerge apache and php with the USE flags you require.
In a production environment I use in /etc/portage/package.use for example.
Code: | www-servers/apache ldap mpm-worker
dev-lang/php apache2 berkdb bzip2 calendar cgi cli crypt ctype curl curlwrappers exif flatfile force-cgi-redirect ftp gd gdbm gmp imap inifile ipv6 kerberos ldap memlimit mhash mssql mysql ncurses nls odbc pcntl pcre pic posix postgres readline reflection sasl session simplexml snmp soap sockets spell ssl sysvipc threads truetype unicode wddx xml xmlrpc xsl yaz zip zlib -adabas -apache -bcmath -birdstep -cdb -cjk -concurrentmodphp -db2 -dbase -dbmaker -debug -discard-path -doc -empress -empress-bcs -esoob -fastbuild -fdftk -filepro -firebird -frontbase -gd-external -hardenedphp -hash -hyperwave-api -iconv -informix -interbase -iodbc -java-external -libedit -mcve -ming -msql -mysqli -oci8 -oci8-instant-client -pdo -pdo-external -qdbm -recode -sapdb -sharedext -sharedmem -solid -spl -sqlite -sybase -sybase-ct -tidy -tokenizer -vm-goto -vm-switch -xmlreader -xmlwriter -xpm
|
and one persons vhost.conf would have
Code: | php_admin_flag engine on
php_admin_flag safe_mode off
php_admin_value open_basedir "/htdocs:/tmp" |
and another ones may have
Code: | php_admin_flag engine on
php_admin_flag safe_mode on
php_admin_value open_basedir ".:/foo:/tmp" |
_________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
 |
pavel.stratil Tux's lil' helper

Joined: 23 Oct 2005 Posts: 134
|
Posted: Tue Aug 07, 2007 4:40 pm Post subject: |
|
|
dcoats wrote: | Can you try to explain why you would need multiple instances of apache and different php.ini's? You can specify php variables per virtual host to accomplish different php specifications per site. I highly recommend not using src compiled apache and or php without portage, simply emerge apache and php with the USE flags you require.
|
I use two apache instances, one listening on port 80, serving static content and proxying dynamic traffic to port 81 where another apache sits with php loaded. While on solaris, I had two such pairs in two zones, each assigned with its own ip address. One used for development purposes with php compiled with a rich set of modules and one meant as a virtual hosting server with tighter restrictions on php usage.
Since I used the zones approach, i never thought of using the php_admin* directives but it looks like a nice thing that could potentially rid me of two slightly different php packages for the price of a small performance degradation due to using php with more extensions compiled in on the vhost pair... do i need to enable some useflag to use the php_admin directive or are these always available if php is compiled as a module?
Then the two apache instances running alongside should be doable by using two init.d scripts referring to different httpd.conf files. would this be ok from the gentoo perspective? (i personally see no problem since i can do this with the porage httpd package) |
|
Back to top |
|
 |
Dan Veteran

Joined: 25 Oct 2005 Posts: 1302
|
Posted: Tue Aug 07, 2007 4:52 pm Post subject: |
|
|
Quite honestly i don't see any reason you would have any performance degradation at all, If anything you should have performance increase with less server load. You don't need to run 2 separate apache instances, have vhost1, vhost2, vhost3 etc... on 1 ip and/or port and vhost4,vhost5,vhost6 on another ip and/or port. I'm still confused as to why you are making it more difficult than it needs to be. _________________ - Failure is not an option. It's bundled with your software. |
|
Back to top |
|
 |
|