| |
10 May 2009
Posts: 44
http://me.mywebsight.ws/2006/08/11/host-multiple-wp-sites-on-one-installation/
that will allow i have only one install, one db to host multiple domain.
i'm planning using it for few small traffic web with only few pages company profile.
so it wont slow down any database...
or...
any better ways doing this?
maybe an installer?
i need something that can expedite jojocms installs without i need to login to cpanel/phpmyadmin, create database, user, etc....
something i can teach a non-technical web designer to do without give him/her login to cpanel/phpmyadmin/ftp/etc...
somehow so that all i need to do is just point the domain to the correct ip and can get jojocms installed without entering database details.
any idea?
tia.
I can't share the code for this sorry, it's not mine to share and it was *very* specific to the server that it was running on (not cpanel).
If you were interested in creating your own script, I could give you a list of things that need to be done.
The Jojo side of things is pretty easy - you need to get your script to create the Jojo config file, then open www.domain.com/setup/
The hard part is scripting the creation of everything else (database, database user, virtual host, folders + permissions etc)
<?php
/* Database Connection */
define('_DBHOST', 'localhost');
define('_DBUSER', 'dbuser');
define('_DBPASS', 'dbpass');
define('_DBNAME', 'database');
/* Directory locations */
define('_BASEDIR', '/home/jojo/trunk/');
define('_WEBDIR', dirname(__FILE__));
/* Debug Options - not recommended for production installations */
define('_DEBUG', true);
/* Master password */
define('_MASTERPASS', 'passwd');
/* Admin root */
define('_ADMIN', 'admin');
$table_prefix = ereg_replace('^(www\.)', '', $_SERVER['HTTP_HOST']);
$table_prefix = ereg_replace('\.', '', $table_prefix);
define('_TBLPREFIX', $table_prefix . '_');
define('_MYSITEDIR', '/home/sites/' . $table_prefix);
Point all the virtual hosts at the same folder with index.php, .htaccess, and this config.php.
To create a new site create the '/home/sites/' . $table_prefix folder for jojo to put its downloads, cache etc. and then hit http://new.site.example.com/setup and jojo with create all the tables and other files that it needs.
If you want to have all the sites share a common themes or plugins folder then set
define('_THEMEDIR', '/home/sites/commonthemes');
define('_PLUGINDIR', 'home/sites/plugins');
I've not actually tried this so YMMV but the theory is good :-) Replace folder names as appropriate and would like to know how it goes.
- Mike
12 May 2009
Posts: 44
i change few bits:
//..... only changed line .....//
$table_prefix1 = ereg_replace('^(www\.)', '', $_SERVER['HTTP_HOST']);
$table_prefix = ereg_replace('\.', '', $table_prefix1);
define('_TBLPREFIX', $table_prefix . '_');
define('_MYSITEDIR', '/home/sites/' . $table_prefix1);
// so that the folders looks better in my eyes...//
then run http://website/setup
and got this:
Executing plugin code
Jojo will now scan through each plugin and look for changes that have been made to the database structure. If changes need to be made, the option to "fix" will be available, and in most cases we recommend you do this.
Jojo_Plugin_Jojo_Article: Regenerating HTML cache for Articles
Jojo_Plugin_Jojo_Tags: Regenerating tags for articles
SHOW COLUMNS FROM `polarisnozonenetcom_polarisnozonenetcom_article` Table 'polaris_jojosite.polarisnozonenetcom_polarisnozonenetcom_article' doesn't existarray(3) { [0]=> array(6) { ["file"]=> string(68) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/setup.php" ["line"]=> int(315) ["function"]=> string(11) "selectQuery" ["class"]=> string(4) "Jojo" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> &string(47) "SHOW COLUMNS FROM {polarisnozonenetcom_article}" } } [1]=> array(4) { ["file"]=> string(67) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/jojo.php" ["line"]=> int(48) ["args"]=> array(1) { [0]=> string(68) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/setup.php" } ["function"]=> string(7) "require" } [2]=> array(4) { ["file"]=> string(59) "/hsphere/local/home/polaris/polaris.nozonenet.com/index.php" ["line"]=> int(36) ["args"]=> array(1) { [0]=> string(67) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/jojo.php" } ["function"]=> string(12) "require_once" } }
and when opening http://website i got this:
Redirect Loop
Firefox has detected that the server is redirecting the request for this address in a way that will never complete.
The browser has stopped trying to retrieve the requested item. The site is redirecting the request in a way that will never complete.
* Have you disabled or blocked cookies required by this site?
* NOTE: If accepting the site's cookies does not resolve the problem, it is likely a server configuration issue and not your computer.
nb.
a normal installs works flawlessly with same folder structures.
12 May 2009
Posts: 44
Try adding
$tblname = str_replace(_TBLPREFIX, '', $tblname);
at line 297
13 May 2009
Posts: 44
second site setup give me this:
SHOW COLUMNS FROM `b2indonet_polarisnozonenetcom_article` Table 'polaris_jojosite.b2indonet_polarisnozonenetcom_article' doesn't existarray(3) { [0]=> array(6) { ["file"]=> string(68) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/setup.php" ["line"]=> int(316) ["function"]=> string(11) "selectQuery" ["class"]=> string(4) "Jojo" ["type"]=> string(2) "::" ["args"]=> array(1) { [0]=> &string(47) "SHOW COLUMNS FROM {polarisnozonenetcom_article}" } } [1]=> array(4) { ["file"]=> string(67) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/jojo.php" ["line"]=> int(48) ["args"]=> array(1) { [0]=> string(68) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/setup.php" } ["function"]=> string(7) "require" } [2]=> array(4) { ["file"]=> string(59) "/hsphere/local/home/polaris/polaris.nozonenet.com/index.php" ["line"]=> int(36) ["args"]=> array(1) { [0]=> string(67) "/hsphere/local/home/polaris/master/jojocms-1.0rc1/includes/jojo.php" } ["function"]=> string(12) "require_once" } }
how come first site table prefix gets appended there.
13 May 2009
Posts: 44
14 May 2009
Posts: 44
now http://website/setup gives me error 404
?)
eg www.domain.com/setup-instructions/
I'm sure a better fix is out there, but for now there is a good reason for that change.
14 May 2009
Posts: 44
everything ok. tnx a zillion.
now that it works, what should we consider with this setup?
i know the database will be much more busier.
that one thing for sure.
what else?
security issue? anything?
will this make it to rc2 anytime soon?
tnx again!
if (strtolower(trim($_REQUEST['uri'], '/')) == 'setup') {
// Run setup stuff here
}
Wouldn't that work? that would stop 'instructions/setup/' etc from being caught up in the mix. But it relies on having the htaccess file there first.
I agree that setup should work regardless of whether there is a trailing slash or not.
19 May 2009
Posts: 44
all website running and admin look ok too.
but today, out of curiosity i run http://website/setup/ again
and it gives me:
Table fielddata column fd_flags exists but is different to expected - resolve this manually.
Found: `fd_flags` text collate latin1_general_ci NOT NULL
Expected: `fd_flags` text NOT NULL DEFAULT ''
SQL: ALTER TABLE fielddata CHANGE `fd_flags` `fd_flags` text NOT NULL DEFAULT '';
and a 'fix' button.
i click on the fix button and it gives:
Running SQL: ALTER TABLE fielddata CHANGE `fd_flags` `fd_flags` text NOT NULL DEFAULT '';
ALTER TABLE fielddata CHANGE `fd_flags` `fd_flags` text NOT NULL DEFAULT ''; Table 'polaris_jojosite.fielddata' doesn't exist
problem persist.
but all website and admin still function as if nothing happen.
1 Jul 2009
Posts: 44
but there's still one problem remains:
afaik, the only way to remove the test article is using phpmyadmin??
why is there a test article exist? why just give us empty article?
or a way to easily remove it from the admin?
tia
| Back to Forum Index : Back to Installation |
|
