How to deploy Apache server locally in Windows and use intranet penetration to achieve remote access without public network IP?

Preface

Apache is the most commonly used web server software in the world, and it can run on almost all common computer platforms. Known for its excellent cross-platform and advanced security, as well as being fast, reliable and easy to extend through simple APIs, it is widely used in the field of web servers. This article mainly shares how to install and configure the Apache service in Windows systems, and combines the intranet penetration tool to achieve remote access to the local intranet Apache service from the public network.

img

1.Apache service installation and configuration

1.1 Enter the official website to download the installation package

First, we enter Apache’s official website download page (https://www.apachehaus.com/cgi-bin/download.plx) and download the installation package according to the required version.

image-20230906153157458

It should be noted that Apache requires the VC++ redistributable package for parsing, so if VC++ is not currently installed on your computer, you need to go to the bottom of the download page, download VC++ and install it, and then install the Apache service.

image-20230906152829234

1693987431356

After installing VC++, decompress the downloaded Apache file compression package and cut the Apache24 folder to the root directory of the system disk.

image-20230906155222938

1.2 Apache service configuration

First, use the shortcut key win+R, or enter in the search box in the lower left corner of the desktop cmd, and select Run as administrator

1694058077742

entercd c:\

Enter again cd Apache24and enter the Apache folder path

Enter againcd bin

Enter last httpd -k installand press Enter directly

1694058332155

When you see successful installed shown below, you can see that Apache has been successfully installed. The firewall prompt box will pop up and select allow access.

1694058277143

At this point, go into the folder Apache24within the folderbin

1694058514018

Double click to open ApacheMonitorthe application

1694058582955

After opening, the Apache logo will be displayed in the lower right corner of the desktop. Double-click the left button to open the Apache service interface.

1694058714549

1694058800628

Click the button on the right Start. As shown in the figure below, when the chart changes from red to green, the service is started successfully.

1694058916404

At this time, input in the browser localhostand the page is displayed, which means the entire configuration process is successful.

image-20230907115741555

2. Install cpolar intranet penetration

2.1 Register cpolar account

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

Click on the upper right corner 免费注册, use your email to register a cpolar account for free and log in

20221117173301

2.2 Download cpolar client

After successfully logging in, click to download cpolar locally and install it (you can install it by default all the way). In this tutorial, you choose to download the Windows version.

20221117173307

3. Obtain the remote desktop public network address

3.1 Log in to the cpolar web ui management interface

Access 127.0.0.1:9200 on the browser and use the registered cpolar email account to log in to the cpolar web ui management interface (default is local port 9200)

20221117173316

3.2 Create public network address

隧道管理After successfully logging in and entering the main interface, we click - on the left dashboard 隧道列表, and then click 创建隧道.

1694073249193

  • Tunnel name: The name can be customized and cannot be repeated with the existing tunnel name. Here the author filled in Apache-1

  • Protocol: Select http

  • Local address: 80

  • Domain name type: Choose a random domain name for free

  • Region: China Top

Click创建

1694073531793

Then click 状态on the left 在线隧道列表, you can see that the Apache-1 tunnel you just created has generated two public network addresses. There are two access methods, namely http and https. Copy an address at will and open it in a public network computer browser. That’s it, as shown in the figure below, it means the access is successful.

image-20230907160323411

4. Fixed public network address

It should be noted that this tutorial uses a random temporary address on the public network generated by free cpolar. This address will change within 24 hours. For users who need to be remote for a long time, it is necessary to configure a fixed address.

Therefore, we can configure a second-level subdomain name for it. This address is a fixed address and will not change randomly [ps: cpolar.cn has been filed]

Note that you need to upgrade the cpolar package to a basic package or above, and the bandwidth corresponding to each package is different. [cpolar.cn has been registered]

Log in to the cpolar official website, click Reserve on the left, select to reserve the second-level subdomain name, set a second-level subdomain name, click Reserve, and copy the reserved second-level subdomain name after the reservation is successful.

1694074618219

Taking this tutorial as an example, select China VIP for the region, fill in Apachetest for the secondary domain name, fill in ceshi for the description, and click Reserve.

image-20230907161930901

After the reservation is successful, copy the reserved second-level subdomain address, log in to the cpolar web UI management interface, click 隧道管理- on the left dashboard 隧道列表, find the tunnel to be configured: Apache-1, and click on the right编辑

1694074866373

Modify the tunnel information and configure the successfully reserved second-level subdomain name into the tunnel.

  • Domain name type: Select a second-level subdomain name
  • Sub Domain: Fill in the successfully reserved second-level subdomain name Apachetest

Click更新

1694074997063

After the update is completed, open the online tunnel list. At this time, you can see that the public network address has changed and the address name has become a reserved and fixed second-level subdomain name.

1694075057194

Finally, we use a fixed public network address for connection access, copy http://apachetest.vip.cpolar.cn to another public network computer and open it in a browser. There are no errors or connection exceptions, and you can see that the connection is successful, like this Fixed address access is set up.

image-20230907162808470

Guess you like

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