I've run a single install of Drupal since 4.6.x release and have been quite happy with it. Now at work they are looking into social software (specifically multiple blogs) and I suggested they use Drupal. Based on their needs we would be looking at multiple installs.
I've set up a basic 5.0 install to show the people who make the descisions the basics and informed them that we could do "sub" installs. I wa sthen tasked to set up the test version to have multiple sub versions.
The web server that has the test version (and the one that will be live) will have drupal as one of the sites hosted. The url is along the lines of : http://server.our.internal.domain/drupal.
I'm trying to get http://server.our.internal.domain/drupal/test1 to work. I've tried everything i can think off (including trying virtual servers in Apache, something we can't do for the live version) but so far the furthest I've come is a Drupal error page ("page not found"). I assume the page not found means that the url re-writing is working to an extent.
What I've done so far:
In the "sites" directory I now have 4 sub directories:
default
all
server.our.internaldomain
server.our.internaldomain.test1
Both the server.our.internal.domain* direcotries only have a settings.php (copied from default)
server.our.internaldomain settings.php (main changes):
$db_url = 'mysql://drupaldb:drupalpw@localhost/drupal';
$db_prefix = 'drupal_';
$base_url = 'http://server.our.internaldomain/drupal'; // NO trailing slash!
server.our.internaldomain.test1 settings.php (main changes):
$db_url = 'mysql://drupaldb:drupalpw@localhost/drupal';
//$db_prefix = 'drupal_';
$db_prefix = array(
'default' => 'center1_',
'users' => 'drupal_',
'sessions' => 'drupal_',
);
$base_url = 'http://server.our.internaldomain/drupal/test1'; // NO trailing slash!
.htaccess in /drupal:
RewriteBase /drupal
# Rewrite old-style URLs of the form 'node.php?id=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^id=([^&]+)$
#RewriteRule node.php index.php?q=node/view/%1 [L]
# Rewrite old-style URLs of the form 'module.php?mod=x'.
#RewriteCond %{REQUEST_FILENAME} !-f
#RewriteCond %{REQUEST_FILENAME} !-d
#RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
#RewriteRule module.php index.php?q=%1 [L]
# Rewrite current-style URLs of the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Anyone have any suggestions?
thanx
Comments
No one have a suggestion? :(
No one have a suggestion? :(
Yes
Your $db_prefix variable for the test site seems strange to me. Are you sure setting it to an array will work?
I would have though you would want something like this
$db_prefix = 'test1_';The name of the variable "db_prefix" can be misleading. It actually has nothing to do with the DB selection but is a table prefix. It allows you to keep all the tables for several websites/domains in one mysql-DB by prepending a prefix to all the tables. I.e. the tables for the normal/default site will all be named default_* and the test site tables will all be named test1_*.Apologies if you knoiw all this already. This is just something that I know I had problems with earlier.
Another thing. Have you considered using subdomains? Instead of putting you test site in a subdirectory so that you have http://server.our.internal.domain/drupal/test1 you could create a test1 subdomain and have somethiong like this http://test1.server.our.internal.domain/drupal or even http://test1.internal.domain/drupal
I've tried both solutions and have found the subdomain method easier to setup.
Copied from the default
Copied from the default settings.php:
* To have all database names prefixed, set $db_prefix as a string:
*
* $db_prefix = 'main_';
*
* To provide prefixes for specific tables, set $db_prefix as an array.
* The array's keys are the table names and the values are the prefixes.
* The 'default' element holds the prefix for any tables not specified
* elsewhere in the array. Example:
*
* $db_prefix = array(
* 'default' => 'main_',
* 'users' => 'shared_',
* 'sessions' => 'shared_',
* 'role' => 'shared_',
* 'authmap' => 'shared_',
* 'sequences' => 'shared_',
* );
I've since added all these to my test1 settings.php, but still no luck. As for switching to subdomains, as I don't control the DNS for our company it would be a pain to maintain sub domains for tbhis instalation, hence why I'm using the sub dir version :(
symlinks?
Unclear what your environment is (WAMP, LAMP etc?) but how did you set up the symbolic links that point from subsite directory to codebase? Perhaps that's the trouble - incorrect or missing symlinks are most often the cause of 'page not found' in this multisite scenario, in my LAMP experience.
Nope I didn't...but then the
Nope I didn't...but then the docs I saw never mentioned it! I'll try it and let you know...thanx!
(oo btw.. it's a LAMP environment)