Drupal Multisite Installation (warnings)
am 29.09.2007 - 17:54 Uhr in
Ich versuche mich gerade an einer Multisite installation.
Erstellt werden soll eine Hauptseite und eine Nebenseite unter einer Subdomain wobei beide die Usertabellen teilen.
Ich habe eine Haupt installation mit dem Datenbank Präfix main_ unter domain.de (in root/site/domain/)
Dazu kommen soll die subdomain.domain.de mit Präfix art_
Den Ordner root/site/domain/sites/subdomain.domain.de/ habe ich angelegt und eine settings.php mit diesem Inhalt darin abgelegt
$db_url = 'mysql://xxxxx:xxxxx@localhost/xxxxxx';
$db_prefix = array(
'default' => 'art_',
'users' => 'main_',
'sessions' => 'main_',
'role' => 'main_',
'authmap' => 'main_',
'sequences' => 'main_',
'profile_fields' => 'main_',
'profile_values' => 'main_',
'users_roles' => 'main_',
);
ini_set('arg_separator.output', '&');
ini_set('magic_quotes_runtime', 0);
ini_set('magic_quotes_sybase', 0);
ini_set('session.cache_expire', 200000);
ini_set('session.cache_limiter', 'none');
ini_set('session.cookie_lifetime', 2000000);
ini_set('session.gc_maxlifetime', 200000);
ini_set('session.save_handler', 'user');
ini_set('session.use_only_cookies', 1);
ini_set('session.use_trans_sid', 0);
ini_set('url_rewriter.tags', '');
$cookie_domain = 'domain.de';
Die Subdomain.domain.de zeigt genauso wie domain.de auf die Hauptinstallation (root/site/domain/)
Wenn ich jetzt unter subdomain.domain.de/install.php die zusätzlichen Datenbanken erstellen will, bekomme ich eine Reihe von Warnings die mich etwas irritieren:
Warning: Table 'main_authmap' already exists query: CREATE TABLE main_authmap ( aid int unsigned NOT NULL auto_increment, uid int NOT NULL default '0', authname varchar(128) NOT NULL default '', module varchar(128) NOT NULL default '', PRIMARY KEY (aid), UNIQUE KEY authname (authname) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /www/htdocs/xxxxxxxx/site/xxxx/includes/database.mysql.inc on line 172
Warning: Table 'main_role' already exists query: CREATE TABLE main_role ( rid int unsigned NOT NULL auto_increment, name varchar(64) NOT NULL default '', PRIMARY KEY (rid), UNIQUE KEY name (name) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Table 'main_sessions' already exists query: CREATE TABLE main_sessions ( uid int unsigned NOT NULL, sid varchar(64) NOT NULL default '', hostname varchar(128) NOT NULL default '', timestamp int NOT NULL default '0', cache int NOT NULL default '0', session longtext, KEY uid (uid), PRIMARY KEY (sid), KEY timestamp (timestamp) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Table 'main_sequences' already exists query: CREATE TABLE main_sequences ( name varchar(255) NOT NULL default '', id int unsigned NOT NULL default '0', PRIMARY KEY (name) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Table 'main_users' already exists query: CREATE TABLE main_users ( uid int unsigned NOT NULL default '0', name varchar(60) NOT NULL default '', pass varchar(32) NOT NULL default '', mail varchar(64) default '', mode tinyint NOT NULL default '0', sort tinyint default '0', threshold tinyint default '0', theme varchar(255) NOT NULL default '', signature varchar(255) NOT NULL default '', created int NOT NULL default '0', access int NOT NULL default '0', login int NOT NULL default '0', status tinyint NOT NULL default '0', timezone varchar(8) default NULL, language varchar(12) NOT NULL default '', picture varchar(255) NOT NULL DEFAULT '', init varchar(64) default '', data longtext, PRIMARY KEY (uid) in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Table 'main_users_roles' already exists query: CREATE TABLE main_users_roles ( uid int unsigned NOT NULL default '0', rid int unsigned NOT NULL default '0', PRIMARY KEY (uid, rid) ) /*!40100 DEFAULT CHARACTER SET UTF8 */ in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Duplicate entry '0' for key 1 query: INSERT INTO main_users (uid,name,mail) VALUES(0,'','') in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Duplicate entry '1' for key 1 query: INSERT INTO main_role (rid, name) VALUES (1, 'anonymous user') in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: Duplicate entry '2' for key 1 query: INSERT INTO main_role (rid, name) VALUES (2, 'authenticated user') in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxx/includes/bootstrap.inc on line 862
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/bootstrap.inc on line 531
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/bootstrap.inc on line 532
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/bootstrap.inc on line 533
Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/bootstrap.inc on line 534
Drupal installation complete
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
* user warning: Table 'xxxxx.art_system' doesn't exist query: SELECT name, filename, throttle FROM art_system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: SELECT data, created, headers, expire FROM art_cache_menu WHERE cid = '1:en' in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: LOCK TABLES art_cache_menu WRITE in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: UPDATE art_cache_menu SET data = 'a:4:{s:10:\"path index\";a:0:{}s:5:\"items\";a:2:{i:0;a:5:{s:4:\"path\";s:0:\"\";s:5:\"title\";s:0:\"\";s:4:\"type\";i:1;s:3:\"pid\";i:1;s:8:\"children\";a:1:{i:0;i:1;}}i:1;a:6:{s:3:\"pid\";i:0;s:4:\"path\";s:0:\"\";s:5:\"title\";s:10:\"Navigation\";s:6:\"weight\";i:-50;s:6:\"access\";b:1;s:4:\"type\";i:3;}}s:9:\"callbacks\";a:0:{}s:7:\"visible\";a:2:{i:1;a:5:{s:5:\"title\";s:10:\"Navigation\";s:4:\"path\";s:0:\"\";s:8:\"children\";a:0:{}s:4:\"type\";i:3;s:3:\"pid\";i:0;}i:0;a:4:{s:5:\"title\";s:0:\"\";s:4:\"path\";s:0:\"\";s:8:\"children\";a:1:{i:0;i:1;}s:4:\"type\";i:1;}}}? in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
* user warning: Table 'xxx.art_watchdog' doesn't exist query: INSERT INTO art_watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'page not found', 'node', 1, '', 'http://subdomain.domain.de/', '', '84.174.89.179', 1191083384) in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
* user warning: Table 'xxx.art_system' doesn't exist query: SELECT name, filename, throttle FROM art_system WHERE type = 'module' AND status = 1 ORDER BY weight ASC, filename ASC in /www/htdocs/xxx/site/xxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: SELECT data, created, headers, expire FROM art_cache_menu WHERE cid = '1:en' in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: LOCK TABLES art_cache_menu WRITE in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* user warning: Table 'xxx.art_cache_menu' doesn't exist query: UPDATE art_cache_menu SET data = 'a:4:{s:10:\"path index\";a:0:{}s:5:\"items\";a:2:{i:0;a:5:{s:4:\"path\";s:0:\"\";s:5:\"title\";s:0:\"\";s:4:\"type\";i:1;s:3:\"pid\";i:1;s:8:\"children\";a:1:{i:0;i:1;}}i:1;a:6:{s:3:\"pid\";i:0;s:4:\"path\";s:0:\"\";s:5:\"title\";s:10:\"Navigation\";s:6:\"weight\";i:-50;s:6:\"access\";b:1;s:4:\"type\";i:3;}}s:9:\"callbacks\";a:0:{}s:7:\"visible\";a:2:{i:1;a:5:{s:5:\"title\";s:10:\"Navigation\";s:4:\"path\";s:0:\"\";s:8:\"children\";a:0:{}s:4:\"type\";i:3;s:3:\"pid\";i:0;}i:0;a:4:{s:5:\"title\";s:0:\"\";s:4:\"path\";s:0:\"\";s:8:\"children\";a:1:{i:0;i:1;}s:4:\"type\";i:1;}}}? in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
* user warning: Table 'xxxx.art_watchdog' doesn't exist query: INSERT INTO art_watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (1, 'page not found', 'node', 1, '', 'http://subdomain.domain.de/', '', '84.174.89.179', 1191083392) in /www/htdocs/xxxxx/site/xxxxx/includes/database.mysql.inc on line 172.
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
* warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/xxxxx/site/xxx/includes/database.mysql.inc:172) in /www/htdocs/xxxxx/site/xxxxx/includes/common.inc on line 141.
Wo liegt der Fehler?! SInd die Meldungen über die schon existierenden Tabellen normal? Dachte drupal würde das bei einer Multisite installation berücksichtigen und einfach die shared Tables erst garnicht versuchen zu installieren.
Kann mir nicht so ganz vorstellen dass das normal ist. Auf den ersten blick scheint die Multi installation aber zu laufen.
- Anmelden oder Registrieren um Kommentare zu schreiben
shared Users für Mulisite-Umgebung
am 02.10.2007 - 13:20 Uhr
Vorgehen:
1.) jede Site seperat installieren (ganz normal, also hat jede Site erst mal eigene User)
2.) nicht benötigte User Tabellen wegwerfen
3.) die jetzt fehlenden Tabellen als Views einbinden
mysql> use db-site-ohne-user; // mit dem richigen Site-Namen ersetzen
mysql> drop table users; // in Deinem Beispiel jeweils mit Prefix!
mysql> CREATE VIEW users AS
mysql> SELECT *
mysql> FROM master.users
mysql> WHERE uid IN (
mysql> SELECT uid
mysql> FROM somedatabase.sometable // holen der tatsächlichen User aus der ggf. anderen Datenbank; in Deiner Umgebung ohne 'somedatabase.'
// sometabel = prefix und users z.B. www_users
mysql> WHERE uid = 0
mysql> OR label = 'foo'
mysql> )
Drupal wird die virtuelle tabelle arts_user wie eine real existierende behandeln.
(Drupal braucht den user 0)
mehr zu views -> mySQL -Handbuch.
bin leider die nächsten Tage offline, hoffe dass bei Bedarf jemand aus dem Forum hilft.
Grüße
Thomas
Thomas Zahreddin
Schonmal Danke
am 07.10.2007 - 02:38 Uhr
Hi Thomas,
also ich hab von SQL befehlen keine ahnung, werde mich aber mal in einer Testungebung an deinem Post orientieren und schauen ob ich es hinbekomme.
Aber:
Warum bekomme ich diese Warnings. Da ich nach der Standart beschreibung einer Multi installation mit User sharing vorgegangen bin, gehe ich mal davon aus das eigentlich alles reibungslos ablaufen sollte.
Hier gibt es ja ein paar leute die schon mal eine Multidomain installation mit User Sharing installiert haben. Scheinbar haben diese Persohnen keine der Oben genannten Meldungen bekommen. Eventuell kann sich da ja jemand zu äußern.
Sind diese Warnings wirklich kritisch oder sagen sie nur das die entsprechenden Datenbank einträge schon vorhanden sind (und ich kann sie ohne bedenken igborieren auch wenn sie vielleicht nicht kommen sollten)? Wie gesagt, auf den ersten blick scheint es für mich zu laufen.
Gruß
Holger