When naming a sites folder in Drupal using a multi-site setup, can I name the site "mydomain" or does it have to be in the format of the domain name like "mydomain.com".
Is there a way to do this using symbolic link in linux?
thanks
Drupal matches the domain name requested via HTTP with the folder name inside sites. If it does not match anything it will fall back to "default". So you need to name the folder mydomain.com.
You can definitely use a symbolic link from mydomain.com -> mydomain provided your Apache (or other HTTPd) is configured to resolve symlinks.
Drupal 6 looks for a file named settings.php in a folder named sites/mydomain.com, or similar. The exact rules are listed in default.settings.php. If your host supports symbolic links, you could make mydomain.com into a link: the syntax is ln -s /path/to/real/files/mydomain mydomain.com
Drupal 7 is much nicer about how it handles multisite installs- it's possible to tell drupal where the settings.php file is for each domain. There's a patch that backports this feature here: http://drupal.org/node/231298
Related
I would like to use Drupal 7 to support two domains with same code, themes, modules and even database and content, completely transparent to the end-user.
So, user of exmaple1.com would see only exmaple1.com and user of example2.com would see only example2.com (not be redirected to example1.com). To complicate matters, I already have example1.com legacy, which cannot change.
Closest I have come -
1) using apache virtual host to proxy requests for both domains to same drupal htdcos directory.
2) setup sites for each domain as per https://drupal.org/node/53705.
a) Modify the base URL within settings.php file under example2.com directory
But, still, users of example2.com are redirected to example1.com(?!). In fact, I looked into my default settings.php file and found the baseURL field is commented out. A directory search for my sites base URL returned no results, suggesting it is set somewhere in the database? WHERE? I looked into tables like url_alias - no records. Can this is set to some variable that reads the HTTP request for the base URL and not be hard-coded as it seems to be?
I have already reviewed solutions that "fix" the base_URL in settings.php, apache virtual host, doing HTTP redirect/rewrite in .htaccess, pathauto modules, backup/migrate and also multi-site.
It seems that you read an old documentation for multisites on (2). For Drupal 7 check https://drupal.org/documentation/install/multi-site.
But you need to set up Symlinks (Symbolic links) to achieve that. I don't think you need a multisite here if both sites use the same files and database.
Try the useful link below for Drupal 7 multisite install,
http://mydons.com/drupal-7-multisite-install-steps-in-windows/
http://mydons.com/drupal-7-multisite-install-steps-in-linux/
I have a multi-site setup with a single codebase.
Is it possible to have my sites directory set up like this with sub folders:
mysite.com in /home/drupal/sites/mysite.com
othersite1.com in /home/drupal/sites/cluster1/othersite1.com
othersite2.com in /home/drupal/sites/cluster1/othersite2.com
othersite3.com in /home/drupal/sites/cluster2/othersite3.com
othersite4.com in /home/drupal/sites/cluster2/othersite4.com
I'm trying to find a way to organize all my sites.
thanks
You can do this if you are using Drupal 7. There is a file called sites.php in sites folder that you can alias the paths to your sites. If you are using < Drupal 7 you can make the directories as you propose and create symbolic links
ln -s /home/drupal/sites/cluster1/othersite1.com othersite1.com
The way Drupal finds the site folder is explained in settings.php, read that.
I have a Drupal multi-site setup using a single code base.
I have a site running in /home/drupal/sites/wxyz.com
I want to point another domain name to the same site(same content). The domain is wxyz.net.
Do I make a copy of entry for wxyz.com in the vhosts file and copy it for wxyz.net ?
Do I need a symbolic link for this also?
I don't want an entire new site for wxyz.net, I just want the domain to point to the .com.
thanks
If both sites share the same content you don't need to do anything but set up the vhost. If you have different content you will need 2 different settings.php files.
You should not need to set up a symlink in either setup.
I have a new client that I am converting over to Drupal from Wordpress. We have two domains with the same name but different TLDs i.e. .com & .org. We have decided to start by setting up the site first under the .com so we have a live site to play with during the development.
So we currently have a wordpress site running on the .org and drupal (on a new host) running on the .com domain.
So two questions:
Can and How do you configure Drupal to work for both the .com and the .org ?
Can and How do you change the base domain drupal is configured with after the site is live ?
If you aren't using Drupal's multisite system (that is, the site information is being put into sites/default instead of sites/example.org or sites/example.com), this is really easy: do nothing. There is no step 2. Drupal will handle any domain thrown at it: just use your web server's name-based handling to determine which domains to accept.
If you are using Drupal's multisite system, it's a little harder:
Rename the sites folder (so from sites/example.com to sites/example.org).
Drupal's files table hardcodes the files directory it uses, so you're going to need to change all the paths in it. Run UPDATE files SET filepath = REPLACE(filepath,'example.org','example.com') on the database.
The other place to change the path is under Site Configuration -> File system.
The final place you're going to need to change paths is going to be on the settings page for your theme if you decided to use a custom logo or favicon.
Once you've changed all the paths, rebuild the cache under Site Configuration -> Performance.
This should cover most cases. Check with the third-party modules you're using to see if they also hardcode filepaths. If the modules are using the API correctly, they should've been handled in steps 2 and 3.
Because of all the hardcoded file paths, I highly recommend not using multisite unless you really need to. If you are only running one site in a Drupal install, just stick the site in sites/default.
I need to set up Drupal 6 as a multilanguage site.
1 installation, several language versions = several domains, i.e.
English at englishsite.com
French at frenchsite.com
German at germansite.com.
I've found a Tutorial that suggest that you need access to server's http.conf - this is quite unlikely on shared hosting.
Is it really neccesary?
Maybe You can set it up with .htaccess or any other way.
Namely: what should I do to have such a configuration working ?
(after setting Language negotiation to Domain name only on .../admin/settings/language/configure)
According to what I've found this could resolved in at least 2 ways.
Admin interface
Make the domains point to the Drupal directory in the hosting account admin interface (what is equivalent to http.conf edit suggestion from the tutorial)
Symbolic links
Replace the domain-specific directories with symbolic links to the Drupal directory (in Unix-based systems), i.e.
ln -s <drupalDirectory> <domainDirectoryName>