Cannot enable or disable modules in each site created by multisite module

0000@drupalchina.org - January 26, 2008 - 05:27
Project:Multisite Manager
Version:5.x-0.9-5
Component:Code
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

I got some problem a couple of days ago, I post it in the group but no replys, I try this forum this time, help me pls,thx

Hi everybody,
I set up a drupal 5.6 and add the multisite module for creating many sites for my company. as we don't want to deploy the codes again and again for a simple CMS site.

My problem is I cannot enable or disable modules for the created sites.
Should I place the modules in the DIR sites/all/modules or just in the modules directory? --- I tryed this but nothing differents

I followed this guide: http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/multisite_m...
and it seems to works well. what I did just as this:
My server is Debian sarge.
take a look at the virtual host configurations:

debian-testing:/home/zof/drupal# cat /etc/apache2/sites-available/multi-site
NameVirtualHost *
<VirtualHost *>
        ServerAdmin webmaster@localhost
        ServerName ms.nacta.edu.cn
#       AliasMatch ^/site/\w+/(.*) /home/www-data/multi-site/$2
        DocumentRoot /home/www-data/multi-site
        <Directory /home/www-data/multi-site>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                Order allow,deny
                allow from all
        </Directory>

        ErrorLog /var/log/apache2/ms-error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog /var/log/apache2/ms-access.log combined

AliasMatch ^/site/\w+/index.php /home/www-data/multi-site/index.php
AliasMatch ^/site/\w+/(modules|misc|files|themes|sites)/(.*)$ /home/www-data/multi-site/$1/$2
<Location />
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^home/www-data/multi-site(.*)$ index.php?q=$1 [L,QSA]
  </Location>
<Location /site>
    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/site/
    RewriteCond %{REQUEST_URI} !index.php
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^/home/www-data/multi-site/site/(\w+)(/)?(.*)$ http://ms.nacta.edu.cn/site/$1/index.php?q=$3 [L,QSA]
  </Location>

</VirtualHost>

and in the /home/www-data/multi-site/site/default/settings.php add these codes:
1.$cookie_domain = 'ms.nacta.edu.cn';
2.
  $requri = explode('/', request_uri());
  if (sizeof($requri) >1 && $requri[1]=='site' && $requri[2] != '') {
    $my_site_base = $requri[2];
    #this will be the database shared between the main site and the shared sites
    $db_url = 'mysql://root:123456@localhost/ms';
$db_prefix = array(
     'default'   => $my_site_base.'_',
     'access'    => 'main_',
     'filters'   => 'main_',
     'filter_formats' => 'main_',
     'permission' => 'main_',
     'users'     => 'main_',
     'sessions'  => 'main_',
     'role'      => 'main_',
     'authmap'   => 'main_',
     'sequences' => 'main_',
     //'locales_meta' => 'main_',
     //'locales_source' => 'main_',
     //'locales_target' => 'main_'
   );
   $base_url = "http://ms.nacta.edu.cn/site/$my_site_base";
}

It looks fine, I can creat drupal sites without copy the source codes, but when I entered the Administration of the created sites, I found I cannot enable or disable modules, is there anything I missed?
Please help and thanks in advance.

#1

0000@drupalchina.org - January 26, 2008 - 06:06

I think i figured this out by using domain sub site.
eg:
I have a site as http://somedomain.com/sites/foo
I changed the url to http://foo.somedomain.com/
so it looks works well now.

#2

schuyler1d - February 8, 2008 - 20:49
Status:active» closed

glad you figured it out. I think what was tripping you up was using 'sites'. Since sites is a directory and needs to be accessible URL and file-wise for Drupal to work normally, your site(s) need to be somewhere else. I use 'site' (singular)

Sorry for the delayed response. I was on vacation for three weeks :-)

#3

0000@drupalchina.org - March 3, 2008 - 07:51

That's not the reason, I do use 'site' ('sites' in previous post is a small mistake) in my URL, I think maybe this is a really bug or something else. I met this again and I don't want to make so many sub-domains. what can I do...

#4

0000@drupalchina.org - March 3, 2008 - 07:59

nothing changed while selecting modules but selecting themes works fine, that's really understandable

#5

0000@drupalchina.org - March 3, 2008 - 09:34

I find out why did this happens.
The form action for 'selecting modules' is '/site/somesite/?q=admin/build....'
if I change it to '/site/somesite/index.php?q=admin/build...'
It works fine

but the action of 'theme selecting' form is '/site/somesite/index.php?q=admin/build...'
so it works.

hmm, does anybody knows how to fix this?
I think we can do some work on the rewrite rule, but I'm not good on it.

Maybe just trying to make links like '/site/somesite/?q=node' works and no need to rewrite this to '/site/somesite/index.php?q=node'

someone help me?

#6

0000@drupalchina.org - March 4, 2008 - 00:13
Status:closed» active

I think I should change this 'Status' to 'active' again, right?

#7

schuyler1d - March 4, 2008 - 16:09

We can document this better, but this is an apache issue. Rewrite rules don't work well with DirectoryIndex defaults. You should either just go to clean URLs so
site/somesite/index.php?q=admin/build
is seen as this:
site/somesite/admin/build
and never seen as this:
site/somesite/?q=admin/build

Also, you might try the more simple rewrite rules I made for the .htaccess file (download the newest version) instead of the alias stuff (not that that eliminates using DirectoryIndex)

#8

0000@drupalchina.org - March 11, 2008 - 01:07
Status:active» closed

Thank you, and my project works difficulty after I did some hack on the source code ( I know this is bad ), I will test this on another testing environment.

thank you very much!

#9

schuyler1d - March 14, 2008 - 16:36

What did you change? I'd love to incorporate it in the release, if it was to my module (or your htaccess rules).

 
 

Drupal is a registered trademark of Dries Buytaert.