How Easily Upload Your Website Via cPanel?

HOW EASILY UPLOAD YOUR WEBSITE VIA CPANEL

Your website runs perfectly on localhost (only you can access to your website), but now you want your friends, coworkers, and everybody to be able to see your achievement. Alternatively, you may have been dissatisfied with current hosting providers and now wish to try out 1Byte’s web hosting service.

Prerequisites

(Here is a basic blog at my localhost. And now I want to put my website goes live)

1) Web Hosting or Cloud Server

→ In this tutorial, I will be using Shared Hosting + cPanel

(If you want to upload your website to Cloud Hosting, please check this POST)

2) Domain name

→ A domain name is required for Web Hosting. If you don’t have a domain, purchase here.

3) Your website data

Let’s get started

Step 1: Config your domain point to your Shared Hosting

  • Go to User Dashboard
  • Select Domain at the left menu bar
  • Select Manage button at the domain you want to point
  • At the nameserver section, choose 1Byte DNS
(Domain hobbykh.fun will be used for our basic blog, and it is pointing to Shared Hosting)  

Step 2: Basic check at cPanel control

  • Go to User Dashboard
  • Select Shared Hosting at the left menu bar
  • Choose the Shared Hosting server where your website will be hosted
  • Click on cPanel to go cPanel Dashboard
(I will select Shared Hosting from the second line)

On the right side of the cPanel Dashboard, please be sure that your domain name is shown up in here

(When registering to purchase and use Shared Hosting, the domain hobbykh.fun is assigned to this hosting) 

Step 3: Upload your website data into this Shared Hosting

At cPanel Dashboard, navigate to Files section and select File Manager

(cPanel File Manager gives you useful options to quickly manage your files within the cPanel interface. This is the place where you can upload your website data)

Go to the public_html directory (1), then upload your website data (2), finally extract the zip file (4)

(The data for the website “Basic Blog” has been compressed into a zip file and transferred to Shared Hosting under the folder named “public_html”)
(All the data of website was extracted inside the “public_html” directory)

Step 4: Try to access your domain name to see whether your website is up and running

(As you can see, our website is up & running)
(However, there is one more issue: we have not set up the database for this Shared Hosting, which is why we get the error message given in the image.)

Step 5: Setting up the database, and connecting the database to your website

NOTE: If your website is basic and does not need a database, you may skip this step entirely.

  • Go back to cPanel Dashboard
  • Navigate to Databases section and select MySQL® Databases
(Use this feature to create, manage, and delete MySQL® databases and database users)

Inside the MySQL® databases, you need to create 3 things

1) Create a database for your website

2) Create a user for the database

3) Add the user into the database

4) Grant privileges to this user

 (1) my database name is “yyxscwziwezmbmnu_ blog”

 

(2) my Database username is “yyxscwziwezmbmnu_ admin” and I already set this password for this account
(3) Adding database user into database name
(4) Give this user permission to use the database)

Step 6: Import your website’s database into the Shared Hosting database via cPanel

  • Go back to cPanel Dashboard
  • Navigate to Databases section and select phpMyAdmin
(phpMyAdmin is a third-party tool that you can use to manipulate MySQL® databases)
(You can see that the database name created in Step 4 will be automatically added in phpMyAdmin)

Now import your database into phpMyAdmin on Shared Hosting

(The file is called “blog,” and it was exported from the phpMyAdmin database on localhost. We’ll now re-import this file into phpMyAdmin on Shared Hosting)
(As you can see, all the tables have been successfully imported into the database)

Step 7: Configure your database connection PHP file

You must first know the following information before proceeding with this step.

1) What port does phpMyAdmin use?

(phpMyAdmin is running on localhost at Port 3306)

2) Which file should be used to establish a connection to MySQL?

(file dbconnect.php is used to open connection to MySQL. But we still need adjust the info inside this file)

3) What is the name, username, password of the database (already in Step 5)?

  • DB_Name: yyxscwziwezmbmnu_ blog
  • DB_Username: yyxscwziwezmbmnu_ admin
  • DB_Password: *****

→ We will use this info to adjust the file dbconnect.php

After you have the aforementioned information, go to the Files section of your cPanel Dashboard, click File Manager, search for the PHP file used to connect to phpMyAdmin on Shared Hosting

As previously noted, the dbconnect.php file is used to connect to phpMyAdmin. And we need to update the information in the file as below

(Remember that you must input the correct DB_Name, DB_Username, DB_Password as you did in Step 5)

Step 8: Re-check again

Now you need to check to see if there are any more errors? whether your website can use the database from phpMyAdmin on Shared Hosting or not?

 (As you can see, everything is in working order.
All database posts may now be displayed on the website, and there are no error warnings)

Conclusion

After reading this post, you should be able to upload your website to the 1Byte platform and move your existing website over to 1Byte.