I host several sites on a cloud server running Cent OS and using Plesk. I have complete command line access since it is my own cloud server. For my Drupal 6 sites, I used the alias trick to do an easy multi-site setup. It works fine but it does not allow me to get individual traffic stats for the sites. So for Drupal 7 I decided I would try to do an install that would let me track individual usage. The fairly universal advice re multi-site setup on the main Drupal site is to use sym links. So I set up a Drupal 7 folder in my www/html folder and then in my vhosts site/httpdocs folder I added symlinks to the Drupal 7 main files. I created my own sites folder with symlinks back to the all and default folders in the main install so each client could have multiple sites but still share the modules, themes, etc.
The problem is all I get is an error when I try to access/install the new Drupal 7 site. In reading other discussions it seems I might be missing a call to FollowSymLinks in an .htaccess file. Problem, is I don't know which .htaccess file or where it should be. The Drupal 7 htaccess file is correct. But I read that there should be a main one for my installation of apache?
I'm a fast learner but still somewhat of a drupal, linux and apache noob. Any and all advice is appreciated.
Thanks!
Liz
Comments
Stop using symlinks
I stopped using symlinks because my ISP did a security patch that does not allow them anymore. Multisite should work fine if your domains are pointed to the drupal root directory and the name in the sites directory is exactly what you had pointed to the drupal root directory.
There is one change in the drupal root .htaccess file you have to make. Near the top you have to comment out the Follow Symlinks command. So the two lines should look like this (only thing I added was the # in front of Options) :
#Follow symbolic links in this directory.
#Options +FollowSymLinks
Be sure to read the settings.php file. There are lots of great things you can do in there automatically like share databases or access multiple databases on one site.
So the old advice was use symlinks but D7 works fine without them and it makes life so much easier.
=David
SymLinks
How do I point my domains to to the Drupal root directory? Sorry to be dense but I have no idea what you mean by that. So far I have had one domain that had the drupal installation and then mutiple sites in the sites folder. Yes, that works but on Plesk I have to make them all aliases of the main domain. That's what I'm trying to get away from.
Thanks
Drupal Root Directory
I still use and like symlinks, but that may not be at issue here (and it may be, too - not enough info yet to know).
Also, you can use multiple databases with multi-site which will allow individual stats collection.
WRT 'Drupal Root': if your site is http://lizds-awesome-site.com, then the web server (often Apache) is configured to serve pages from some local directory when that URL is presented. From what you wrote, it sounds like you have something like:
/www/html/drupal7/
CHANGELOG.txt
index.php
sites -> /home/sites
/home/sites
all/
modules/
themes/
default -> lizds-awesome-site.com
lizds-awesome-site.com/
settings.php
modules/
themes/
where 'index.php' is in the Drupal root folder, 'all/' has shared modules and themes, and the 'lizds-awesome-site.com/' folder has site specific files. With this setup, Apache would need to be configured to serve pages from '/www/html/drupal7' - also called the "Document Root".
Does this help? If not, it will help to have more detail as to 1) your site configuration and 2) the error messages you are getting
Do you know that you have the Domain Name Server and (Apache) web server configured properly to point to the IP address of your site and serve files from the correct doc root, respectively?
Clarification re my set-up
I currently have a Drupal 6 installation on this same server. It may be I can't do what I want without a second IP. Under Plesk the site was configured as such:
/www/vhosts/mainsite/
drupal6/
index.php
sites/all
modules/
themes/
site 1/
site 2/
site 3/
more sites . . .
I have to list each site as an alias of the primary site in the Plesk control panel. This works fine. I can get individual Drupal stats but I cannot get bandwidth usage etc from the hosting company except for all sites combined
I can install each domain separately with its own installation of Drupal and get individual stats. When I add a new site in Pleask it just goes to the vhosts folder. In fact I have one additional site installed that way because they have exceptionally high traffic (for my customers) and I had to track them individually.
What I was hoping to do was install new customers as individual customers just like I did with the one but use the sym links to make it look like each had its own Drupal installation and just link back to a central Drupal 7 installation to keep maintenance down. I run a server for small churches and non-profits with a default installation and custom content types designed just for them. Since all sites get the same modules its much easier to run one Drupal installation.
So I set up the Drupal 7 like so:
www/html/drupal-7/
then the new sites are set up like this: (-s indicates a sym link)
www/vhosts/new_site_1/httpdocs/
-s index.php
-s includes
-s etc (rest of Drupal files except:)
robots.txt
sites/
all/
-s modules
-s themes
-s default
new_site_1/
files/
settings.php
IF the sym links were working correctly this should work as it works with a regular install and gives me individual stats. So my question is - why aren't the sym links working? Do I need to move the Drupal 7 installation somewhere else? Do I need to modify an .htaccess file? If so, which one?
Liz
You need a second Apache docroot
All your Drupal 6 sites share the same Apache docroot which appears to be /www/vhosts/mainsite/drupal6/
And it sounds like you have site_1.primarydomain.com, site_2.primarydomain.com, etc. (or some such) so that you can easily make aliases of the primarydomain.com
All of which point at the same (Drupal 6) Apache docroot
You don't necessarily need a new IP as Apache works well with something called NameVirtualHosts which allows you to configure Apache to server from different document roots according to the URL.
(That said, your ISP may require you to have/pay for another IP if you want a second doc root, even though it's a single line configuration in Apache.)
Be that as it may, you'll need some way to tell Apache to send requests for (say) d7.primarydomain.com to your Drupal 7 document root. Once you figire out how to do that with your provider you should be golden.
Your site configuration
I don't know the notation you are using but it seems like your D6 configuration is not right.
For both D6 and D7 the file structure for your sites should be like this:
drupal/sites/all
drupal/sites/site1.com
drupal/sites/site2.com
drupal/sites/site3.com
The next level down would be:
drupal/sites/all/libraries
drupal/sites/all/modules
drupal/sites/all/themes
drupal/sites/site1.com/files
drupal/sites/site1.com/settings.php
drupal/sites/site2.com/files
drupal/sites/site2.com/settings.php
drupal/sites/site3.com/files
drupal/sites/site3.com/settings.php
As far as having a domain point to the Drupal directory. This is what I do using 1and1.com for my domain registration and ace-host.net for my hosting.
At 1and1.com I set the nameserver for example.com to the nameservers at ace-host.net
Using cPanel at ace-host.net I set an addon domain for example.com with a document root of public_html/drupal7 which is the drupal7 installation. So, cPanel takes care of all of the Apache stuff.
What you are trying to do with your clients seems like exactly what the standard Drupal multisite is meant to do. Managing more than a few multisites manually gets cumbersome when you have to upgrade modules and Drupal point releases. You have to manually take each site offline and run update.php for each one.
Site Configuration
I did not show it correctly above. My Drupal 6 installation is as you laid out:
sites/all
sites/all/modules
sites/all/themes
sites/all/libraries
sites/site1.org/
sites/site2.org/
I have NO PROBLEM getting multi-sites to work. My problem is getting stats from Plesk.
I have a cloud server with 1and1.com that uses Plesk not cPanel. In order for the domains to use the Drupal 6 setup I have to set them up as aliases to the primary domain in Plesk. When I do that it rolls all the bandwidth stats etc together under the main domain and I have no way of seeing which client is uses how much bandwidth, hardrive space, etc.
If I set up each domain separately in Plesk then each needs its own Drupal installation but I get separate stats. Thats why I was trying to use sumlinks. To make it LOOK like each domain had its own installation while at the same time keeping maintenance down. I currently have 12 sites up and have two more to add that I wanted to do in Drupal 7 with their own stats.
same needs as LizD... here
same needs as LizD...
here what I want to do, for almost same reasons as LizD :
modulesfolder.com
d70_01
all
librairies
modules
themes
d70_02
all
librairies
modules
themes
site_01.com
drupal 7
sites
all --> sym to d70_01/all
default
site_02.com
drupal 7
sites
all --> sym to d70_01/all
default
site_03.com
drupal 7
sites
all --> sym to d70_02/all
default
each domain has his own drupal 7 installation except for sites/all folder.
this way it's possible to upgrade a module on many sites OR set a new modules folder to test multiple upgrades at once using another modules folder (modulesfolder.com/d70_02).
and of course I can track stats usage with plesk.
and of course I get a blank white plain empty page...
any suggestions about symlink ?
Hi, Would very much like to
Hi,
Would very much like to know outcome of this also.
Where is the white plain empty page coming from, no logging?
For D7, on a strato server with domain module is it better to use symlink or domain alias?
greetings, Martijn
domain module
Are you needing to share content between sites, which is (from what little I know of it) the primary reason to use the domain module? If just wanting to share users across sites, normal multisite is way easier.