How to Easily Upload Your Website in aaPanel?

HOW EASILY UPLOAD YOUR WEBSITE WITH AAPANEL

Your website runs perfectly on localhost (only you can access 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.

How to Easily Upload Your Website With aaPanel?

How to Easily Upload Your Website With aaPanel on 1Byte?

1) Web Hosting or Cloud Server

→ In this tutorial, I will be using Cloud Hosting + aaPanel

(If you want to upload your website to Shared 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

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

10 Steps to Easily Upload Your Website With aaPanel?

Step 1: Config your domain point to your Cloud Hosting

  • Go to User Dashboard
  • Select Domain at the left menu bar
  • Select the Manage button at the domain you want to point
  • At the Nameserver section, choose Basic DNS and Save changes
(Domain gundamkh.fun will be used for our basic blog, and it is pointing to Cloud Hosting)
(Domain gundamkh.fun will be used for our basic blog, and it is pointing to Cloud Hosting)
  • Navigate to DNS Management section
  • Click ADD NEW RECORD  and choose A Record on the drop-down list
  • Put the value of the Host field and Value field as in the image below
(Please remember to input your IP Address of Cloud Server in the Value field)
(Please remember to input your IP Address of Cloud Server in the Value field)

Finally, click Save

Step 2: Login into your aaPanel of Cloud Hosting

  • Go to  User Dashboard
  • Navigate to the Cloud Hosting option on the left menu bar
  • Choose aaPanel to login inside its dashboard
(In this demo, I will use the Cloud Hosting that has IP 220.158.232.76 to host Basic Blog)
(In this demo, I will use the Cloud Hosting that has IP 220.158.232.76 to host Basic Blog)

Step 3: Install LNMP one-click installation package

Installing the LNMP one-click installation package will be recommended to you when you log in to aaPanel.

(The LNMP architecture is one of the most popular web stacks in the world and it is known as the golden combination of web applications under Linux. The stack includes CentOS Linux, NGINX, MySQL, and PHP)
(The LNMP architecture is one of the most popular web stacks in the world and it is known as the golden combination of web applications under Linux. The stack includes CentOS Linux, NGINX, MySQL, and PHP)

NOTE:

In case you accidentally turned off this suggestion, you can still reinstall the following packages by doing follow steps

  • Go to App Store section
  • In the Search App, type the packages that you want to install
  • The packages LNMP includes NGINX, MySQL, PHP, phpMyAdmin
  • Select the version you want, then click Install to begin the installation process
(This is how to reinstall LNMP packages if you mistakenly turned off the system's suggestion to install them)
(This is how to reinstall LNMP packages if you mistakenly turned off the system’s suggestion to install them)

Step 4: Creating a web root (directory to store all your website data)

  • Go to Website section
  • Click on Add site button
  • Add your domain name in the Domain name field (Note: It’s important to include your domain name with and without www)
  • Click Submit to finish
(These steps in the image above will create a web root in /www/wwwroot/gundamkh.fun)
(These steps in the image above will create a web root in /www/wwwroot/gundamkh.fun)
(As depicted in the image above, your site root information will be displayed)

Step 5: Uploading your website data into the web root

  • Go to the Files section
  • Be sure that you go inside your web root path
  • Remove all files inside your web root directory
(These are the files that come pre-installed with the web server and are unnecessary)
(These are the files that come pre-installed with the web server and are unnecessary)
  • Click the Upload button to upload your website data
  • Specify the absolute path of your website data
  • Proceed to Upload
(Remember that your website data needs to be compressed in zip or rar format)
(Remember that your website data needs to be compressed in zip or rar format)

Finally, unzip this compressed file

(All data files of the website are located inside the web root)
(All data files of the website are located inside the web root)

Step 6: Checking if your website is up or not?

You need to type your domain name in the browser’s URL field

(As you can see, the website for the Basic Blog is now live and available to the public.
Why not take a look around at these sites?)
(As you can see, the website for the Basic Blog is now live and available to the public.
Why not take a look around at these sites?)
(We can observe from this URL that the Basic Blog website is unable to make a database connection. Because we never created a database for it from the beginning to this step)
(We can observe from this URL that the Basic Blog website is unable to make a database connection. Because we never created a database for it from the beginning to this step)

Step 7: Creating a database for this website

  • Go back to the aaPanel Dashboard
  • Navigate to the Databases section on the left menu bar
  • Click on Add Databases button
  • Name the database, set up an account for this database
  • Click on Submit to finish
(We must remember DB Name, DB Username, and DB Password in this case.
Because we will later use this information to configure the connection in the php file)
(We must remember DB Name, DB Username, and DB Password in this case.
Because we will later use this information to configure the connection in the php file)
(After successfully creating the database, you should see the general information about the database  similar to the image above)

Step 8: Import your website’s database into the Cloud Hosting via aaPanel

In Databases section, click on phpMyAdmin so that you can log in to phpMyAdmin Dashboard

In Databases section, click on phpMyAdmin so that you can log in to phpMyAdmin Dashboard

After logging inside the phpMyAdmin dashboard, choose your database name, click Import and Import your mysql file (database file)

(The file blog.sql is the database export file under localhost.
This file contains all of the website database's data, and we will now import it into phpMyAdmin on aaPanel - Cloud Hosting)
(The file blog.sql is the database export file under localhost.
This file contains all of the website database’s data, and we will now import it into phpMyAdmin on aaPanel – Cloud Hosting)
(You will see all the tables of the database have been imported successfully)
(You will see all the tables of the database have been imported successfully)

Step 9: Configure your php file to connect this database

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

1) What port does phpMyAdmin use?

(phpMyAdmin is running on localhost)
(phpMyAdmin is running on localhost)

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

(The file dbconnect.php is used to establish a connection to MySQL.
However, the information in the image below is for connecting to a local database, not for Cloud Hosting.
As a result, we must modify this information. )
(The file dbconnect.php is used to establish a connection to MySQL.
However, the information in the image below is for connecting to a local database, not for Cloud Hosting.
As a result, we must modify this information. )

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

  • DB_Name: basic_blog
  • DB_User: admin
  • DB_Password: dn7KyTjT4DXpnFX5

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

After you’ve gathered all of the necessary information, we’ll return to the aaPanel Dashboard, navigate to the Files section, and locate the php file used to connect to phpMyAdmin.

(As previously noted, the dbconnect.php file is used to connect to phpMyAdmin.
And we need to update the information in this file)
(As previously noted, the dbconnect.php file is used to connect to phpMyAdmin.
And we need to update the information in this file)
  • Double click to the file so that you can open text editor online
(Please replace DB_Name, DB_Password, DB_Username with your info inside this file)
(Please replace DB_Name, DB_Password, DB_Username with your info inside this file)

Step 10: Rechecking your website again

This step is similar to Step 6, access your domain name on the URL bar to check

(Unlike in step 6, all of the data in the database has been linked to the website, and it is now rendered outside of the website.
As well as you will no longer see the error message when connecting to MySQL)
(Unlike in step 6, all of the data in the database has been linked to the website, and it is now rendered outside of the website.
As well as you will no longer see the error message when connecting to MySQL)

Conclusion

Congratulations! You have successfully uploaded your website using aaPanel. Keep in mind that specific steps may vary slightly depending on your hosting provider and the version of aaPanel you’re using. If you encounter any issues during this process, refer to aaPanel’s documentation or contact your hosting provider’s support for assistance.