Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
gitcpplinue opened this issue Sep 10, 2021 · 1 comment
Open

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

gitcpplinue opened this issue Sep 10, 2021 · 1 comment

Comments

@gitcpplinue
Copy link

gitcpplinue commented Sep 10, 2021

自己在运行项目时遇到了一些问题,现在已经解决。

问题
成功运行httpd后,可以通过命令curl -v localhost:4000/index.htmlcurl -v localhost:4000/color.cgi从服务端获得回应,但无法通过windows浏览器访问服务端。
解决
1、设置防火墙开放相应端口firewall-cmd --add-port=4000/tcp。这里修改了代码,将端口固定为4000而不是让系统随机分配。
2、使用whereis perl命令获得perl程序的地址,然后vim htdocs/color.cgi,将第一行的perl地址改为自己查到的路径。

在windows浏览器中输入(自己的虚拟机ip):4000,可成功访问index.html界面,输入颜色可获得color.cgi的运行结果。

@zhouxin1630
Copy link

你好,你是怎么跑起来的?
我这里执行 make 后编译失败。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants