0

I've been around the block with this one. and I'm back at my front door!

I am trying to setup a multisite configuration on my local dev server, which currently looks like this. I'm using Xampp in a windows environment so my root is "Xampp\htdocs\"; then any site I'm working on is created under a folder here.

This gives me the follwing Drupal stucture.

\sites\all\themes\devsite

In my browser, I can go to http://localhost/devsite, and it launches my Drupal site without problems; If I go to http://localhost, I get redirected to XAMPPS installation page.

So now I embark on the multisite config.

First, my hosts file is altered to include these two entries.

  • 127.0.0.1 devsite.com
  • 127.0.0.1 m.devsite.com

Browsing to the following URLs launch my site.

I now copy my \devsite\sites\all structure to a \devsite\sites\m.devsite.com folder and setup a \devsite\sites\sites.php file with these entries.

$sites = array(
    'devsite.com' => 'all',
    'm.devsite.com' => 'm.devsite.com',
);

If I browse to either hostname, both load the site configuration which is in All. I can't seem to get it to load anything within m.devsite.com? I've tried copying the settings.php file into each stucture which produces an error message. I've tried renaming All to devsite in folder and sites.php but then I get a blank page when browsing.

Do you have any idea on what is wrong?

2 Answers 2

2

Not sure what exactly you want to do.

Multi-site is usually used to create separate drupal installation from the same drupal folder. To create one, you need to copy default/default.settings.php to yoursite.com/settings.php, make it writable and then visit the site, which should present you with the installer.

You only need to something with sites.php if you want to override the default domain mapping and e.g. also server siteB.com from sites/siteA.com. Also, Drupal doesn't search for a settings.php in 'all' but 'default'.

Your naming scheme sounds more like you want a mobile version of your site, which usually just implies that a different theme is used and some other mobile specific things. There are modules which can automatically changing the theme when the site is requested by a mobile browser.

0

You need to configure httpd-vhosts.conf as well, along with hosts file Add an entry like this to your vhosts file,if this is the first time you are using this file then its probably commented in httpd.conf file, uncomment it and restart apache.

<VirtualHost *:80>
    ServerName m.foo.com
    DocumentRoot "C:/xampp/htdocs/drupal_folder"
</VirtualHost>

inside sites folder create a folder called m.foo.com and make sure you have a valid settings.php file in it. You should be able to see your site now when you open m.foo.com And as suggested by Berdir if you want a mobile site , then no need of another sub site you can create a mobile theme and make use of mobile tools module or something similar to switch between m. and www. for your sites.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.