[Use Cpolar and Qchan to build your own personal picture bed]

Preface

Image bed is an important application scenario of cloud storage. With the efforts of a large number of developers, a large number of dedicated image bed programs have been developed. Some of these programs are large and comprehensive, some are small and beautiful, and they perfectly cover different strengths of images. Application scenarios. With the development of small hardware (such as Raspberry Pi, etc.), the ultra-lightweight image bed program has a new vitality. Today, the author will introduce an ultra-lightweight picture bed program qchan, and cooperate with cpolar to create a private picture bed.

1. Qchan website construction

Qchan is an open source image platform program. Its operation only relies on PHP5.3 and above. It does not require a database or pseudo-static rules. If you need to move, you can just pack it up and take it away, which is very convenient. Although qchan's operating environment requirements are very low, its functions are not weak. It has the functions of general image bed software, such as batch upload, URL upload, drag and drop upload, automatic generation of thumbnails, etc. It's basically enough for an individual.

1.1 Qchan download and installation

As a free program, Qchan will naturally have a place on github. However, given the Schrödinger status of github, it can also be downloaded from other addresses (https://zhujiwiki.com/wp-content/uploads/2017/09/1323520562.zip)

(https://github.com/qakcn/qchan)

img

After the Qchan compressed package is downloaded, decompress it and paste it into the webpage running environment. The author uses the phpstudy integration panel, so paste the file into the WWW folder of phpstudy.

img

image-20230908134902023

Then, open phpstudy, click the "Website" button on the left side of the software's main interface to enter the website list page, and then click the "Create Website" button on the upper left side of the website list page to enter the settings page for the new website.

On the website settings page, there are not many things we need to set. We only need to set

Domain name - the domain name entered when accessing the Qchan website locally, you can enter it at will;

Port - the output port of the Qchan web page, as long as it is not occupied;

Root directory – that is, where the Qchan webpage files are stored. In this example, the author puts these files under the www folder of phpstudy;

Program type – Since Qchan is a lightweight web program and requires php5.3 or above to run, the author chose php5.5

After these settings are completed, you can click the "Confirm" button at the bottom to save the settings of the Qchan web page.

image-20230908134927671

1.2 Qchan web page test

Since there is no need for a database, php alone can run the qchan picture bed website. Therefore, we can directly enter "localhost: port number" in the browser address bar to access the qchan website, and then enter "localhost: port number/manage". Can enter the background of the qchan website, the default login name and password of the website are both "admin"

img

1.3 Installation and registration of cpolar

Like the Qchan web installation, the installation and registration of cpolar is also simple and easy. We directly visit cpolar's official website page (www.cpolar.com) and find the "Download" button.

img

The author is using the Windows operating system, so I chose the Windows version to download.

img

After the Cpolar download is completed, unzip the downloaded file and double-click the decompressed .msi file to automatically execute the installation program. Then just click "Next" to complete the installation.

img

image-20230908135210515

Since cpolar will create an independent data tunnel for each user, supplemented by user passwords and token codes to ensure data security, we need to register users before using cpolar. The registration process is also 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

image-20230908135300478

2. Local web page publishing

At this point, we have installed the Qchan web page locally and installed the cpolar intranet penetration program. Next, we can use cpolar to create a public Internet address that can connect to the local test page so that we can access it on the public Internet. Qchan website.

2.1 Cpolar cloud settings

Since the data tunnel of the free version of cpolar is reset every 24 hours, I don’t want to reconnect every day, so I upgraded cpolar to the VIP version to create a data tunnel that can exist stably for a long time and facilitate access to the local Qchan website at any time.

Next, we set about penetrating the local Qchan page into the intranet for public Internet access. To achieve long-term stable intranet penetration, you need to first log in to cpolar's official website, find the "Reserve" button on the left side of the user's home page, and click to enter cpolar's data tunnel reservation page.

A public Internet address is generated here (which can also be regarded as the entrance of the data tunnel). Since this address is not connected to the local program output port at this time, it can also be regarded as a blank data tunnel.

image-20230908135423925

On the reservation page, you can see many types of data tunnels that can be reserved. Here we select the "Reserve second-level subdomain name" field.

image-20230908135442410

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.

image-20230908135502940

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.

image-20230908135526079

2.2 Cpolar local settings

After completing the settings on 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 to the local Qchan page, allowing us to access the local test page on the public Internet .

Open and log in to the cpolar client locally (you can enter localhost:9200 in the browser to access it directly, or you can click the cpolar client shortcut in the start menu).

image-20230908135605960

Click the "Create Tunnel" button under the "Tunnel Management" item on the left side of the client's main interface to enter the local tunnel creation page (if you want to create a temporary data tunnel that resets the address every 24 hours, you can set it directly here without having to cpolar official website sets up a blank data tunnel).

On this page, you also need to make several information settings, which include:

Tunnel name – can be regarded as cpolar’s ​​local tunnel information annotation, as long as it is easy to distinguish;

Protocol – Since Qchan is a web program, choose the http protocol;

Local address – The local address is the output port number of the Qchan website, and the port we set is 81, so fill in 81 here;

Domain name type – In this example, we have reserved the data tunnel of the second-level subdomain name in the cpolar cloud, so check “Second-level subdomain name” (if the reserved domain name is a custom domain name, check the custom domain name) , and fill in the reserved second-level subdomain name in the "Sub Domain" column on the next line, which is "qchanweb" in this example. If you plan to create a temporary data tunnel, you can directly check "Random domain name", and the cpolar client will generate the network address by itself;

Region – The same as the information reserved in cpolar cloud, we can fill it in according to the actual place of use;

image-20230908135625493

After completing these settings, you can click the "Create" button at the bottom of the page to connect the blank data tunnel in the cpolar cloud with the local Qchan page, which provides us with a data tunnel that can access the local Qchan page on the public Internet.

Of course, we can manage this data tunnel on the "Tunnel List" page under "Tunnel Management", including opening, closing or deleting this tunnel. We can also click the "Edit" button to edit this data tunnel. information is modified.

image-20230908135642317

3. Public network access test

Finally, we click the "Online Tunnel List" button under the "Status" item on the left to find the public Internet address of this page. Paste this address into the browser to see the local Qchan page.

image-20230908135733649

image-20230908135744905

Summarize

Although the Qchan web program is very small, its functions are not weak. There are many private image bed programs like this. We can use the same process and use the cpolar intranet penetration program to turn it into an exclusive private cloud image bed.

Reprinted from cpolar pole cloud article: Use Cpolar to build + Qchan lightweight private image bed to build

Guess you like

Origin blog.csdn.net/weixin_74004489/article/details/132819398