How do I set up multiple sites with one database or multisite Apache configuration? 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.

&lt;VirtualHost *:80&gt;
  ServerAdmin webmaster@localhost 
  ServerName site1
  DocumentRoot /var/www/multisite/sites/site1

  &lt;Directory /&gt;
    Options FollowSymLinks
    AllowOverride All
  &lt;/Directory&gt;
&lt;/VirtualHost&gt;


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/
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