Hi folks:
Trying to get this multisite going. I copied the settings.php but I am not sure how to actually install the second site. Am I supposed to also copy over the install.php file into that subdirectory? I tried opening the settings.php, but I just get a blank page. I next tried copying over the intall.php into the new sub-directory, changed the permissions on the server, and then trying to run it yields an error:
Warning: require_once(includes/install.inc) [function.require-once]: failed to open stream: No such file or directory in /home/brian59/public_html/drupalmulti/sites/blackstoneriver.org/install.php on line 4
Fatal error: require_once() [function.require]: Failed opening required 'includes/install.inc' (include_path='.:/usr/local/php5/lib/php') in /home/brian59/public_html/drupalmulti/sites/blackstoneriver.org/install.php on line 4
If I copy over the includes too, it appears that I might as well just create a completely new installation. Can someone tell me what it is that I might be doing wrong here? I have read as many instructions as I can find, but it just isn't clicking.
Comments
You don't need to copy
You don't need to copy install.php over. Just go to install.php on whatever the domain of the new site will be. In your case, it looks like it'll be blackstoneriver.org/install.php (though, being the l33t h4x0r that I am, I just tried going there and got a 404.)
The Boise Drupal Guy!
The install file was already
The install file was already done on the first site. This one is the second site, but it also exists in a different folder (can get to the current stuff by http://blackstoneriver.org). This is a different directory on the server than where I put the drupal installation for the multiple sites. Trying to get it converted over, but I need both sites to live side-by-side for a while until I can port the design and content. By putting the install file in the directory where it is living now, is there a risk of losing the current site?
You shouldn't touch the
You shouldn't touch the install.php file ever. Basically it breaks down like this. Depending on what types of urls you are using for your multisite, you'll have to modify these instructions slightly. Lets say you're trying to make a multisite with different domains:
http://www.example1.comhttp://www.example2.com
In you're /sites folder, you should have two directories:
/sites/all/sites/default
What you want to do, is NOT use the default folder, but rather create two more folders that will have your copied settings.php files:
/sites/all/sites/default/default.settings.php
/sites/example1/settings.php
/sites/example2/settings.php
From there, you want to create symlinks to your site folders. This is how Drupal tells Apache what settings.php file to read when a request comes in from that url. In a mac or unix environment you will use the command:
ln -s example1 example1.comln -s example2 example2.com
You could also just call the folder www.example1.com, but that's not a good practice.
After that, all you need to do is set your DNS up so that both of your URL's point to the same webroot, and Drupal and Apache takes care of the rest.
Hope that helps.
Mike
Thanks, just a few more things
Thanks again, for bearing with me. I guess what I am trying to find out is, it seems that the location of the site won't come up in order to be able to build the site, unless I put in the symlink? And putting in the symlink makes the site live? The DNS is already pointing to the proper nameservers, so I assume it would pick up the redirection of the symlink, but I still have a live folder which corresponds to the static version and I need to keep that live until I get this one ready.
Do people usually build the site locally on their home drives? That seems to be the case. I usually work right on the server, because I have Windows at home and not Linux and then only create backups for home storage. Setting up an Apache server at home on Windows has been a hair pulling out experience for me. So do people build their sites at home, using a local MySql DB and drupal installation, and then load it all up once they are ready?
I really want to get the multisite to work, because otherwise, updating the individual sites will take so much time. Right now I have one site, but am planning on having 4 by the time this is done.
use a htaccess rule?
Well, here's an idea ... I haven't tested it but it seems like it would work. Could you run a test in the .htaccess file --
1) If it's the name of the site you're building AND
2) it's not coming from your IP range
...serve the old site?
That would give you private room to test, I'd think.
I don't know if it would work but it's an idea.
Is your static site and your
Is your static site and your drupal install in the same folder? I should hope that it wouldn't be. Your virtual host will determine what folder it points to. Let's say that you have your folders set up like this where your static site is just dumped into your docroot and your drupal site is in a subfolder:
/www/www/drupal
Your virutal host for your second domain should be pointing to /www, assuming that's where the static site is. Generally speaking, most people don't think about putting multiple sites in a single docroot, so it's a common issue. When you want it to go live, you'll need to point it to /www/drupal. If you already have one drupal install going, then you'll need your vhost for your second site to point to that same folder as your site's docroot. That is assuming that you have separate urls (and not subdomains- that makes it slightly more tricky- however, the way around that is that you could just use a different development subdomain and just change the symlink later- ie. devsite2.example.com).
So for what you want to do, what I would suggest is either getting dev url to point to the same url as your existing drupal docroot, or use a subdomain, which accomplishes the same thing. Either way, you'll need to set up a virtual host to point it to where Drupal is installed, and drupal will look at the request, and point it to the sites folder to figure out if there's a folder for the request. If not, it goes to default.
I generally build locally before I put anything on a server. It's a lot quicker that way. Also, I do consulting, so I generally have multiple projects running at the same time, so it's easy just to have one install that I can point many sites at. I'm also a Windows guy. Yes, I run into some problems now and again, because there are just certain things that you need unix for, but for your intents and purposes, you should probably be fine with Windows and a copy of cygwin or something similar that you can emulate a unix shell.
As far as setting up apache goes. Yes, it's a harrowing experience. But that's because you're doing it the hard way. Check out WAMP Server. It's a package with Apache, MySQL and PHP all rolled into one. Most people don't need to do any more configuration than just installing it, but there are a few things that could use a little tweaking for more advanced users. If you go that route, need something tweaked, and can't find it, kick me a message with what you need, and I'll walk you through it when I can.
Multisite is a really great way to manage a large number of sites, and it's definitely worth learning. I highly suggest going to Drupalcon in March. The sessions aren't set yet, but I'm hopefully going to be doing a talk on multisite, which should be pretty comprehensive.
Let me know how it goes.
Mike
Server folder setup currently
Hi Mike:
Thanks for the info, I will work towards getting a local Apache going again. The static site blackstoneriver is not in the highest level, but in a folder underneath. The brianosaur site is in the highest level, but since that is my personal site, I don't really care if it blows up during all this changeover. The static version of brianosaur seems unaffected at present since the multi-site of Drupal was installed with brianosaur as the top site in the installation. So at present, I can work on loading up the drupal version while those static pages are still. Here is a look at how things are on the server:
Sections in brianosaur.com: (going away at some point once Drupal is ready)
/public_html/movies
/public_html/music
/public_html/house
/public_html/golf
/public_html/family
/public_html/events
/public_html/crafts
/public_html/ecommerce
Static site for current blackstoneriver.org: (the one I need to keep running while building the multi-site)
/public_html/blackstoneriver
New Drupal multi-site: (for brianosaur.com, blackstoneriver.org and eventually oxfordgreenshoa.org):
/public_html/drupalmulti (top site would be brianosaur.com and others would be underneath for multisite codebase)
/public_html/drupalmulti/sites/blackstoneriver.org (I created this one, then was uncertain if it could exist alongside the static one, pretty much where I am now, no real way get to the index page directly, and I can't redirect the domain name yet)
/public_html/drupalmulti/sites/blackstoneriver2.org (created this to see if I could create the sub-site without disturbing the static one, not sure if I need it)
Stand-alone drupal 6.x site (oxfordgreenshoa.org, my first and currently only Drupal 6.x site)
/public_html/oxfordgreens/drupal (home of a standalone drupal site, not affected by this, but eventually want to move this one underneath too)
The goal eventually would be to have brianosaur.com, blackstoneriver.org, and oxfordgreenshoa.org all reside under one codebase. Oxford would be the last one to be moved because of module stylesheet customization and testing that would have to happen to make sure I didn't break anything).
Thanks for the info. This
Thanks for the info. This makes helping you a lot easier. The easy way to do this, is to create a subdomain for brianosaur.com, say... blackstoneriver.brianosaur.com You can develop from there, and then just change the virtual host of blackstoneriver.org to point to the right folder "/public_html/drupalmulti."
Now to do this in a way that will make things easier for you in the long run, is to add a server alias to your existing virtual host for *.brianosaur.com. Don't forget to restart apache! Now, you can develop as many subdomain sites as you want under the brianosaur.com umbrella. From here, since you don't want your blackstoneriver.org site to always be callled blackstoneriver.brianosaur.com, create a site folder called blackstoneriver. In the blackstoneriver folder, put your settings.php file, and your files folder, making sure that the permissions are set correctly. Then create a symlink to that folder from blackstoneriver.brianosaur.com like this:
ln -s blackstoneriver blackstoneriver.brianosaur.comNow you should be able to navigate to blackstoneriver.brianosaur.com.
However, I do have a question for you. Are you planning on developing this blackstoneriver site using Drupal 5 or 6? It might be worth doing it in 6, so you don't have to do an upgrade later (espeicially if you want to integrate the oxford greens site).
Mike
The current drupal site was developed in 6.x as is the multisite
Since I just started working with Drupal in July, I went with 6.x for the oxfordgreens. Given the young code of the 6.x, it has been update after update, which is one of the reasons I have
1) put off making more sites in Drupal and
2) have been seeking the multisites option.
Every weekend the modules or core code changed. I think I started on 6.2 and am now on 6.7, a little behind in getting up-to-date.
For the subdomain:
Looking at lunarpages, it appears that blackstoneriver is already set up as a subdomain (but it points to that public_html/blackstoneriver folder). This may be because I didn't buy the domain names with lunarpages, but rather through networksolutions. Lunarpages has two functions in their CPanel. subdomains and add-on domains. If either of them are used, it seems to affect the other. For instance, I created blackstoneriver as an add-on domain, but it is now there as a sub-domain (showing both blackstoneriver.brianosaur.com and also in the folder /public_html/blackstoneriver).
Is there a way to set up a multi-site without having a "live" domain? For instance, when I tried to set-up blackstoneriver2, and then get the files set up and then eventually point the domain name to that "drupalmulti/site/..." folder?
Well if you're on a live
Well if you're on a live server, you can either use your server IP address, or you can use some sort of a domain. There aren't too many choices. You've got letters and numbers to work with. Don't know what to tell you otherwise. My question though, is who's going to know whatever you call your subdomain? It's "live" but if no one knows about it, and if you keep your robots.txt file shut down so it doesn't get spidered, then there's not too much of a problem, now is there? One thing you could do is pick up a development url and use that.
Mike
So if I am understanding
So if I am understanding this properly, it sounds like the sub-sites from the multisites need to be attached to a domain even during the building phase? So assuming that is correct, could I use the currently registered, but unused and unhosted domain "songbeast.com" (not even set-up as an add-on domain or subdomain yet) and point that to the multi-site location that I want for blackstoneriver, just to get me through development. And when the site is ready for launch, I could make the change so that songbeast no longer points there but blackstoneriver does?
I have a few spare domains that I could do that with, and would need to eventually do that with oxfordgreens too (though that would be more of a port and test, rather than develop situation).
How else would you get to
How else would you get to the site if not by an IP address or by a url? It doesn't have to be a top level domain. You just need an address to put into your browser. It doesnt matter what it is. When you make your site folder call it by the site name, and you can create a symlink from any address or subdomain you want. Just use a subdomain of what you already have pointing there and save yourself the hassle.
Yes, I see. I guess I have
Yes, I see. I guess I have been used to going directly to the folder where the index.php resides before the domain is set up. Since this is a shared index.php, that won't work too well. That is really more of a purely HTML or non-system type method. Then I would hook up the domain when I was ready. I will see what comes of creating another domain folder and see if that works.
I will also need to find out more about symlinks. Haven't been too much up to speed on the Linux commands. So much to learn.
More About Symlinks
HOW WE DO MULTISITE AT GAMEFACEWEBDESIGN.COM
Some of this is just recap. It's from our internal WIKI. My next post will be the directory structure we have now.
-Bram
Problem with old Multisite is that each site's files directory is viewable from every other site. Example: Both urls work
They work because they are both using the same webroot and thus are really almost the same site.
An option to fix this is to make a pseudo-separate install for each site, with symlinks to Drupal directories and php wrappers for the index.php, update.php, etc.
DETAILED INSTRUCTIONS
The document which inspired our change
Our modifications to this scheme:
NO MORE /home/User
We are doing away with all domains having separate users, each having ssh accounts on the system for security and convenience reasons. We may still retain FTP accounts but the protocols are still in development. In any case, the virtual domains will not be pointing to the /home/user/yoursite-com symlinks. These symlinks will now all be co-located at /usr/local/www/domains/. However, power users will still have /home/user accounts.
error.log and access.log files
These files are where the bulk of the disk space on the old server was being used. Instead of putting them in the home/user/ directory, we'll put them into the /var/log/lighttpd/ folder. We will still have separate logs for each client, but they will either be co-located, or under separate sub-folders. We should institute a way to clear old parts of the file or compress it (Protocols are still in development). [NOTE: Lighttpd does not yet support php error logs for separate sites - we need a better system]
FILE SYSTEM
In order to better track the site of the files directories and to be able to put quotas on them, we are changing the location of the files directories to the /home/domains/yoursite.com/ . A symlink should be able to be put in the sites/yoursite.com/ folder called files that will do the job. This will also allow for easier upgrades because the files (which could be in the GB) do not have to be moved.
NEW FILE STRUCTURE
http://gamefacewebdesign.com
New Directory Structure
NEW GAMEFACE SERVER DIRECTORY STRUCTURE (9/18/08)
NOTE: We are getting some help from Ryan Grace on how to do this even better.
-Bram
======================
http://gamefacewebdesign.com
Is there a proper way to do the symlink with PHP symlink file?
OK, I did the following:
1) Created a subdomain that is currently unused called "originalsandcovers.com"
2) Created subdomain in the drupal installation called sites/originalsandcovers.com folder
3) Copied settings.php into this folder, changed the permissions to 755 (lunarpages doesn't like 777)
4) Created a symlink.php file on the root directory and put in the following code (I don't have Unix command process/skills at this point):
*replaced the location with root_folder for simplicity here:
<?phpsymlink( '/root folder', 'originalsandcovers.com' );
?>
5) Uploaded this file and called it from the browser.
6) When in the file system I noticed that there is now a folder called "originalsandcovers.com", when I click on it, it sends me to to the drupalmulti folder (guessing that is doing what it is supposed to do)
7) Now if I call up either the www.originalsandcovers.com/install.php or the originalsandcovers.brianosaur.com/install.php I get a 404 error. If I try any other iteration (www.originalsandcovers.com) I get server not found.
Any thoughts on this?
Okay, brian, sorry, but at
Okay, brian, sorry, but at this point I think the best thing for you to do is scale back your plans for a multisite installation for now and start learning more about web hosting and Unix/Linux filesystems. For the latter, look in the catalogs for universities and community colleges for classes in your area you can take; it's how I first learned my stuff. A book may work as well if you have the discipline to self-study.
It's just unrealistic for us to teach you this stuff in a forum thread. You need to learn it on your own.
The Boise Drupal Guy!
Interesting. I am not a
Interesting. I am not a Linux admin, and yet single Drupal installations haven't posed this type of problem. I appreciate the suggestions (is the O'reilly book any good?). I still don't believe that the issue I am having will be solved by this and believe that it has something to do with how Lunapages servers are set up, but just to test the theory through, I'll do as you suggest and learn as much as I can, install multisite succesfully on a local Apache installation, and then after all is said and done, I am sure I will still have issues with Lunarpages. They removed Drupal from their Fantastico offering, so there is something going on there.
In the meantime, I guess I will have to look away from 6.x until it stands still more, because I can't build these sites out individually and keep up with the constant maintenance of modules and code. It takes enough time for the one site that I have now.
You're just going to have to trust us here...
Brian,
Yes, for doing a single install, it's a much simpler process. Creating multisites is a lot to wrap your head around, and it DOES require a certain amount of UNIX and Apache knowledge. I'm (hopefully) doing an entire lecture on using Multisite at this year's Drupalcon, and I'm probably not going to be able to get to everything that I want to talk about.
Multisite makes having a many sites a lot easier, but you really have to know how to do multisite properly, in order to do a multisite installation. One thing out of place, and it simply doesn't work, and there won't be any way for the system to tell you that X Y and Z happened, instead of A B and C. Apache just does what you tell it to, and Drupal makes the assumption that you're going to know what you're doing, and that you're going to do it right.
Going solely on what you've said in your posts, you haven't demonstrated the grasp of knowledge that you'll need in order to create and maintain a multisite. I agree that taking a basic UNIX/ Apache class will do a world of good for you. It will explain topics that is difficult to explain in a forum post. Your other two options, which might not be as ideal, but you could hire a tutor who can walk you through the basics, or you could hire someone to do it for you. If time is an issue, I'd go with having someone set it up for you the right way. You can always learn it as you go, but if you have a bad install, and you try to fix it, it will be worse to try to undo past mistakes.
Mike
Thanks Mike
I really do appreciate the extra explanation. I have found that single installations to be quite friendly and workable, allowing me to do what it is I do best, which is really more UI design, so its good to know how different the multi-sites are in that respect. I have some decisions to make, mainly because of the time-consuming nature of upgrading the 6.x code and the frequency with which it is being updated now. I know that it is considered by the Drupal culture to push people towards the newest for improvement and evolution of the system, but is it just my observation, or is the codebase still rather immature commpared to 5.x. I definitely won't be going back to 5.x, but am trying to get a sense of when we might see a slowdown in code upgrades.
Why is naming the folder in
Why is naming the folder in sites/ www.example2.com a bad practice?
Bad Practice
It's a bad practice, in my opinion, because it makes systems administration and development more difficult in a number of ways. Say, for example, that you don't necessarily know what your domain is going to be while you're developing the site. I've worked on a large multisite installation where I didn't know what the exact domain name was going to be until the site was ready to launch. I'll know what the site name is, but not necessarily the exact url. So my assumption that a site would be at www.example.com might be incorrect if the site ends up being at www.exampleonline.com. I usually create symlinks that manage my urls, and call the sites folders by a simpler site name that I will more easily recognize. Another example, would be if you have multiple domains pointing to the same site. ie. example.com, example.net, example.org. Drupal wouldn't understand that .com, .net and .org are all the same site. That last statement has SEO implications, but that's beyond the scope of this discussion.
Another reason that this is a bad practice, is that www.example.com, if used as a folder name, is stored in the database. All your site specific modules and themes will have paths that reference that. That, in and of itself, isn't too bad. But let's say you have multiple environments: Dev, QA, and Live- where you would have multiple instances of your sites. dev.example.com, qa.example.com, www.example.com. Going to a url called dev.example.com will not point to the www.example.com folder without a symlink. Now remember that the specific paths to your modules are stored in the database. Therefore, you also won't be able to move copies of your db down from live to qa and to dev without altering your paths in the db for where your modules are living.
That's the short answer. Hope that helps.
Mike
multisite subfolder
sorry for asking, and I apologize for my English
Drupal 6.10
Debian 8
Apache/2.2.4
Mysql 5.21
Multiple domains and subdomains work well with Multisite but can not operate when the site is subfolder .-
I try to install and operate
example.com. and example.com/site1 as different sites, but
Example.com installed and functioning properly, install example.com/site1, installs in principle,
creates the database, comes to the new home, but when I Click on any link reads the database example.com, and result.
Access denied
You are not authorized to access this page
Any idea:
Configuration.
drupal_root
ln -s sites/example.com/site1 site1
site1 ———————> sites/example.com/site1 symlinks
In drupal_root/sites
ln -s example.com example
—— example.com ———————> example symlinks
ls -l example
setting.php
files
setting.php (example.com) then install
$db_url = ‘mysqli://example:example@localhost/example’;
$db_prefix = ";
I add
$base_url = ‘http://example.com’;
——example.com/site1 ———————> site1 symlinks
——site1
setting.php
files
setting.php (example.com/site1) then install
$db_url = ‘mysqli://site1:site1@localhost/site1’;
$db_prefix = ";
I add
$base_url = ‘http://example.com/site1’;
apache.conf
ServerName example.com
DocumentRoot /var/www/sitios/drupal_root
LogLevel warn
ErrorLog /var/log/apache2/error.log
CustomLog /var/log/apache2/access.log combined
ServerSignature On
DirectoryIndex index.php index.html index.php home.shtml index.cgi
Directory "/var/www/sitios/drupal_root"
Options +Indexes
AllowOverride All
allow from all
/Directory
Alias /site1 /var/www/sitios/site1
directory "/var/www/sitios/drupal_root"
Options +Indexes
AllowOverride All
allow from all
/directory
/VirtualHost