[wp-hackers] Multiple versions of same install independently running on same server

Hydrostarr lists.automattic.com--wp-hackers at hydrostarr.com
Mon Mar 12 09:11:06 UTC 2012


Update: am wondering if the following /etc/wordpress/wp-config.php file 
(which we just discovered) might be contributing to these probs. To 
note: looks like the Ubuntu wordpress debian pkg put its stuff in 
/usr/share/wordpress/*, while our single (working) WP server is mostly 
living in /var (like /var/www) areas... fwiw.

<code=start>

<?php
/***
* WordPress's Debianised default master config file
* Please do NOT edit and learn how the configuration works in
* /usr/share/doc/wordpress/README.Debian
***/

/* Look up a host-specific config file in
* /etc/wordpress/config-<host>.php or /etc/wordpress/config-<domain>.php
*/
$debian_server = preg_replace('/:.*/', "", $_SERVER['HTTP_HOST']);
$debian_server = preg_replace("/[^a-zA-Z0-9.\-]/", "", $debian_server);
$debian_file = '/etc/wordpress/config-'.strtolower($debian_server).'.php';
/* Main site in case of multisite with subdomains */
$debian_main_server = preg_replace("/^[^.]*\./", "", $debian_server);
$debian_main_file = 
'/etc/wordpress/config-'.strtolower($debian_main_server).'.php';

if (file_exists($debian_file)) {
require_once($debian_file);
define('DEBIAN_FILE', $debian_file);
} elseif (file_exists($debian_main_file)) {
require_once($debian_main_file);
define('DEBIAN_FILE', $debian_main_file);
} elseif (file_exists("/etc/wordpress/config-default.php")) {
require_once("/etc/wordpress/config-default.php");
define('DEBIAN_FILE', "/etc/wordpress/config-default.php");
} else {
header("HTTP/1.0 404 Not Found");
echo "Neither <b>$debian_file</b> nor <b>$debian_main_file</b> could be 
found. <br/> Ensure one of them exists, is readable by the webserver and 
contains the right password/username.";
exit(1);
}

/* Default value for some constants if they have not yet been set
by the host-specific config files */
define('ABSPATH', '/usr/share/wordpress/');
define('WP_CORE_UPDATE', false);
define('WP_ALLOW_MULTISITE', true);
define('DB_NAME', 'wordpress');
define('DB_USER', 'wordpress');
define('DB_HOST', 'localhost');

/* Default value for the table_prefix variable so that it doesn't need to
be put in every host-specific config file */
if (!isset($table_prefix)) {
$table_prefix = 'wp_';
}

require_once(ABSPATH . 'wp-settings.php');
?>

</code>


On 3/11/12 3:57 PM, Hydrostarr wrote:
> Thanks Mike. Good to know WP -can- support multiple, independent 
> installs on same server. Now just need to figure out how to do it.
>
> Re: the "relative to root" debate: interesting. Good to know, and thx 
> for the executive summary, saves significant research time.
>
> Re: stock Ubuntu install: fwiw, we don't use the actual /var/www code 
> from 'apt-get install wordpress'. We simply "re-clone" (via 'git 
> clone' with some database changes as perviously mentioned) our working 
> code set from various dev servers/platforms (including Windows) and 
> are running WP 3.3.x. We employ 'apt-get install wordpress' primarily 
> to auto-install all the dependencies that WP uses (Apache, mysql, php, 
> etc) easily. Appropriate?
>
>
> Mike Little writes:
> >On Sun, Mar 11, 2012 at 16:54, Hydrostarr <
> >lists.automattic.com--wp-hackers at hydrostarr.com> wrote:
> >
> >>WP just doesn't "work relative to a root" like most all other 
> web-server apps
> >> that's we've employed previously.
> >>
> >Please search for many long and often heated discussions about this 
> subject
> >in the mailing list archives
> >http://lists.automattic.com/pipermail/wp-hackers/
> >Executive summary - agree or disagree, it isn't going to change anytime
> >soon.
> >
> >
> >> Ubuntu 11.04.
> >> Stock WP install with 'apt-get install wordpress' (maybe the latter is
> >> a/the problem)?
> >>
> >
> >Don't do that! It looks like it will install WordPress 2.9.2 which is 
> very,
> >very, old. Just download WordPress as normal 
> (http://wordpress.org/download/)
> >and install it in as many vhost document roots as you like.
> >
> >I have more than 200 WordPress install across my three servers 
> (including
> >local dev server) all using Apache vhosts, most have separate 
> installs and
> >databases, a few are multisite with from 3 to 50 subsites.
>


More information about the wp-hackers mailing list