Let's suppose you already have a domain setup and running Drupal 7 code for your website and you manage your hosting using cPanel. As as example, let suppose a running website example.com is a drupal 7 website and another.example.com as a multisite that we wanted to create.
Below are the steps that I followed to achieve it.
1. Login to your cPanel and Go to "MySQL® Databases" options.
2. Create a new database let's say "anotherdb"
3. Add a new MySQL user like "anotherappuser" with a strong password.
4. Add user "anotherappuser" to database "anotherdb" with all privileges. All these steps are available in the same cPanel page of "MySQL® Databases".
5.Then go to the "Subdomains" in cPanel, create a subdomain. "another.example.com".
6. Go to "file manager" and in your "/home/example/" directory, you will be able to see a folder called "another.example.com", cPanel has made for the subdomain, delete this folder.
7. Go to within "public_html" folder then go to within "sites" folder, you will be able to folders like "all", "default". Create a folder with name "another.example.com".
8. Copy "default.settings.php" and "settings.php" files from "/sites/default/" and paste it to the folder you've just made.
9. Open "settings.php" in edit mode and update the database configuration with new database name, db user and password and save it.
10. Go back to "public_html" folder and create a file called "createsymlink.php" and copy the following code and save it. Please change the names as per your setup.
<?php
symlink( '/home/example/public_html/', '/home/example/another.example.com' );
?>
11. Visit the file with your browser by going to "example.com/createsymlink.php" once, there won't be anything fancy as output.
12. Now all the configuration is done, now visit "another.example.com/install.php" and follow the onscreen instruction.
13. Once completed, browse "another.example.com". Your site is ready.
Once the site is working do not forget to remove "createsymlink.php" that you have created.
- 50 reads