Possible to limit which custom modules for a multisite? - drupal

I'm using a multisite setup in Drupal 7. I'm wondering if it's possible to limit where a site can look for which modules to use. For example, there are a lot of modules I'd like to be able to use across all sites (../sites/all/modules/). But I would like Site A to have access to modules/custom/siteA, but not modules/custom/siteB.
Is this possible or do I have to share all modules across all sites?

You're thinking of it the wrong way; going depth first instead of breadth first. This is one of the "benefits" to going multisite.
In Drupal 7, you should be able to put any modules you want only to appear to a specific site into it's sites/site-name/modules/ directory; site-name being whatever directory you mapped the sites/sites.php file to go to for the given URL. I think you should already have a settings.php file in your sites/site-name directory. Just add the modules folder and dump them in. I'm not really sure how to handle it further, or how to install site-specific modules from the site GUI (if that's possible.)
I only put benefits in quotes because I've never been a fan of going multisite, but plenty of people have been more than happy to and it's worked out great for them.

this is quite easy. Suppose there are two sites you have created with multisite installation.
Site A (root site)
Site B
The modules that are common will be placed in sites/all/modules directory. But you can define some modules to appear in the site B only by placing the same in
sites/SiteB/modules.
I hope, it is making sense for you. Otherwise feel free to ask your queries.
All the Best!!

Related

Reconfiguring Drupal for HostGator Site

I've tried researching this dozens of ways, and I've found posts that address pieces of what I'd like to do, but not the whole thing. I tried posting this on the Drupal forums as well, but my post hasn't shown up yet. I'm pretty new to Drupal and am afraid of corrupting my current site in the process.
Current setup:
I have a primary domain with several addon domains at HostGator
I want to convert one of my addon domains (call it addon.net) to a Drupal site
To test Drupal, I created a subdomain of addon.net (cmstest.addon.net) and used QuickInstall to set it up as a Drupal site
Current folder structure in HostGator:
/home1/[username]
cmstest.addon.net (contains Drupal files)
public_html
addon.net (contains html files)
What I'd like to accomplish:
I want to convert addon.net to a multi-instance Drupal site so I can have a test environment without having to maintain configuration and database changes in multiple places.
I don't want to lose the html files for the current addon.net site - if I have to back those up somewhere else just for reference, that's fine.
Ideally, I'd like to retain my current instance of Drupal as the main one and convert it to multi-instance, so I don't have to reconfigure everything from scratch.
If possible, I'd also like to retain the existing cmstest.addon.net domain as my test environment
I realize this is a lot of things, and I may have made things more difficult for myself by using QuickInstall rather than doing this manually. If it's much easier to start fresh with a manual install for addon.net and reapply all my changes once, that's still worth it if I can have a multi-instance setup with a test site moving forward.
Point all of the addon domains to the same folder in cPanel & then use standard Drupal multi-site installation techniques for the routing, i.e. the default domain plus individual folders and settings.php files for each of the subdomains.
Root: sites/default/settings.php
Domain: sites/example.com/settings.php
Subdomain: sites/sub.example.com/settings.php
Run the multi-site installation sharing the same core files, themes, & modules using this addressing format for the folders in /sites with unique settings.php files & MySQL databases (or table prefixes). You can also add unique /modules & /themes folders for each site if required.

drupal_get_private_key equivalent Wordpress

I'm trying to convert the theme from Drupal to Wordpress, I don't know a lot about drupal, so this function "drupal_get_private_key" confuses me a little and I can't really find a lot of documentation about it. Could someone explain me what is this function about and how could I do this in Wordpress?
Thank you for the help
Drupal uses this to generate the paths to files* (its used in other stuff too, but in themming I believe its the main reason).
*These files are the files created by users, not the files in the theme folder. The folders are configured in the admin and, when an user uploads a news picture, for example, it will be placed in the configured folder.
You problably just want to find another way to find these paths.

Creating multiple sites with Drupal on LAMP/WAMP

I am confused as to how I can use Drupal to create multiple sites for a WAMP or LAMP installation.
I currently have everything setup and Drupal setup in the following directories:
/var/www/drupal-7.12
c:/wamp/www/drupal-7.12
When I access these folders from the browser I am able to modify and create content for my webpage.
It would appear to me that the default Drupal folder is the only one I can create my website in.
My question is: if I have multiple sites that I need to create with this one Drupal installation, how can I achieve it?
For example:
c:/wamp/www/mysite1
c:/wamp/www/mysite2
Thanks!
This document will explain a bit on how to run multiple sites from the same code base http://drupal.org/documentation/install/multi-site.
If your sites will share some common elements like users, this might also be helpful: http://drupal.org/node/201673
There may be more documentation written on the subject at Drupal.org, but most of what I can tell can be found in the following files. Be sure to read the comments in these files.
[Drupal Root Directory]/sites/example.sites.php
and
[Drupal Root Directory]/sites/default/default.settings.php
In general, the way Drupal 6 worked is that you needed to create subdirectories for each of your sites in the the sites directory. So that you would have a directory structure that looks like:
sites/default
sites/example-1.com
sites/example-2.com
etc.
I would imagine that D7 keeps this same structure, but I haven't yet It looks like the sites.php file provides a mapping of domain names and site directories that you can use to map. Drupal, will default to sites/default if it can't find an appropriate match.
While it's targeted toward linux, this might be a good place to find multisite info as well:
http://drupal.org/node/1114158

Installing Magento and Drupal in the same directory... htaccess magic maybe?

We are looking to run one website using two CMS systems, so for all the content related stuff it would be drupal, and then for all the ecommerce related stuff, we are looking to use Magento.
Do you think this is possible? What are the general thoughts on this as an idea?
Usually we would have the ecommerce on a subfolder, like /store/productname... however, the client has specifically asked that we don't have it on a subfolder, hence asking for opinions on here.
Edit: For the sake of anyone thinking this is not programming related, I am wondering if there is something that you could achieve with the .htaccess file (rewrites etc).
I don't think this is really possible, both Drupal and Magento rewrite all incoming requests for non-existing files to index.php in the root.
I guess you could change one of the CMSs root files to index2.php and try to route requests for that CMS to the correct index file. However this means you will need to maintain a list of all paths that can be accessed by that particular CMS in the .htaccess file itself, which would be a real pain.

Drupal installation and domain naming strategy?

I have a my main site, called "mysite.com" (for arguments sake). On this site, you will find my blog and everything I do. But I am starting another site that I want to run on my domain. However:
The other site must have it's down domain name: newsite.com
If people go to mysite.com/newsite it must redirec to newsite.com
If people go to newsite.com, it must show the content of what they would see if they had gone to mysite.com/newsite in the past
So basically, I want a "page" or actually a whole section ( mysite.com/newsite/* ) to appear as newsite.com in the browser.
Why?
I want both sites to run off one drupal installation
I want both sites to look basically the same
However, keep in mind that I don't want to use a multi-drupal solution. i.e. a module that allows for more than one copy of drupal to run off 1 installation.
http://drupal.org/project/domain allows you to configure various things based on the domain, for example accessible nodes.
You can probably do the redirect with a Rewrite Rule, outside of Drupal or write a simple module that does that.
Sounds simple to do. Just install the second site using a regular multi-site installation. (Google "drupal multi-site instructions"). Then install the Path redirect module and create the external redirect to the new domain. http://drupal.org/project/path_redirect

Resources