Website Management

12007

Function Overview

Click on "Website" in the left menu of the Jianghu panel to enter the website management page. Users can see a list of all websites deployed on this server and can create, manage, and delete websites on this page, allowing for convenient operations on the websites hosted on the server.

1. Add Site

Taking the creation of a static site as an example, after entering the website management page, click "Add Site":

  • Enter the domain name, any name will do, such as 8000.com
  • Fill in the remarks and select the website root directory
  • Click submit

wz1.png

This successfully creates the site, and you can see the data for the new site on the website page.

wz2.png

2. Modify Default Page

Modifying the default page is intended to provide a better user experience, ensuring that the displayed content of the site meets user needs and brand image. The types of default pages that need modification include:

  • Default Document: The prompt page generated by default when the site is created.

  • 404 Error Page: The error prompt page returned by the server with a status code of 404.

  • Blank Page: Nginx blank page/Apache blank page: The error page displayed when the server cannot find the corresponding site.

  • Default Site Stopped Page: A page used to inform about site stoppage. Please do not modify this if there are no relevant requirements.

wz3.png

Select the type of page to modify, and an HTML editor will pop up. After making changes, click "Save" to apply.

wz4.png

3. Default Site

After setting a default site, all unbound domain names and IPs will be directed to the default site, effectively preventing malicious resolution.

wz5.png

4. Category Management

Sites can be categorized, allowing for the addition, editing, and deletion of custom website types.

wz6.png

7. PHP Command Line Version

Here you can set the PHP version to be used when running PHP from the command line. Note: PHP must be installed in the software management section, and this setting needs to be updated after installing a new PHP version.

wz7.png

8. Obtain Site Host Configuration

The site Host configuration is a text file used to map the relationship between IP addresses and domain names. Here, you can open the site Host configuration with a text editor to view its contents.

wz8.png

9. Site Suspension and Operation

  • Suspend Site:

In the row of the site to be suspended, click "Running" under the network status, and the following pop-up will appear. After clicking "OK," the site's status will change to "Suspended."

江湖面板停用站点.png

  • Open Site:

Click the "Open Site" icon next to each site domain name to open the homepage of the site in a new browser tab. If multiple sites are selected, the "Open Site" button will appear on the right side of the list, allowing you to open the homepages of all selected sites. This feature makes it easy to check whether each site is running properly.

江湖面板打开站点.png

Note: After stopping a site, the webpage will be inaccessible. If the site can still be accessed after stopping, please clear your browser cache and try again later.

4. Settings

The Jianghu panel's site settings provide comprehensive functionality, allowing users to manage site domains, bind subdirectories, configure website directories and traffic limits, define pseudo-static rules, set default documents, edit configuration files, enable SSL encryption, select PHP versions, configure redirection and reverse proxy, implement anti-leeching, and view response and error logs. This series of features enables users to flexibly customize sites, optimize performance, enhance security, and conveniently view logs and troubleshoot issues.

Domain Management

Click "Settings" corresponding to the site, and a pop-up window will appear, allowing you to add domain names bound to the site in domain management. Multiple domain names can be bound.

wz9.png

Note: When adding a bound domain name, it cannot be a wildcard domain name, and the domain is bound to port 80 by default.

Subdirectory Binding

Adding subdirectory binding allows you to bind a domain name to a subdirectory under the WEB site. Simply fill in the domain name for the subdirectory binding and select the subdirectory address, then choose to add to bind the subdirectory.

  • Domain Name: Fill in the domain name for the subdirectory binding.
  • Subdirectory: Select the name of the subdirectory folder.

wz10.png

Website Directory

You can set the directory address of the current site, the running directory of the site program, prevent cross-site attacks, and write access logs.

wz11.png

  • Prevent Cross-Site Attacks: Enable prevention of cross-site attacks

By limiting the range that PHP scripts can access, preventing cross-site attacks (open_basedir) can enhance server security and prevent malicious scripts from accessing other data and applications on the server. It's like restricting children to play only in the yard and not on the street, thus protecting their safety.

For example, if open_basedir is set to /www/wwwroot/bt.cn/public_html, then PHP scripts can only access files and subdirectories within the /www/wwwroot/bt.cn/public_html directory and cannot access other directories. This protects other data and applications on the server from being accessed and damaged by malicious scripts.

  • Write Access Logs: Enable writing access logs

When enabled, it will record all access logs and error logs for the site. When you need to check for access errors on the website, you can also enable this feature to log errors for analysis.

  • Website Directory: Modify the file directory of the current site, and click save to apply the changes.

  • Running Directory: Modify the website's running directory. Different programs may have different running directories, such as ThinkPHP, Laravel. Click save to apply the changes (default is the website's root directory).

Note: Some websites may have their actual running directory not in the website's root directory but in a subdirectory (second-level directory). If your project is in this situation, you can use this feature to specify it.

  • Password Access: Enable password access for the site, requiring a username and password to access the site.

Traffic Limitation

