在虚拟机中运行 httpd,然后在 Windows 浏览器中访问

作者: gitcpplinue创建于 2021年9月10日更新于 2021年12月22日

I encountered some problems when running the project, and they have now been solved. **Problem** After successfully running `httpd`, we can get responses from the server by using the commands `curl -v localhost:4000/index.html` and `curl -v localhost:4000/color.cgi`, but we cannot access the server using a Windows browser. **Solution** 1. Set up the firewall to open the corresponding port: `firewall-cmd --add-port=4000/tcp`. Here, we modified the code to fix the port to 4000 instead of letting the system assign it randomly. 2. Use the `whereis perl` command to get the address of the perl program, and then `vim htdocs/color.cgi`, change the perl address in the first line to the path you found.

内容来源: EZLippi/Tinyhttpd