Teach you how to build a good-looking community and easily deploy Cpolar+HYBBS forum on Ubuntu

Preface

When the domestic Internet just started, the content on the Internet was far from as rich as it is today. Even the major Internet companies that are familiar today had not yet been born. At that time, when Internet users went online, most of the time they could only browse news on portal websites, or post fake news on various BBSs. With the development of the times, the content and applications of the Internet have gradually become richer. The once-unparalleled BBS forums have also lost their halo and gradually become ancient memories. However, the communication method of BBS forum has not been left behind with the rise of instant messaging. In many cases, posting information on BBS forums is still an effective way to communicate with like-minded strangers (or within the industry or company). Today, the author will introduce to you how to use Cpolar+HYBBS to build a beautiful, lightweight and powerful forum website on the Ubuntu system.

1. HYBBS website construction

HYBBS is a relatively well-known open source BBS web page. Although it is a lightweight forum program, its functions are not weak. You can add more functions and appearance interface to HYBBS by installing functional plug-ins and appearance templates. The most important thing is that HYBBS's lightweight design will not add too much burden to the author's old computer equipment.

1.1 HYBBS website installation

The user group of the HYBBS forum is not small, so it has its own official website (flarum.hyphp.vip/), where we can communicate with other HYBBS users and obtain various technical support and troubleshooting.

img

On the HYBBS official website, we can see that HYBBS supports multiple versions of php (at least 5.4 and above), but the MySQL database software must be used.

In order to build the operating environment required for HYBBS, we need to first install Apache, MySQL, and PHP on the Pagoda panel (the so-called LAMP, if Nginx, MySQL, and PHP are installed under Linux, it is called LNMP).

Usually when you log in to the Pagoda Panel for the first time, as long as Apache, MySQL, and PHP are not installed on the local hardware device, the Pagoda Panel will automatically pop up asking you to choose which web page running programs to install.

img

We can also find the "Software Store" button on the left side of the Pagoda Panel's homepage (you can enter the local address in the browser: Pagoda Panel output port number) and click to enter the Software Store page. On this page, we can find commonly used website running support programs, including Nginx, Apache, MySQL, PHP, phpMyadmin, Tomcat, Docker manager, Redis, etc. We find the required software and click "Install" on the right side of the software entry to install it on the Ubuntu system.

img

After completing the installation of Apache, MySQL, and PHP software, we can click the "Installed" button at the top of the software store page to view the installed software. At the same time, you can also switch the version of each software here.

After the running environment required for the HYBBS website is built, you can start building the HYBBS website. Generally speaking, we need to put the website source code into the wwwroot folder of the Pagoda panel, and then run the website installation program. Fortunately, HYBBS can be quickly installed on the "One-click Deployment" page of the Pagoda Panel, which saves the author a lot of trouble.

We click "Software Store" on the left side of the main interface of the Pagoda panel. After entering the software store, find the "One-click deployment" button at the top of the page, enter the website page that can be deployed with one click, select the "HYBBS" entry, and click the "One-click deployment" button on the right side of the entry.

img

Next, the website basic settings window will pop up, where we can specify the basic information of the website, which includes:

Output port number - In the "Domain name" field, set it in the form of "Domain name to be set: Port to be used"; here I choose port 83 to output the HYBBS website

Root Directory – This field can be changed or not, but the content of this root directory will be linked to the “Domain Name” field, so I changed it to hybbs

Database – just fill in the database information we set up before;

PHP version – Some websites may require the use of a specific version of PHP. We can modify it in the PHP version field (provided that the corresponding version of PHP software has been installed). For example, this website requires php5.4, so here Also choose php5.4

After completing these settings, you can click the "Submit" button at the bottom of the window to create the HYBBS website.

img

After the website is created (almost instantly), the Pagoda panel will pop up the address of the created website and important website information (maybe database information, or website background login information).

img

