I want to create a multisite with Drupal 7: Every site works separately but users, and nodes must be shared among the sites.
How do I achieve it?
You can change the settings for the access to the database that are contained in the settings.php file used by your Drupal site to something similar to the following one (replace the values between brackets with the correct values for your site):
$databases['default']['default'] = array(
'driver' => '[Your database engine]',
'database' => '[Your database name]',
'username' => '[Your username for the access to the database engine]',
'password' => '[The password for the access to the database]',
'host' => 'localhost',
'prefix' => array(
'default' => 'main_',
'users' => 'shared_',
'sessions' => 'shared_',
'role' => 'shared_',
'authmap' => 'shared_',
),
'collation' => 'utf8_general_ci',
);
Sharing users and content between different domains is what the Domain Access module is for. Essentially, it allows you to run multiple Drupal sites out of the same database, and share content.
When you install, enable, and configure the module, a new tabs shows up on the node edit page which allows you to target a node for particular domains. It also plays nicely with views, panels, and other modules that use ctools selections rules.
This solution is different than true multisite, which is a common set of core and contrib files, but different databases for different sites.
This is a bit complicated, but you can create a multi-site environment with shared users and multiple databases. I think it gets very complicated if you want to have separate databases with shared users AND nodes. Have a look at this document for more information about the different setups with pros and cons.