当前位置:网站首页>Problems encountered when using nailing intranet to penetrate and upload PHP projects

Problems encountered when using nailing intranet to penetrate and upload PHP projects

2022-06-11 11:09:00 Li Ming

Intranet penetration HTTP through
image.png
When we start the nail net penetration according to the official nail tutorial , The command line window is displayed as the picture above to remind us of the successful startup .

As shown in the figure, there are two links , One for http link , One for https link .
Usually we can only access http link , The specific reasons are not explained here .

After that, if you want to access our php The project needs to open a local http-server service .
The specific operation is :

  1. download node.js
    Official website address : https://nodejs.org
    After the download is complete, enter the command at the command line $ node -v as well as $ npm -v Check version , Confirm whether the installation is successful .
  2. download http-server
    Input... At the terminal :
    $ npm install http-server -g
  3. Turn on http-server service
    The terminal enters the target folder , Then input... At the terminal :
    http-server -c-1

When we turn on http-sever After the service, we can access our... Under the LAN PHP project .
When using intranet penetration, we will find thinkPhp5 In the framework, the project is deployed in 80 On port , For example, we usually use http://127.0.0.1/MicroCourse2021-main/thinkphp5.0guide-step1/public To start a PHP project , If we were 127.0.0.1 Add after :80 To use 80 Ports can also be used to start the project normally .

But intranet penetration is our default URL Mapping to 8080 port , So I changed thinkPhp5 Start port of , Here are the locations of the files that need to be changed :

"D:\xampp\apache\conf\httpd.conf"

Find the following fields , take 80 Change it to 8080.

#Listen 12.34.56.78:80
Listen 80

Then we'll restart it Apache service , If there is an error , Probably 8080 The port is occupied by other processes , I can be in xampp Enter the options shown in the figure to view the port occupancy
image.png
After that, you can end the corresponding process in the task manager , Then we will visit the corresponding URL From other devices ( Not on the same LAN ) To visit our PHP project .

Just after the above operations, I still imagine a company as big as Alibaba , Why is the service provided so inconvenient , There is no function to modify the mapping port , Then I looked back and found that what was written in the original text was very clear :

 Execute the following command , Start nail mesh penetration .
ding ngrok --subdomain dingabcde --port 8080

--subdomain Indicates the domain name prefix ,--port Represents the mapped port
We just need to change a parameter at startup , Just because I was in a hurry when I read the document , I didn't even see such an obvious hint , So this also tells us that we must be careful when looking at official documents in the future , You can't just glance at it just because there is little content .

原网站

版权声明
本文为[Li Ming]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203012205422811.html