Create a new subdomain

Published in

Description of the process of creating a new suddomain and having it running on the existing Drupal installation of the main domain with a subdomains seperate database.

  • On cPanel in category Domains go to Subdomains.
  • Create the subdomain with the document root being the main domain folder. Example: example.sharmweb.net with document root public_html (or public_html/sharmweb if the existing domain is not in the root of the account).
  • Go back to cPanel to create the database in category Databases go to MySQL Database wizard. Name the database most identical to the sitename as possible (without the extension, no dashes). As username the first 7 characters of the database name and password identical to the planned Drupal administator password.
  • In the next step check All priviliges and Return to Home.
  • In cPanel in the category Files go to File Manager. Go in the main domains sites folder and create a new folder with exactly the same full name as the subdomain, so including the name of the main domain plus extension. Example: within the folder shamweb/sites/ create a new folder example.sharmweb.net .
  •  Copy the file default.settings.php into the newly created folder and rename it to settings.php.
  • Still selected settings.php, click the icon Code Editor in the top toolbar. Go to line 92 $db_url = 'mysql://superaccount_username:password@localhost/superaccount_databasename'; and change appropriate. Exit by Save Changes.
  • In a new browser window go to the file install.php in the newly made website. Example: http://example.sharmweb.net/install.php .
  • If everything went smoothly in the previous steps, you should see a Drupal screen. Click Install Drupal in English .
  • Configure the site as follows:
    • Site e-mail adress: 
    • Username: admin
    • E-mail adress: noreply@sharmweb.net (only for now, we modify later)
    • Password: something you easily remember  (neglect any warning about not being secure enough)
    • Leave everything else like it is. Clean URLs should be enabled.
  • Click Save and continue and confirm to go to the site. You should now see the welcome page.
  • In cPanel go to File Manager on settings.php, then click the icon Change Permissions and check if all the write permissions are taken away for security reasons. It should result 555. If you want you add the folders Modules and Themes.
  • Go to Hotlink Protection and add the new subdomain as URL to allow access.
  • In the next chapter we will configure the standard functionality we want in our website.