A little puzzled.

Events happening in the community are now at Drupal community events on www.drupal.org.
wjaspers's picture

I'm using a WAMP stack and the most recent Acquia Drupal 6.19 distribution.
In my Apache instance, I've setup multiple alias' for subdirectories that are part of my Drupal multi-site instance.

What I can't seem to figure out, is why I can't login to one of the added sites and enable modules specifically placed in that instance!

For instance, in "drupal/sites/all/modules", I have Rules and Workflow.
In "drupal/sites/webserver.jobs/modules", I have Job_Posting.

I have a common Acquia Drupal 6.19 installation, and 6 sub-sites defined in my "drupal/sites" folder. Each installed fine, but I can't configure them individually. My users, sessions, roles, and authmap tables and login cookie are all shared, but they shouldn't (at least from what I've read) affect this ability.

Any tips? Thanks for your help!

Comments

Your modules

joyseeker's picture

All of the modules go into sites/all/modules. The only thing in the subdirectories should be a settings.php (and possibly any files you upload on the added site). The sym link (your alias?) shows Drupal how to access all the modules in the sites/all/modules directory.

With all the modules in sites/all/modules, then you can log on each added site and choose your modules.

I guess I've been a little

wjaspers's picture

I guess I've been a little spooked by the idea. I don't recall what example I saw that showed each site having its own "modules/" directory, but this at least clears the air.

When I login, and go to "http://<myserver>/<subsite>/admin/build/modules", I get redirected to: "http://<myserver>/admin/build/modules/list". This is suggestive that whatever modules I enable are ONLY for the default site, which I don't want. ... Even the site name changes back to the default site. How can I avoid this?

One problem trying to create a symbolic link. ... My test environment is on a WIN32 (Windows Server 2008) stack.

Modules per site

druderman's picture

You certainly can have modules per site.
This is perfectly legit.

sites/all/modules - shared
sites//modules - available to one site
sites//modules - available to one site

If you cannot see the modules listed in a subsite, I'd guess that maybe your subsite is not configured correctly.
Drupal dispatches the request by looking down a list until it finds a matching site.
So if the subsite is not found, it goes to the default site which in your case doesn't have the site-specific modules available.

Go to /admin/settings/site-information and see if you see different info for the Default and each subsite.
If not, then you should see why the subsite is not being found by Drupal.

Does Drupal issue any data if

wjaspers's picture

Does Drupal issue any data if a site is not found? Should I at least see a header? or does it just exit?

It doesn't matter what instance I log in to, everything "admin/" goes back to the default site.

I've tried a variety of methods to setup virtual hosts that should respond to different sites, but none of them work. I've at least accomplished getting Windows Server 2008 to respond to "<site1>.webserver1" in terms of network resolution, but apache seems unable to spot requests to: "http://<site1>.webserver1" or the FQDN: "http://<site1>.webserver1.<mycompany>.local".

(Note the FQDN ends in .local; meaning there's no configured TLD on my company's domain controller).

Well, I got it working on

wjaspers's picture

Well, I got it working on non-standard port numbers. But now, the individual sites (by port) don't want to install.
I'm trying to share the tables:

<?php
$db_prefix
= array(
 
'users' => 'd6_main.',
 
'sessions' => 'd6_main.',
 
'role' => 'd6_main.',
 
'authmap' => 'd6_main.',
 
'users_roles' => 'd6_main.',
 
'access' => 'd6_main.',
);
?>

When I go to the sub-site to set it up, I get database warnings instead.
Warning: Table 'd6_jobs.cache' doesn't exist query: SELECT data, created, headers, expire, serialized FROM cache WHERE cid = 'variables' in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'd6_jobs.variable' doesn't exist query: SELECT * FROM variable in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'd6_jobs.cache' doesn't exist query: UPDATE cache SET data = '', created = 1290017824, expire = 0, headers = '', serialized = 0 WHERE cid = 'variables' in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'd6_jobs.system' doesn't exist query: SELECT name, filename, throttle FROM system WHERE type = 'module' AND status = 1 AND bootstrap = 1 ORDER BY weight ASC, filename ASC in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'd6_jobs.url_alias' doesn't exist query: SELECT COUNT(pid) FROM url_alias in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

It's almost as if Drupal is treating these sub-sites as "already installed". But I can't figure out why.

If I go directly to the subsite's install.php (http://<myserver>:81) I get bombarded by errors:

Warning: Table 'sessions' already exists query: CREATE TABLE d6_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 DEFAULT NULL, PRIMARY KEY (sid), INDEX timestamp (timestamp), INDEX uid (uid) ) /!40100 DEFAULT CHARACTER SET UTF8 */ in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'access' already exists query: CREATE TABLE d6_main.access ( aid INT NOT NULL auto_increment, mask VARCHAR(255) NOT NULL DEFAULT '', type VARCHAR(255) NOT NULL DEFAULT '', status TINYINT NOT NULL DEFAULT 0, PRIMARY KEY (aid) ) /
!40100 DEFAULT CHARACTER SET UTF8 / in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'authmap' already exists query: CREATE TABLE d6_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 C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'role' already exists query: CREATE TABLE d6_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 C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'users' already exists query: CREATE TABLE d6_main.users ( uid INT unsigned NOT NULL auto_increment, 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 '', signature_format SMALLINT NOT NULL DEFAULT 0, 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 DEFAULT NULL, PRIMARY KEY (uid), UNIQUE KEY name (name), INDEX access (access), INDEX created (created), INDEX mail (mail) ) /
!40100 DEFAULT CHARACTER SET UTF8 / in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Table 'users_roles' already exists query: CREATE TABLE d6_main.users_roles ( uid INT unsigned NOT NULL DEFAULT 0, rid INT unsigned NOT NULL DEFAULT 0, PRIMARY KEY (uid, rid), INDEX rid (rid) ) /
!40100 DEFAULT CHARACTER SET UTF8 */ in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Duplicate entry '' for key 'name' query: INSERT INTO d6_main.users (name, mail) VALUES('', '') in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Duplicate entry '1' for key 'PRIMARY' query: UPDATE d6_main.users SET uid = 1 WHERE name = 'placeholder-for-uid-1' in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Duplicate entry 'anonymous user' for key 'name' query: INSERT INTO d6_main.role (name) VALUES ('anonymous user') in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: Duplicate entry 'authenticated user' for key 'name' query: INSERT INTO d6_main.role (name) VALUES ('authenticated user') in C:\webroot\vhostdocs\drupal\includes\database.mysql.inc on line 128

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\webroot\vhostdocs\drupal\includes\database.mysql.inc:128) in C:\webroot\vhostdocs\drupal\includes\bootstrap.inc on line 1162

