Why write this article?
Mainly online nowapacheThe methods of port modification are all long ago. I followed the above methods to modify. If I can’t find the file, or there is no content in the file, I have to grope for it. After a long time of trying, I can finally do it. So I want to write down the methods and give a reference to the friends who want to modify the port later.
Note: if you are prompted that the file is read-only, use the command sudo Chmod 777. If you also see the prompt below, use the command.
apacheThe default port in is80Port, as shown in the figure above80, you can change it to any port80Replace with the port you want to modify.
Then go to
Also modify the80(this is at the beginning of the file)
Then change the position in the figure above. implement
sudo service apache2 restartrestartapacheYes.
Finally, if you are using Tencent cloud server, then80The port is blocked by default.
Why should I modify the port? It’s a pit. When Alibaba cloud was used before80The port has been opened. I forgot to use Tencent cloud this time. How to set an open80In fact, the security group of the port is still simple. You can google it.