You can set corresponding traffic limits to control the network bandwidth usage of the site. When your server's bandwidth is insufficient to support normal use of your website, you can use this feature to limit traffic. For example, if my server bandwidth is only 5M, it can only support 20 people accessing simultaneously. If it reaches 30 people accessing at the same time, my website will start to experience slow access or become inaccessible. By using the traffic limitation feature, you can limit the access speed for each user to my website. Although the access speed slows down, it is not enough to cause the website to crash, allowing more people to access the site.

  • Limitation Plan: The Jianghu panel provides the following plans: forum/blog, image site, download site, mall, portal, enterprise site, video site. The above plans are for reference only; you can modify the parameters based on personal needs.

  • Concurrent Limitation: Limit the maximum number of concurrent accesses for the current site.

  • Single IP Limitation: Limit the maximum number of concurrent accesses from a single IP.

  • Traffic Limitation: Limit the traffic upper limit for each request (unit: KB).

  • After making modifications, click "Save and Enable" to complete.

wz12.png

Pseudo Static

You can use rules to convert dynamic web pages into static web pages, improving website access speed and helping to enhance the website's ranking in searches. The Jianghu panel also provides a set of commonly used pseudo-static rule templates, allowing you to select pseudo-static configurations based on your website type for quick setup.

  • Pseudo Static Template: Use the dropdown button to view and select the configured pseudo-static files (including commonly used pseudo-static templates).

wz13.png

Default Document

Sites created in the Jianghu panel will include the following default site documents (index.php, index.html, index.htm, default.php, default.htm, default.html). If no special settings are specified, the site will access the default site through the above document names.

If you do not want to use names like index.XX, you can add new default documents, for example, adding: 1.html will allow accessing 1.html in the root directory of the site as the default opening page.

wz14.png

Configuration File

After the website is created, reverse proxy configuration is also required. A reverse proxy is a server that sits between the client (usually a web browser) and the actual backend server providing services. Its main function is to receive requests from clients and forward them to the backend server according to certain rules. Configuring the reverse proxy involves setting these forwarding rules.

wz15.png
Click "Configuration File," copy the following configuration code, and paste it into the configuration file. This code adds a reverse proxy configuration that proxies the port 7201 used by the project to the domain name.

server {
    listen 80;
    server_name www.example.com; # Change www.example.com to your domain here
    
    # Configure root directory to forward to port 7201
    location / {
        # Forward requests to the backend API server
        proxy_pass http://localhost:7201;
        
        # Some HTTP header processing for reverse proxy
        proxy_http_version 1.1;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Host $host;
        proxy_cache_bypass $http_upgrade;
    }
}

For an explanation of the above code, you can refer to Jianghu Training - Beginner - 104 System Operation and Maintenance Course's Lesson 8: Jianghu Panel - Website Management.

Note: If you are not familiar with configuration rules, do not modify the configuration file at will, as it may cause the site service to fail to start or become inaccessible.

SSL

SSL certificates can help us protect the security and privacy of communications and data transfers conducted over the Internet. SSL certificate applicable scenarios: Using SSL certificates can protect sensitive information you enter (such as account passwords, credit card numbers, etc.) from being stolen by hackers, ensuring the security and privacy of information during transmission through encrypted HTTPS communication. At the same time, SSL certificates can also help improve the website's ranking in search engines, making it easier for users to find and use these websites.

wz16.png

The steps to configure SSL certificates in the Jianghu panel are as follows:

  • Log in to the Jianghu panel, select the website list, choose the website that needs to configure the SSL certificate, and click SSL -> Let's Encrypt.

wz17.png

  • On the SSL certificate management page, fill in the SSL parameters: select the domain name to be bound, set the email address, and choose options like automatic updates.

wz18.png

  • Click apply and wait for the certificate application to complete. The Jianghu panel will automatically bind the SSL certificate to the website.

wz19.png

  • After the certificate binding is complete, check the current certificate to see if the bound SSL certificate is deployed.

wz20.png

Note: The above steps are for situations using the Jianghu panel. If using other panels or configuring the server manually, corresponding steps are required.

PHP Version

You can modify the specified PHP running version for the current site, suitable for users who have installed multiple PHP versions. It supports custom PHP connection configuration information for operation and also supports modifying the site to be a pure static site, not running through PHP services.

PHP.png

Note: PHP7 does not support the mysql extension; it defaults to installing mysqli and mysql-pdo.

Redirection

Redirection refers to when a user accesses a certain URL, Nginx redirects the user to another URL. The effect of redirection is similar to looking for a place in real life, but you took the wrong direction and need to turn back to find the correct route.

For example, suppose you have an old website with the URL: http://192.168.10.112, and now you want to redirect it to your new website, which has the URL: https://www.openjianghu.org.

cdx.png

With this setting, every time I access http://192.168.10.112, it will redirect to https://www.openjianghu.org.

  • Retain URI Parameters:
    Indicates whether the URL accessed after redirection retains sub-paths or parameters. For example, if you set access from http://b.com to redirect to http://a.com, if URI parameters are retained, then `http://b.com/1.html