i have a single drupal site running on a win2003 server with xampp. it's the first time i've tried drupal and i'm loving it. i dumped the drupal folder under xampp's htdocs directory so i can browse to it via the url 127.0.0.1/drupal
i need to have several drupal sites, each under a separate subdirectory (as opposed to subdomains)- 127.0.0.1/drupal/site1, 127.0.0.1/drupal/site2 etc.
i am running this on my personal computer now for testing purposes and i don't have a domain name or even a fixed IP address yet. if all works out, we plan to use drupal for all the student clubs and organization websites for our university- single drupal installations with multiple mysql databases.
how do I go about achieving this? the install instruction does talk a little about setting up multiple sites in multiple directories but I can't quite understand how to implement it in my case. i've created a folder called "new" alongside the "default" folder under "sites" with a different settings.php file that references to a different database but browsing to 127.0.0.1/drupal/new obviously didn't work. it takes me to the 404 page i specified for the default drupal site.
any help would be greatly appreciated.
Comments
Have a look at
http://drupal.org/node/66657
I think that is that you are asking for.
Keep the sunny side up
Thomas Narres
Keep the sunny side up
no luck yet
@narres:
One of the comment in the page you pointed to makes it very clear.
However, I cannot set it up as shown in the example above because I don't have a domain registered or even a fixed IP. I tried naming the folder to all of the following but these don't seem to work either:
i should mention that i have
i should mention that i have clean urls turned on and working. i am not an expert on apache.. but i am thinking i need to tell apache/drupal to make an expection when the /drupal/new url is requested- to not look for this url within the default drupal site (that's why it's returning the 404 page i specified in the default installation). maybe some fancy rewrite/alias rules is what's needed. just speculating.. any ideas?
thanks
sean
127.0.0.1 = localhost
Did you try with domain localhost.
I cannot try, cause I have only public and no local servers ;)
Thomas Narres
Keep the sunny side up
tried that.. but still the
tried that.. but still the same problem- a 404 page from drupal.
HOST file
you could probably put it in the HOST so you could use any domain name you wanted (for testing) and instead of looking it up in the global DNS it would find it in your local HOST file and send it to your Apache. Just a thought, I think that should work.
for example
fredsmith.com 192.168.1.66
1.66 would be your apache server
Quint
settings.php settings for each sub-folder
If each of the installations in the subdirectories are independent of each other, then you do not need to cater for others in any one sites folder.
- Create the various sub-folders
- Load Drupal files into each of the subfolders (each set of files will have it's own .../sites/default/settings.php)
- In each settings.php file, point to the relevant database for each installation and make sure that you have the complete $baseurl that includes the subfolder fot he installation at hand
* You should be able to access each installation now by calling it's URL (including the folder-name)
Let me know what you get and I can troubleshoot some more.
-----
iDonny - Web Productions: Web Strategy, CMS Design, Branding, & Production
hmm.. not sure if i want to do that
@iDonny:
i don't think I want to run several instances of drupal because for the project i am working on we'll have to have about 20-25 different drupal sites and there are more to be added in the future occasionally. if i understand correctly, updating/upgrading things, and general site management like adding modules etc would be much easier on a single instance instead of 25+ sites.
Multi-site on our intranet
I use the exact setup as yours for our Intranet development. I currently host 5 dev sites, 10 training sites and 25+ departmental sites on one installation of Drupal-4.7.2.
We use the same DNS name for the site (webdev.mchs.com) and all of the sites are directories under a virtual directory named "drupal" so the urls are:
webdev.mchs.com/dev0
webdev.mchs.com/dev1
webdev.mchs.com/dev2
etc. etc. etc.
Apache Setup:
I placed the Drupal directory at "D:/drupaldev/drupal-4.7.2/" so I added this at the bottom of my apache conf file. d:/xampp/apache/conf/http.conf
then I added a file named drupaldev.conf to the /apache/conf directory
...now all of the alias names point to the same location - this is where Drupal takes over.
Under the /sites directory I made 5 copies of the /default dir naming each as follows:
webdev.mchs.com.dev0
webdev.mchs.com.dev1
webdev.mchs.com.dev2
webdev.mchs.com.dev3
webdev.mchs.com.dev4
webdev.mchs.com.dev5
... or in your case
127.0.0.1.site1
127.0.0.1.site1
etc.
Edit the settings.php file in each directory to point to the correct database and you are set to go.
Multi-site on our intranet: part II
To get clean URL's with multi-site I added the following to the .htaccess file
I'm not an mod_rewrite expert so any improvements to this scheme would be appreciated!
thanks!i got multiple sites
thanks!
i got multiple sites running as per your instructions.
clean urls are not working on the subsites though.
i am no good with rewrite rules either.. maybe you could help.
this is what my xampp/htdocs/drupal/sites directory looks like:
(edit: i found that using 127.0.0.1.drupal.new or localhost.drupal.new etc for these folder names doesn't work)
so this gives me
http://my.ip.add.ress/drupal/
http://my.ip.add.ress/drupal/new
http://my.ip.add.ress/drupal/site2
all running on different DBs, which is working swimmingly.
i added this to the .htaccess file under the drupal directory (just below the rewrite rules that were already in there):
when i "run the clean url test" from subsite "new" (eg. http://my.ip.add.ress/drupal/new/admin/settings) it pulls up the admin/settings page for the default site (or an access denied/403 error if i am not logged in to the default site).
i did NOT add a similar rewrite code block for "site2" to the .haccess file. still, http://my.ip.add.ress/drupal/site2/admin/settings leads to the same default admin/settings page. so it appears that the block of code isn't really doing anything.
any idea what i am doing wrong?
thanks again. got a major problem out of the way. clean urls would be really sweet though.
... quick guess
... since you are under the first directory of drupal try appending that to your rewrite conditions.
and remove or comment out the rewrite rules that were already in there.
I'll try to test this later.
i think i tried that.. but i
i think i tried that.. but i didn't comment out the other rewrite rules that came with the default installation. i'll try it again on monday morning. i'm done for the week and i have a strict "no work at home" policy. :)
thanks again.
It works....
... be sure to comment out the rewrite rules that came with the default installation or make sure that your new rules come before.
that's what it was. i
that's what it was. i commented out the previous rules and it seems to be working now.
thanks to jsloan and everybody else for all your help.
I know it's an old post, but
I know it's an old post, but I'd like to say that this solution (after hours of looking through other threads) finally worked for me.
I too wanted my subsites in subdirectories, not subdomains (It's easier to make them come and go during development, and to switch to an overview)
I wanted to use Apache Alias, not symlinks, which are conceptually confusing to use for an entire website content - especially when doing backups. Plus, it was stored on a FAT32 disk :-)
I discovered that Apache Location chunks couldn't help, as they ran AFTER .htaccess files had already done the rewrite.
I couldn't use Directory blocks, as there was no file directory, just an Alias.
I also found that it was hard to scope the RewriteBase. Placing it between RewriteCond and its RewriteRule didn't work.
I was getting success pretty early with Alias - but not with clean URLs - which were returning content from the core site when I requested the page from a subsite.
jsloan's work-around, making the normal rewrite first check if it's in the core directory (the one with the Drupal files in it) and other rewrites do almost the same thing, solved my problem.
The hidden trick is that the Dondition works with the absolute URI, but the Rule immediately follows it is working on the truncated - or relative remaining filepath after the current working directory was trimmed off it. 'Twas confusing for a bit.
my webserver files
my http:
resourcedb is called into existance using apache Alias, and Drupal multisite settings.php
resourcedb is redirected to using jsloans modification to my drupal_5/.htaccess.
I'd like to have found a way to put this directive in the Apache conf instead, but this works and will do.
There are no files and no filesystem tricks for this virtual site, just some conf file things. I'm yet to see where it stores its /files :)
.dan.
How to troubleshoot Drupal | http://www.coders.co.nz/
.dan. is the New Zealand Drupal Developer working on Government Web Standards
You saved my butt with this
You saved my butt with this entry, so giving back:
my subdomains are of the form www.example.com/orN where N is any integer
In .htaccess, BEFORE the standard rewrite rules, insert:
The (or\d+) means "or" followed by any digits so you need to change it to whatever format you plan on using. Your example of dev0, dev1... becomes (dev\d+) or (dev\d) if there will only ever be 9 or less.
It gets substituted for %1 in the next line.
So unlike your rewrite code, only need to write this once.
then in httpd.conf, same as your solution, one of these for every subdomain, so at least only one file needs updating for a new one:
I tried to get "AliasMatch /or\d+$" to work instead of Alias, to make it generic, but got server errors. Nothng useful in the error log, Drove me nuts.
Finally create a sites/www.example.com.or1 directory with /modules, /files, and /themes subdirs as required.
Copy in settings.php and set $base_url in settings.php to www.example.com/or1, or you can set it to
just for one less bit of code to change with each new subdir
I'm workign on a way to have only one settings.php - there is a "universal" one on the web soemwhere
Hope this helps someone.
I have to say, multisite is UGLY.
Thanks again
redirect?
I have not done this one windows, so I dont know for sure if it will work, but the way I haveit set up on linux is as follows.
I create a sub-domain on my host (sd1.domain.com) and then in my web root, i create a symlink for sd1 to point to the web root. Then I create the folder sd1.domain.com in the sites directory, and create its own settings.php file.
Work just fine.
Great instructions
Love the support here!
http://drupal.org/node/148455
http://drupal.org/node/148455
Here is a link to a problem that I am having. I have 1 primary domain and two alternate domains listed in the primary domain. Both new domains work, but when I tried to install the new Drupal 5.x in both with seperate databases for each new install in the new domain directories, the first one worked and connected to the first new database created for it and the second one did not. Any thoughts on why this is?
I'm adding a second site
I'm adding a second site (subdomain) with same database using a database prefix...
when I go to my subdomain I get warnings that my tables are not there... like drupal does not realize this is the first access to a new site and does not give me the initial config webpage.... any thoughts?
sites directory
Did you add the site to the /sites/ directory and edit the Settings.php file?
Quint
Shalla.Net
I had to add install.php to
I had to add install.php to the end of the url....
I am stymied
I have set-up a site in the sites directory. I experimented with MANY combinations of .htaccess and httpd.conf changes.
I have groups.comminit.com -- this is a sub-domain. I have
sites/groups.comminit.comand that appears to work fine. I tried to get groups.comminit.com/specialgroup into play. I did up asites/groups.comminit.com.specialgroupdirectory. I experimented with exposing and hiding the $base_url in the settings.php -- that made no difference.Our rewrite code in .htaccess looked like this by default
I am running this in Apache 2 on an Ubuntu LTS server. Has anyone had success with the same set-up when they tried to set-up a sub-directory? If so: what did you do? Do I have to make a new conf file for sites-enabled/sites-available ? Do I have to add an Alias in the groups conf file? What am I missing?
All the best,
Mike
Did anyone have a fix for this multisite brick wall?
I have a similar problem in that i have drupal 6.14 in a subdirectory.
I want to run the domain www.example.com along with the subdirectires of
www.example.com/subdir1
www.example.com/subdir2 etc
I got the rewrite code to work for the primary www.example.com so that even though its going to the drupal install directory, the URL shown to the user is still www.example.com. However, if I try to access any of the subdirectories for the site, for instance www.example.com/subdir1 I only get the default (www.example.com)
I have all the drupal install directories properly set, that is in the sites directory I have:
all
default
example.com.subdir1 etc
and the sites each have a valid settings.php file and the modules and themes are in 'all' subdirectory.
I don't have access to apache so only have .htacess to work with and symlinks on my host service yield a security 'access denied' error.
So does anyone - anyone at all- have a solution that might work for me.... the rest of us...?