Hello Everyone.
I install drupal in the root's subfolder called main eg. /var/www/html/main. I am making all new sites available at /site/{shortname}/
My problem is getting the Multisite Manager to work. I've spent the whole week trying to make it work to no avail. Drupal itself seem to be working just fine.
Here are some FACTS.
1) I can successfully create a new site with the multisite manager. In my example. A database also gets created.
2) Then I manually create a directory 'site1' under /site/ so it looks like this: /site/site1.
3) When I try accessing it I returns a 403 Forbidden
Forbidden You don't have permission to access /main/site/site1/ on this server. NOTE: it has nothing to do with 'site1' permissions.
CODE FOR APACHE CONFIG:
<VirtualHost *:80>
AliasMatch ^/site/\w+/(.*) /var/www/html/main/$1
DocumentRoot /var/www/html/main/
</VirtualHost>
CODE IN YOUR ./sites/default/settings.php
### Seetings to Multisite Manager ######
$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://username:password@localhost/database';
$db_prefix = $my_site_base."_";
$base_url = "http://localhost/main/site/$my_site_base"; // NO trailing slash!
}
CODE IN .HTACCESS FILE:
# Various rewrite rules.
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /main
# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
Can my problem be the .HTACCESS FILE ABOVE? Please help I am running out of ideas!
IMPORTANT: Drupal and Multisite Manager works without issues at the root level (/var/www/html/). It becomes a problem only when drupal is installed under a subfolder /var/www/html/main. But my employer wants me to move it up to its own subfolder.
Thank you
Cec
Comments
1st: apache config files are
1st: apache config files are no php files.
2nd:
AliasMatch ^/site/w+/(.*) /var/www/html/main/$1seems wrong, tryAliasMatch ^/site/w+ /var/www/html/mainApache config file are not
Apache config file are not php files, you are correct. I accidentally left the php tags on this post.
I tried your suggestion(below), restarted apache but no luck.
AliasMatch ^/site/w+ /var/www/html/mainCan you think of anything else I am doing wrong?
Thanks
Cec
Switch on debugging. What
Switch on debugging. What does it log? Does it find index.php?
i know this sounds dumb but
i know this sounds dumb but how do i turn on debugging? any example?
http://httpd.apache.org/docs/
http://httpd.apache.org/docs/2.2/mod/core.html#loglevel
Btw, I've reread your problem description. Your AliasMatch will not work, if there is no index.php (and other stuff) in that place. Try http://drupal.org/getting-started/6/install/multi-site, esp. section "Subdirectory multi-site".
how will upgrading work?
got it working following online documentation.
Since each new site created using requires its own database, when its time to upgrade how will the upgrade work?
Will you have to upgrade all the sub-sites separately? This will not be feasible if you have large number of sites(say 500 subsites).
Can anyone explain how it will work?
Thanks
Ceci