Creating Your First Website

12006

Learning Objectives

  • Create a Website: Create a new website in the Jianghu panel, including selecting a domain name, setting the website directory, and configuring basic information.
  • Website Deployment: Deploy website files to the server to ensure the website runs smoothly.
  • Domain Management: Manage domain names in the Jianghu panel, including adding domain names, setting domain resolution, and configuring domain redirection.
  • Open Website Ports: Configure open ports in the Jianghu panel to allow access to the website.
  • Access the website via IP + port, domain name, etc.

1. What is a Website?

A website is a location on the internet composed of a series of related web pages, which typically contain text, images, videos, and other multimedia content. Each website has a unique address known as a URL (Uniform Resource Locator), which users can access through a web browser to view the website's content.

2. Creating a Website Using the Jianghu Panel

Log in to the Jianghu panel, click on the "Website" section on the left sidebar to enter the website management page.

  • Enter a domain name, such as 8000.com.
  • Fill in the notes and select the website root directory.
  • Click submit.

You will see a new site listed on the website page.

Jianghu Panel - New Site.png

3. Website Directory Deployment

  1. After entering the Jianghu panel, click on the "Files" section on the left sidebar to access the file management page.
  2. The website directory is generally located under /www/wwwroot/.
  3. For example, if the site we just created is 8000.com, you can find this folder in that directory.
  4. Clicking into it, you will see a default index.html file. The content of this file is the content of the website.

Jianghu Panel - Website Root Directory.png

4. Domain Management

  1. Go to the website list page.
  2. Find the target website 8000.com, click the "Settings" button in the right action bar, and select the "Domain Management" option.
  3. Local port deployment: Fill in the domain information in the text box, such as 127.0.0.1:8000, and click the "Add" button.

Jianghu Panel - Add Domain Configuration for Website.png

5. Open Website Ports

  1. Go to the Jianghu panel - Security page.
  2. In the form at the top of the firewall card, select "Allow Ports".
  3. Enter the port that needs to be opened (e.g., 8000).
  4. Select TCP as the protocol.
  5. Fill in the notes/description for the current port (e.g., My Website).
  6. Click "Allow" to successfully add it.

Jianghu Panel - Open Website Port.png

6. Accessing the Website

Local Access:
Locally, you can access the website in a browser using IP + port (e.g., 127.0.0.1:8000). Below is the result of accessing it using Firefox on a Debian system:

Jianghu Panel - Local Access to Website.png

Host Access:
If accessing from the host, you can use the virtual machine's IP + port to access the website (the virtual machine's IP can be obtained by using the ip addr command in the virtual machine). Below is the result of accessing it using the virtual machine IP + port number on a Windows computer:

Jianghu Panel - Host Access to Website.png

Accessing via Domain Name:
If you want to access the website using the domain name you set, you need to modify the Hosts file on your local computer. The Hosts file is a configuration file in the operating system that contains the mapping of domain names to IP addresses, essentially acting as DNS on your local computer. You can modify the Hosts file directly or use a Hosts editing tool.

Add the following line to the Hosts file, and then access 8000.com in your browser to visit the website:

192.168.100.114	8000.com  

Here, 192.168.100.114 is the server's IP address, and 8000.com is the domain configured on the server. You need to modify these two values according to your server's actual configuration.

Assignment

Based on the content of this article, create a static site with the following requirements:

  • It can be accessed using IP + port.
  • The homepage outputs "hello, world".