Use Lychee lychee picture bed + cpolar intranet penetration to quickly build a stable private picture bed [no public network IP needed]

1 Introduction

As a service website for centralized storage of pictures, Picture Bed can be regarded as a part of cloud storage. It can not only be used as a storage space for us to store photos, but also can establish external links to become the source of pictures for websites or articles. However, with the decline of cloud storage operated by big factories, the life of various image platforms is not easy, and some image platforms have even closed their doors. Under such circumstances, self-built image beds seem to be the only reliable option. Today, the author will show you how to use Cpolar+ Lychee to build a simple and beautiful private picture bed website.

2. Lychee website construction

Lychee is an open-source free picture bed software based on php. Just like the translation of its name, Lychee is as clean and transparent as lychee, and it can also provide convenient picture operation, editing and grouping, as well as functions such as user management, picture preview and external links. . For private users, it is undoubtedly very friendly.

2.1. Lychee download and installation

Since lychee is an open source project, it is natural to find its download link on github, and of course you can also enter the download page from its official website.

20230428105301

20230428105302

After downloading the relevant files of Lychee, decompress the downloaded compressed package and put the files in the site root directory of the running environment. I use phpstudy as the running environment of the website, so put the lychee website files in the WWW folder .

20230428105303

20230428105304

Next, open phpstudy, click the "Website" button on the left side of the software main interface, enter the website list page, click the "Create Website" button on the upper left, and enter the setting page of the newly created website.

On the website settings page, there are not many things we need to set, just set:

  • 域名- The domain name of the local lychee website, which can be input freely;
  • 端口– For the output port of the local lychee web page, just select an unoccupied port;
  • 根目录– That is, the storage location of lychee webpage files;
  • 程序类型–lychee is a web image bed program, which needs to rely on php7.2+ to run, so choose php7.2.9
  • 创建数据库– Since the operation of the lychee website depends on the database, we also need to set up the database for lychee, just check the "Create database" in the "Create environment" column.

After these settings are completed, you can click the bottom 确认button to save the settings of the lychee website.

20230428105305

It should be noted that the installation of lychee requires some php extension components, including: Session, exif, mbstring, gd, mysqli, json, zip, imagick, optionally

Fortunately, phpstudy provides a check option for PHP extensions, so that we don’t have to configure these PHP extensions one by one (this is why the author likes to use the integrated environment to deploy websites)

20230428105306

2.2 Lychee web page test

After setting up the lychee webpage, you can enter it in the browser localhost:端口号to access the local lychee webpage login interface. The login account and password that need to be entered here are the database login name and password of the previously set lychee website.

20230428105307

20230428105308

2.3 Installation and registration of cpolar

After completing the setting of the lychee website, you can continue to install cpolar intranet penetration. Like the installation of lychee website, cpolar can also find 下载the button directly on the official website of cpolar.

cpolar official website: https://www.cpolar.com/

20230428105309

The author uses the Windows operating system, so choose the Windows version to download.

After the download of Cpolar is complete, decompress the downloaded file, double-click the decompressed .msifile, and the installation program can be executed automatically. Then just go all the way Nextto complete the installation.

20230428105311

20230428105312

In order to ensure data security, cpolar will create an independent data tunnel for each user, so we need to register users before using cpolar. The registration process is also very simple, just click on the upper right corner of the cpolar homepage 用户注册, fill in the necessary information on the registration page, and the registration can be completed.

20230428105313

20230428105314

3. Local web publishing

At this point, we have completed the construction of the local lychee image bed website and installed the cpolar internal network penetration program. Next, we can use cpolar to create an internal network penetration data tunnel, allowing us to access the local network on the public Internet. The lychee figure bed website.

3.1 Cpolar cloud settings

Usually, the data tunnel created by the free version of cpolar will be reset within 24 hours. In order to ensure the long-term and stable existence of our picture bed website, the author upgrades cpolar to the vip version.

In the next step, we log in to the background of cpolar's official website, find 预留the button on the left side of the user's main page, and click to enter the cpolar data tunnel reservation page. Set a public Internet address here (which can be regarded as the entrance of the data tunnel). Since this address is not connected to the local software output port at this time, it can also be regarded as a blank data tunnel.

20230428105315

On the reservation page, you can see many kinds of data tunnels that can be reserved. Here we select 保留二级子域名the field.

20230428105316

In 保留二级子域名the field, you need to make simple settings for several items of information, namely

  • 地区(The area where the server is located, just choose the nearest one)
  • 二级域名(will eventually appear in the generated public Internet address as one of the identifiers of the network address)
  • 描述(It can be regarded as the description of this data tunnel, which can be distinguished from other tunnels).

After completing these settings, you can click 保留the button on the right to keep this data tunnel.

20230428105317

Of course, if this data tunnel is no longer intended to be used, you can click the "x" on the right to delete it easily, saving valuable tunnel quota.

20230428105318

3.2 Cpolar Local Settings

After completing the setting of the cpolar cloud and keeping the blank data tunnel, we return to the local cpolar client and connect the blank data tunnel generated by the cloud with the local test page, so that we can access the local test on the public Internet page.

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

20230428105319

隧道管理Click the button on the left side of the main interface of the client 创建隧道to enter the local tunnel creation page (if you want to create a temporary data tunnel whose address is reset every 24 hours, you can directly set it here instead of setting a blank data tunnel on the cpolar official website).

On the page of creating a tunnel on the cpolar client, several information settings are also required, including:

1. 隧道名称- It is the comment of cpolar local tunnel, as long as it is convenient for us to distinguish;
2. 协议- Since the test page is a web page, so choose the http protocol;
3. 本地地址- It is the output port number of the local website, so fill in 86 here ;
4. 域名类型– Since we have reserved the data tunnel of the second-level subdomain name in the cpolar cloud, check the "Second-level subdomain name" (if the reserved domain name is a custom domain name, then check the custom domain name), and in the following Sub DomainFill in the reserved second-level subdomain name in one column, here we fill in "lycheeweb".
But if you plan to create a temporary data tunnel, just check "Random domain name" directly, and the cpolar client will generate the network address by itself;

5. 地区– It is the same as the information reserved in the cpolar cloud, and we can fill it in according to the actual use;

20230428105320

After completing these settings, you can click 创建the button at the bottom of the page to create a data tunnel that can access the local lychee website on the public Internet. We can manage this data tunnel on the "Tunnel List" page under "Tunnel Management", including opening, closing or deleting this tunnel. You can also click the "Edit" button to edit the information of this data tunnel. to modify.

20230428105321

4. Public network access test

Finally, we can find the public Internet address of the lychee website by clicking the button on the left 状态side 在线隧道列表.

20230428105322

Paste this address into the browser, and you can see the login page of the local lychee website. After entering the login name and password, you can access the local lychee page on the public Internet.

20230428105323

20230428105324

5 Conclusion

So far, we have completed the deployment of the local lychee image bed, and through the internal network generated by cpolar to penetrate the data tunnel, and publish it to the public Internet, let our local computer become a private image bed, of course, cpolar intranet penetration is still It can cooperate with other websites or software to play a role in other application scenarios.

Guess you like

Origin blog.csdn.net/2301_76760501/article/details/130593894