[The local computer builds a web server and publishes it to the public network with cpolar

Build a web server on a local computer and use cpolar to publish it to the public network for access

With the rapid development of the Internet, the Internet has become an indispensable requirement in our lives. In order to have our own space in the Internet world, many people choose to build a web page of their own. However, the Internet industry is a capital-intensive industry. It takes a lot of money to entrust others to build a decent website. Not only does it require in-depth design and production of web pages, but it also needs to rent server resources to host and publish web pages. But now, with the help of cpolar, we can use our own computer or other electronic equipment as a server, cooperate with some webpage production software to build our own website, and then penetrate the intranet through the data tunnel created by cpolar, and publish the webpage to the public Internet , thus greatly saving the cost of creating your own web pages.

Taking the most widely used Windows operating system as an example, we can use PHPStudy, WordPress and Cpolar together to turn an ordinary computer into a small web server that can be accessed by public Internet users. First, we download and install the above three software on the computer:

Like all software, these software also need to be set up after the installation is complete. The first is PHPStudy. After the download is completed and double-clicked to install, you can directly find the following plug-ins on the "Software Management" page of the main page. Several plug-ins are environmental software for web pages to run and are therefore indispensable.

insert image description here

insert image description here

Next, we install the key software Cpolar (also double-click the installation package to install it) which is the key software for intranet penetration and publishing of web pages. After the installation is complete, you can find it in the start menu, or enter http://localhost:9200 in the browser address bar to open the Cpolar Web-UI interface (for the functions of the cpolar main page, please refer to "Cpolar Panel function introduction" this article).

insert image description here

insert image description here

insert image description here

After cpolar is installed, we don't move it temporarily, because there is no web page for us to publish at this time. So let's go ahead and install wordpress and use it to generate a decent website. Since wordpress is not a piece of software, but multiple software and collections required for webpage operation, we cannot directly double-click to install, but decompress wordpress, and put all the decompressed files into the webpage operating environment ( That is, in the webpage folder of PHPStudy), in order to continue to install wordpress. It should be noted that wordpress installed in this way allows multiple websites to coexist, so we can build multiple websites on one computer to make the best use of everything. Here, we put the wordpress file in the web3 folder under PHPStudy.

insert image description here

insert image description here

After copying all the files of wordpress to the corresponding folder, you can use PHPStudy to create a new webpage (it should be noted that the software required to run the webpage must be set to open when creating a new webpage), and perform basic operations on the webpage environment. set up.

insert image description here

insert image description here

insert image description here

After all the settings are completed, you can click "Confirm" below to create a new web page. Then enter the address of this new web page, you can officially enter the wordpress web page installation program, and the installation process is also very simple, just follow the prompts on the web page to complete it quickly

insert image description here

![img](https://img-blog.csdnimg.cn/img_convinsert image description here

insert image description here

insert image description here

insert image description here

After the wordpress installation is complete, we can choose the appearance of the web page we like through the template and apply it to our web page.

insert image description here

Next, we installed a relative URL plugin and made a little modification to the wordpress configuration file, so that wordpress can correctly handle access requests from the public Internet and display correct web page content for visitors. The relative URL software we use here is "relative-url", which we can find by searching on the "Plugins" page of the WordPress main interface.

insert image description here

insert image description here

Next, we make a small modification to the wordpress configuration file, mainly inserting two lines of commands in the configuration file. Since the command line is sensitive to characters, it is best to directly copy the content of the following commands to prevent wordpress from malfunctioning due to input errors.

define('WP_SITEURL', 'http://' . $_SERVER['HTTP_HOST']);
define('WP_HOME', 'http://' . $_SERVER['HTTP_HOST']);

[External link picture transfer failed, the source site may have an anti-theft link mechanism, it is recommended to save the picture and upload it directly (img-lpzLnJ7n-1689229562935) (data:image/gif;base64,R0lGODlhAQABAPABAP///wAAACH5BAEKAAAALAAAAAABAAEAAAICRAEAOw==)]

insert image description here

After completing these preparations, we have an environment suitable for web pages to run, and we have also established a decent website. The next step is to use the intranet penetration data tunnel established by cpolar to publish the local wordpress web pages to the public Internet. Let us of computers officially converted to web servers.

First open the cpolar software, click "Create Tunnel" under "Tunnel Management" on the left side of the main page, enter the setting page of the intranet penetration data tunnel, set the tunnel name, local address (web page output port, port 8081 in this example) ), domain name type and region of use and other basic information to set.

insert image description here

After completing the above settings, you can click the "Create" button below to establish a dedicated webpage publishing data tunnel, and visitors from the public Internet can access the wordpress webpage on the local computer through this data tunnel.

insert image description here

The intranet penetration data tunnel established by cpolar can not only publish the webpage located on the local computer, but also customize and upgrade the website address of this webpage https protocol. If you want to know more about the settings of cpolar publishing intranet webpage, you can See our article "Building a Business Website Using cpolar" series. Of course, as a powerful intranet penetration tool software, cpolar can also play an important role in many scenarios. If you have any questions about the use of cpolar, please contact us, we will provide you with assistance within our ability. Of course, you are also welcome to join the VIP official group of cpolar to explore the unlimited potential of cpolar together.

Guess you like

Origin blog.csdn.net/Tiam_cr/article/details/131867093
Recommended