2

I have a problem in multisite with Drupal 7.26. The name of the site is multisite, and the IP is 192.168.1.99.

I created a folder that hosts a new site (/var/www/multisite/sites/site1), copied the settings.php file into the site1 folder; the 127.0.0.1 site1 line is present in the hosts file.

This is the content of /etc/apache2/sites-available/site1.

<VirtualHost *:80>
  ServerAdmin webmaster@localhost 
  ServerName site1
  DocumentRoot /var/www/multisite/sites/site1

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>
</VirtualHost>

I executed the following commands.

sudo a2ensite site1
sudo /etc/init.d/apache2 reload

If I use 192.168.1.99/multisite/, it works; if I use 192.168.1.99/site1, I get the following error:

The requested URL /site1 was not found on this server. Apache/2.2.22
(Ubuntu) Server at 192.168.1.99 Port 80

What did I do wrong?

should i add any redirect base code in .htaccess file?

    Solution: Give Symbolic link form mulitsite to site2
    Executed that command line 
    ln -s /var/www/multisite /var/www/site2

    Rename example.sites.php to sites.php


    $sites['192.168.1.99.site1'] = 'site1';

    put this line in sites.php 

I got a result . Thanks for post the answers this questions

Reference URL:

  https://drupal.org/node/2622
  https://drupal.org/node/43816/
3
  • I think you forgot to restart Apache: sudo service apache2 restart.
    – shrish
    Feb 18, 2014 at 11:00
  • sudo /etc/init.d/apache2 reload has the same effect on vhost config
    – Clive
    Feb 18, 2014 at 11:03
  • Troubleshooting Drupal multi site may be painfull. If you have a terminal to the server, you may have try strace , which gives you you a better idea of how Drupal reads your filesystem see more here drupal.stackexchange.com/a/123231/13760
    – Augusto
    Jul 11, 2014 at 13:13

4 Answers 4

3

The new site vhost should be pointing to the drupal root installation where the index file lives and the entry point for all your sites, not to the site1 folder. "DocumentRoot /var/www/multisite" this should be the same for all your sites.

With multi-site a approach you can shared modules between sites (those in all folder), have different modules per site, you can have different databases per site and share tables between them.

Your drupal sites are going to share the same code base, One drupal core for everyone.

This can be useful https://drupal.org/documentation/install/multi-site

3

I think you have a whole bunch of things going wrong here.

You need to turn on name based virtual hosts in your httpd.conf:

NameVirtualHost *:80

Then you need to configure your virtual host to respond to these names and map them to the base of your installation

<VirtualHost *:80>
  ServerAdmin webmaster@localhost 
  ServerName site1
  ServerAlias site2, site3, site4
  DocumentRoot /var/www/multisite

  <Directory /var/www/multisite>
    Options FollowSymLinks
    AllowOverride All
  </Directory>
</VirtualHost>

Don't forget to restart apache.

Now, you need to configure your DNS or /etc hosts to map these hostnames to an IP address

192.168.1.99 site1 site2 site3 site4

Now you are ready for multisite. Edit the various settings files, and keep in mind that

  • http://site1 will map to site/site1/settings.php
  • http://site2 will map to site/site2/settings.php
  • http://site3 will map to site/site3/settings.php
  • http://site4 will map to site/site4/settings.php

Then you need to browse by the server name and not IP. You may also want to real about multisite aliasing.

All of that said, avoid multisite. It causes more headaches that it is worth.

0
<VirtualHost *:80>


 ServerAdmin webmaster@localhost 
  ServerName site1
  DocumentRoot /var/www/multisite        //change this to your site root folder 

  <Directory />
    Options FollowSymLinks
    AllowOverride All
  </Directory>
</VirtualHost>

Try this.

You may also need to configure your host file if you need aliasing.

2
  • Please reboot apache after making changes Feb 18, 2014 at 11:34
  • Thanks for your Help.i changed /var/www/multisite/sites/site1 to /var/www/multisite .But i got same 404 error . Feb 18, 2014 at 12:32
0

https://drupal.stackexchange.com/questions/104319/give-write-permission-to-symbloic-link-folder-in-centos

Any way I find out the solution . I gave write permission to Symbolic link folder and root folder

  lrwxrwxrwx  1 root       root        44 Feb 19 04:39 mmultisite01 -> /var/www/vhosts/vyhub.com/httpdocs/mmultisite


 mmultisite01 is in root .  So that got errror was 

 Forbidden
 You do not have permission to access this document. 

 That root is changed to 

 chown -h vydevplesk:psacln /var/www/vhosts/vyhub.com/httpdocs/mmultisite01

 ls -l

  lrwxrwxrwx  1 vydevplesk psacln      45 Feb 26 05:20 mmultisite01 -> /var/www/vhosts/vyhub.com/httpdocs/mmultisite


  This link is help to me 

https://superuser.com/questions/68685/chown-is-not-changing-symbolic-link

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.