Warning: Cannot modify header information - headers already sent by (output started at C:\webroot\vhostdocs\drupal\includes\database.mysql.inc:128) in C:\webroot\vhostdocs\drupal\includes\bootstrap.inc on line 726

Warning: Cannot modify header information - headers already sent by (output started at C:\webroot\vhostdocs\drupal\includes\database.mysql.inc:128) in C:\webroot\vhostdocs\drupal\includes\bootstrap.inc on line 727

Warning: Cannot modify header information - headers already sent by (output started at C:\webroot\vhostdocs\drupal\includes\database.mysql.inc:128) in C:\webroot\vhostdocs\drupal\includes\bootstrap.inc on line 728

Warning: Cannot modify header information - headers already sent by (output started at C:\webroot\vhostdocs\drupal\includes\database.mysql.inc:128) in C:\webroot\vhostdocs\drupal\includes\bootstrap.inc on line 729

I am trying to share my cookie domain if that could be the culprit?

Subsite

druderman's picture

Yup, it seems like it's still looking at your default site, but recognizing the sub site url.
I haven't shared tables, so I'm not gonna advise you on that.

I did think that putting Drupal under Windows server was not suggested - probably because of the dependence on apache things .htacess and URL rewrites.

I use apache.
For me, I have domain example.com and sites example.com/sub1 and example.com/sub2.
In my sites directory I have these directories for the sites.

sites/all
sites/default
sites/example.com.sub1
sites/example.com.sub2

Plus I have symlinks which are not required and are more of a convenience.
sites/sub1 -> example.com.sub1
sites/sub2 -> example.com.sub2

This is at the end of my drupal .htaccess file

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/sub1/(.)$
RewriteRule ^(.
)$ /sub1/index.php?q=$1 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^/sub2/(.)$
RewriteRule ^(.
)$ /sub2/index.php?q=$1 [L,QSA]

And this is included in my httpd.conf file

Alias /sub1 /var/www/drupal
Alias /sub1 /var/www/drupal

That's what doesn't make

wjaspers's picture

That's what doesn't make sense.
On multiple virtual containers, the installs ran fine, but I didn't have access to the subsites' modules.
On a single virtual container, the first install succeeds, and the subsites fail.

I realize an N-nix box is most appropriate here; but my company didn't give me a 'nix box to develop on.
My site(s) need to be developed on what I have, and later rolled over to a public server.

What's really strange, is I got all my DB's setup in Acquia yesterday; but ran into so many problems I started over...

The whole raison d'être of

mile23's picture

The whole raison d'être of the multisite setup is so that drupal can make the decision about which site to show. So when you say:

"In my Apache instance, I've setup multiple alias' for subdirectories that are part of my Drupal multi-site instance."

...this sets off alarms, because you want everything to point to drupal/, and not drupal/site/whatever.com. Then drupal can look at the host name and path and try to deduce which site directory gets the nod.

Also, you say: "In "drupal/sites/webserver.jobs/modules", I have Job_Posting." What is webserver.jobs? Look in drupal/sites/default/default.settings.php. It gives you a run-down of how the domain and path will be parsed into a folder name. I doubt webserver.jobs is going to be a valid sub-site folder name. If drupal can't match the name, it defaults to sites/default, which would lead to your being unable to configure webserver.jobs individually.

Hope this helps. :-)

I realize that.

wjaspers's picture

I realize that. "webserver.jobs" is the BASE_URL + a subdirectory. ... (i.e. if my server URL is http://webserver, I want an instance at http://webserver/jobs). I have no trouble creating the "settings.php" files. The problem falls on name resolution with a Win32 stack. If anyone REALLY bothers to read all of this, YES, the machine I'm developing on is unfortunately: WINDOWS.

Multisite

Group organizers

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: