Drupal/C4/Hosting-a-Drupal-website/English

From Script | Spoken-Tutorial
Jump to: navigation, search

Title of script: Hosting a Drupal website

Author: Priya K

Keywords: Video tutorial, Drupal, web hosting, cPanel, database import, export, content, website


Visual cue
Narration
Slide 1:

Hosting a Drupal website

Welcome to the spoken tutorial on Hosting a Drupal website.
Slide 2:Learning Objectives
  • Get our content and database ready for our website
  • Host our Drupal website
  • Upload our local content on this website


In this tutorial, we will learn to-


  • Get our code and database ready for our website
  • Host our Drupal website and
  • Upload our local content on this website


Slide 3:

System requirement

To record this tutorial, I am using

  • Ubuntu Linux 16.04 OS
  • Firefox web browser


To record this tutorial, I am using
  • Ubuntu Linux 16.04 and
  • Firefox web browser

You can use any browser of your choice.

Slide 4a:

Pre-requisites

  • Working Internet connection
  • cPanel - web hosting control panel
  • A domain name


To practise this tutorial, you will need


  • A working Internet connection
  • A web hosting control panel such as cPanel and
  • A domain name


Slide 4b:

Pre-requisites


You should also have basic knowledge of Drupal.


If not, for relevant Drupal tutorials, please visit the link shown.

Slide 5:

Drupal hosting services

  • There are many web hosting services available such as
    • Godaddy
    • Bigrock
    • HostCats
  • These service providers are cPanel based
  • One has to pay for space


First let us learn about Drupal web hosting services.


  • There are many web hosting services available such as Godaddy, Bigrock and HostCats.
  • These service providers are cPanel based with an auto installer script.
  • One has to pay to buy some space from these providers.


To host a website, you will need the code and database of your local Drupal website.


Let’s open our local Drupal website which we are going to host.

Click Configuration menu We will clear the cache first.

To do that, click on the Configuration menu.

Click Development -> Performance Under Development, click on the Performance option.
Remove checkmarks of Aggregate CSS files, Aggregate JavaScript files Here, remove the checkmarks from Aggregate CSS files and Aggregate JavaScript files options.
Click Save configuration Click on the Save configuration button.
Click Clear all caches Now click on the Clear all caches button.


You can see that the caches are cleared.


<<PAUSE>>

Open the File browser Next we will keep our code ready.


To do that, open the File browser.

Go to drupal-8.2.6-0 Go to the folder where we have installed Drupal locally.
Go to apps -> drupal -> htdocs Now go to apps -> drupal -> htdocs folder.
Point to htdocs folder


Compress htdocs folder

Inside this htdocs folder, we have the code of our local website.


Let us compress or zip this folder.

Save it in Downloads folder. I will save this in the Downloads folder on my machine.


Now our code is ready.


<<PAUSE>>

Open phpMyAdmin Next we will get our database ready.


Let us open the phpMyAdmin of our local website.

Click bitnami_drupal8 Click on the database named bitnami_drupal8.
Click Export button Click on Export button in the top panel.
Choose Export method as Custom Then choose the Export method as Custom.
Under Object creation options, check Add DROP TABLE option Under the section Object creation options, put a checkmark on Add DROP TABLE option.
Click Go button Scroll down and click on Go button at the bottom.
Click OK button Click on OK button to save the file.
Open Downloads folde,

Point to bitnami_drupal8.sql, htdocs.zip


Open the default Downloads folder and see the exported sql file and the htdocs zip file.


<<PAUSE>>

Click Set Up button Next let us learn to set up a cPanel.


To do this, click on the Set Up button.

Point to codingfordrupal.info Here we have to choose our domain name.


I have already bought a domain named codingfordrupal.info.


You have to use your own domain name here.


Details of how to purchase a domain are given in the “Additional Material” link of this tutorial.

Click Next button Click on Next button.
Click Asia -> Next button Here we have to choose a data center.


I will click on Asia and click on Next button.

Type username In cPanel username, we have to give our username.
Click Generate a password button For the password, I will simply click on the Generate a password button.


You can type any username and password as per your choice.


Note down the login details for future use.

Click Next button Then click on the Next button.
Point to wordpress


Click No, not now -> Finish button.


After this, it asks us whether we want wordpress to build our website.


We are going to host a Drupal website.


So click on No, not now button, then click on the Finish button.

Click Manage button It could take several minutes to complete the setup.


Once the setup is done, we will see a window like this.


Here, click on the Manage button.

Point to Website Name, IP Address Our cPanel main window has opened now.


We can see our Website Name, IP Address, etc.

Please have a look at this page and explore the options thoroughly.


<<PAUSE>>

Open the File browser

Go to drupal-8.2.6-0

Next we have to create a database in the cPanel.


Open the File browser and go to the folder where you have installed Bitnami Drupal Stack.

Go to apps -> drupal -> htdocs -> sites -> default -> settings.php


Point to settings.php

Now go to apps -> drupal -> htdocs -> sites -> default -> settings.php


The settings.php file will be open in an editor.

Scroll down


Point to database details

Scroll down to the end of the file.


Here you can see the database details.


You have to use these details to create a database in the cPanel.

Switch to cPanel main window Switch to cPanel main window.
Under Databases, click MySQL Database Wizard Under Databases, click on MySQL Database Wizard.
Copy database name from settings.php


Paste it in MySQL Database Wizard

Now copy the database name from settings.php file.


And paste it as the database name in the MySQL Database Wizard.

Click Next Step button Click on Next Step button.
Copy & paste username & password Copy and paste the username and password.
Click Create User button Click on Create User button.
Check ALL PRIVILEGES option Put a checkmark on the ALL PRIVILEGES option.
Click Next Step button. Click on Next Step button.
Click Return to MySQL Databases


Point to database and user name

Click on Return to MySQL Databases.


Here we can see the database and the user which we created.


<<PAUSE>>

Click Home Next let us learn to install Drupal in the cPanel.


Click on the Home button in the top panel.

Under Web Application, click Drupal Under Web Applications, click on Drupal.
Click install this application button On the right side, click on install this application button.
Point to codingfordrupal.info Under Location, you can see the domain name.
Under Version, choose 8.2.6 Under Version, choose the version which you have installed in your local machine.


I will choose 8.2.6.

Under Settings, type Username &

Password

Under Settings, we have to give our preferred username and password for the administrator.


Note down the login details for future use.

In the Advanced, choose Let me manage these settings


In the Advanced section, we can set up the database, email and backup.


I will choose Let me manage these settings.

In the Database Management, choose Let me choose an existing database In Database Management, choose Let me choose an existing database.
In the Database Name, choose bitnami_drupal8 In the Database Name, choose the database which we created earlier.
In the Database Username, type bn_drupal and password In the Database Username and Password, give the details from the settings.php file.
In the Table Prefix, remove drupal_ In Table Prefix, keep the field empty.
Click Install button. Now click on Install button.
Click www.codingfordrupal.info Once the installation is done, we can see our website name here.


Click on it.

Our website is successfully hosted.


<<PAUSE>>

But we have to update it with our local content.


So let us learn to upload our local content on this website.

Switch to the cPanel main window

Click Home button

Switch to the cPanel main window and click on the Home button in the top panel.
Open File Manager of cPanel We will open the File Manager of the cPanel.
Point to Web Root


Click Go button

Make sure that the Web Root option is selected.


Click on the Go button.

Point to public_html


Click Upload button

Now we are in the public_html folder.


Click on the Upload button in the top panel.

Click Browse and select htdocs.zip file


Point to complete status

Click on the Browse button and select the htdocs.zip file from the Downloads folder.


The file is now uploaded successfully.


If you have a file that is bigger in size, please use Filezilla or any SSH client for uploading.

Close the window Now close this window.
Click htdocs.zip file In the File Manager window, go to htdocs.zip file and click on it.
Click Extract button Now to extract this file, click on the Extract button in the top panel.
Click Extract File button In the popup window that appears, click on Extract File button.
Double-click htdocs folder. Once the file is extracted, double-click on the htdocs folder.
Go to Sites Now go to the Sites folder.
Point to default folder


Change Permissions as 755

Here we will change the permission of the default folder.


To do that, click on the Permissions column and change it to 755.


This will give write permission to the user.

Go to default folder, select settings.php


Change permission as 600

Then go to the default folder and change the permissions of the settings.php file.


Once again, click on the Permissions column and change it to 600.


This will give write permission to user so that we can edit the settings.php file.

Click Code Editor button To open the settings.php file, click on the Code Editor button in the top panel.
Click Edit button Click on the Edit button.
Scroll down


Point to database details

Scroll down to the end of the file.


Here you can see the database details.

Remove unix_socket line Remove the unix_socket line.
Click Save Changes button Now click on the Save Changes button in the top panel.
Click Up One Level button Click on the Up One Level button in the top panel.
Click Up One Level button Once again, click on the Up One Level button.


Now we have to move this content to the public_html folder.

click Select All button.


To select the files and folders, click on the Select All button.
Click Move button Click on the Move button in the top panel.
Remove htdocs In the file path, remove htdocs.
Click Move Files button. Click on the Move Files button.
In side panel, go to public_html In the side panel, click on the folder public_html.


Now the folder public_html has been replaced with the code of our local website.


<<PAUSE>>

Switch to cPanel main window Next we have to import our local database to our live website.


To do that, switch to the cPanel main window.

In Databases, click phpMyAdmin. Under Databases, click on phpMyAdmin.
Click the database bitnami_drupal8 In the side panel, click on the database which we created earlier.
Click Import Click on the Import button in the top panel.
Click Browse button Then click on the Browse button.
Choose sql file Now choose the sql file which we exported from our local Drupal.
click Go button


Point to the success message

Lastly, click on the Go button.


You can see that the sql file has been imported successfully.

Type the website name Now open a new tab in the browser and type your domain name in the address bar.


Our Drupal website is hosted successfully.


<<PAUSE>>

With this, we come to the end of this tutorial.
Slide 7:

Summary

In this tutorial, we have learnt to-

  • Get our content and database ready for our website
  • Host our Drupal website and
  • Upload our local content on this website


Let us summarize.


In this tutorial, we have learnt to-

  • Get our code and database ready for our website
  • Host our Drupal website and
  • Upload our local content on this website


Slide 9:

Acknowledgement


The video at the following link summarises the Spoken Tutorial project.


Please download and watch it.

Slide 10:

Spoken Tutorial Workshops


The Spoken Tutorial Project Team conducts workshops and gives certificates to those who pass online tests.


For more details, please write to us.

Slide 11:

Acknowledgement


Spoken Tutorial Project is funded by
  • NMEICT, Ministry of Human Resource Development and
  • NVLI, Ministry of Culture

Government of India.

This is Priya from IIT Bombay. Thanks for joining.

Contributors and Content Editors

Priyacst