The next step is to click the "Website" button on the left side of the pagoda panel of Ubuntu to enter the website list page, and you will see the HYBBS website that has just been installed and online.

img

1.2 HYBBS website test

We can access the local HYBBS website by entering the previously set HYBBS website address in the Ubuntu browser address bar.

img

Although the current website looks very simple, we can log in to the backend of the HYBBS website, add plug-ins and templates to the forum, and enrich the content and change the appearance.

img

img

1.3. Installation and registration of cpolar

After completing the deployment of the HYBBS website, you can install cpolar. To install cpolar on an ubuntu system, you can install it using a simple one-click installation script. As long as you enter the following command on the command line interface of Ubuntu, you can automatically execute the installation program (it should be noted that some Ubuntu versions may not have the curl tool installed, so it is best to execute the command "sudo aptinstall curl" to install the curl tool first).

Cpolar one-click installation script:

“curl -L

https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash”

img

After the Cpolar installation is completed, you can enter the command "systemctl start cpolar" to start cpolar.

img

At this time, the ubuntu system will pop up the authentication box for starting the service. We can enter the password of the ubuntu system.

img

Of course, we can also enter "cpolar version" to query the local cpolar version number instead of using the systemctl level command. As long as the version information can be displayed, the cpolar installation is complete.

img

In order to ensure that cpolar can run on the Ubuntu system for a long time and ensure the stable existence of the data tunnel, it is best to add cpolar to the Ubuntu boot auto-start list. As long as you enter the command "sudo systemctl status cpolar" in the Ubuntu command line interface, you can add cpolar to the self-starting list.

img

In order to ensure the data security of each user and create a separate data tunnel for each customer, cpolar uses user password and token code for user verification, so we need to register the user before using cpolar. The registration process is very simple. Just click "User Registration" in the upper right corner of the cpolar homepage and fill in the necessary information on the registration page to complete the registration.

img

img

After completing the cpolar user registration, we can use each user's unique token code to activate the cpolar client. As long as you log in to the cpolar official website, you can find the user's unique token code on the "Verification" page (or the "Connect Your Account" window).

img

Copy and paste this token code into the Ubuntu command line interface, and the cpolar client will write the token code into the local cpolar.yml file (token code activation only needs to be done once) as an identification of the user data tunnel. information. The specific command format is "cpolar authtoken user's unique token code".

img

2. Local web page publishing

At this time, we have installed the web page on the local device and also installed the cpolar intranet penetration program. Next, we can use cpolar to create a safe and efficient data tunnel for the local HYBBS website, so that our local web pages can be accessed on the public Internet. Visited.

2.1.Cpolar temporary data tunnel

Our HYBBS website can run normally, and cpolar can create a temporary data tunnel directly on the cpolar client to test the web page (the public Internet address is reset every 24 hours). To create a temporary data tunnel, we directly log in to the cpolar client on the local device (enter localhost:9200 in the browser address bar), and click the "Create Tunnel" button under the "Tunnel Management" item on the cpolar client main interface to enter Create tunnel settings page.

img

On the "Create Tunnel" page, we need to set several information settings, which include:

Tunnel name – can be regarded as the tunnel remark of the cpolar client, as long as it is convenient for us to distinguish, here we fill in the HYBBS test;

Protocol – The HYBBS website is a web page program, so choose the http protocol;

Local address – The local address is the output port number of the local website. Fill in 83 here according to our previous settings;

Domain name type – here we can choose whether the data tunnel we intend to establish is temporary or long-term. At this time, we are only conducting a temporary HYBBS access test first, so we choose "random domain name" (the second-level subdomain name and custom domain name are both long-term stable tunnels and need to reserve a public Internet address in the cpolar cloud).

Region – This is the location of the server. We can fill it in according to the actual location of use;

img

After completing these settings, you can click the "Create" button at the bottom of the page to establish a temporary data tunnel. After the temporary data tunnel is created, the cpolar client will automatically jump to the "Tunnel List" page under the "Tunnel Management" item, where we can see all cpolar's local data tunnels (whether temporary or long-term).

We can also manage the data tunnel here, including opening, closing, or deleting this tunnel. We can also click the "Edit" button to modify the information of this data tunnel.

img

The temporary public Internet address we created that can connect to the local website can be found in the "Online Tunnel List" under the "Status" item.

img

Paste the public Internet address shown here into the Ubuntu browser address bar to access the local HYBBS website page.

img

However, the data tunnel at this time is only a temporary data tunnel and will be reset every 24 hours. After the data tunnel is reset, the public Internet address generated by cpolar will change. If you plan to visit this web page again, you need to use the newly generated address.

2.2.Cpolar stable tunnel (cloud settings)

If we want to set up a long-term stable data tunnel for the local website, we need to upgrade cpolar to the VIP version first.

img

After Cpolar is upgraded to the paid version, you can log in to cpolar's official website, find the "Reserve" button on the left side of the user's homepage, click to enter cpolar's data tunnel reservation page, and generate a public Internet address (or data tunnel entrance). At this time, this address is not connected to the local software output port, so it can be regarded as a blank data tunnel.

img

On the reservation page, we can reserve data tunnels using multiple protocols. Here we select the "Reserve second-level subdomain name" field.

img

In the "Reserved second-level subdomain name" field, you need to make several simple settings of information, namely "region" (the area where the server is located, just select the nearest one), "second-level domain name" (which will eventually appear in the generated public Internet address , as one of the identifiers of the network address) and "description" (which can be regarded as a description of this data tunnel, as long as it can be distinguished from other tunnels). After completing these settings, you can click the "Reserve" button on the right to retain this data tunnel.

img

Of course, if you no longer plan to use this data tunnel, you can click the "x" on the right to easily delete it and save valuable tunnel quota.

img

2.3.Cpolar stable tunnel (local settings)

After completing the settings of the cpolar cloud and retaining the blank data tunnel, we returned to the local cpolar client and connected the blank data tunnel generated by the cloud with the local test page.

Open and log in to the cpolar client on the local device (you can enter localhost:9200 in the browser to access directly).

After entering the local cpolar client, click the "Tunnel List" button under the "Tunnel Management" item on the left side of the client's main interface to enter the local tunnel page, and then click the "Edit" button of the corresponding tunnel.

img

On the "Edit" page of the local tunnel (the same as the page for creating a local temporary tunnel), we only need to modify the "Domain Name Type" to tunnel the public Internet address reserved by the cpolar cloud with the HYBBS website data tunnel created by the local cpolar connect them.

Since we have reserved the data tunnel of the second-level subdomain name in the cpolar cloud, we changed it to "Second-level subdomain name" (if the reserved domain name is a custom domain name, check the custom domain name), and in the next line "Sub Domain "Fill in the reserved second-level subdomain name in the column. Here we fill in "HYBBStest".

img

After completing the change of "Domain Name Type", you can click the "Update" button at the bottom of the page to connect the blank data tunnel on the cpolar cloud with the local HYBBS website to create a new data tunnel that can last stably for a long time.

3. Public network access test

Finally, when we enter the "Online Tunnel List" page again, we will find that the public Internet address of the HYBBS website has changed. At this time, the data tunnel of the local HYBBS website can survive stably for a long time, allowing Internet visitors to access the local HYBBS website at any time. .

img

img

Summarize

From the overall operation point of view, the steps to build a HYBBS forum website locally and publish it to the public Internet using cpolar are not complicated. Using the idea of ​​building a HYBBS forum, we can also build other types of websites locally, and use the data tunnel created by cpolar to publish them to the public Internet so that everyone can access the website located on local Ubuntu.

Reprinted from cpolar pole cloud article: Use Cpolar+HYBBS to deploy high-looking forums on Ubuntu

Guess you like

Origin blog.csdn.net/qq_25749749/article/details/132811015