Windows防火墙入站规则和环境PATH变量 [英] Windows Firewall inbound rules and environment PATH variable
问题描述
请考虑以下情形:
Jenkins在计算机A上运行一个主服务器,在计算机B上运行一个从计算机.与之相比,主计算机的XML配置不是引用硬编码的Java路径,而是在环境PATH变量中将其更改为引用"java".这对于在计算机A上运行的主服务器正常工作,但是在计算机B上的从服务器不再能够连接到主控主机PC.
Jenkins running with a master on machine A and a slave on machine B. Rather than the master's XML config referring to a hard coded Java path it was changed to reference 'java', in the environment PATH variable. This works fine for the master running on machine A, however the slave on machine B is no longer able to connect to the master host PC.
计算机(A)上的入站流量的(Windows)防火墙规则允许与"C:\ Program Files \ Java \ jre7 \ bin \ java.exe"的任何协议和端口连接上的入站通信,因此Jenkins服务应该可以运行,但不是.使连接正常工作的唯一方法是禁用防火墙.
The (Windows) firewall rules for inbound traffic on machine A allow inbound communication on any protocol and port connections to 'C:\Program Files\Java\jre7\bin\java.exe', so the Jenkins service should work but it isn't. The only way I can make the connection work is by disabling the firewall.
推荐答案
尽管将入站防火墙规则设置为允许任何与"java"的连接,但希望它能够获取环境PATH值,但我仍然无法获得连接工作.
Despite setting the inbound firewall rule to allow any connections to 'java', hoping it would pick up the environment PATH value, I still couldn't get the connection working.
最后,将jenkins.xml文件更改为不使用"java" PATH变量,而是使用"C:\ Program Files \ Java \ jre7 \ bin \ java.exe",然后将入站防火墙规则设置回以匹配这行得通.
In the end changing the jenkins.xml file to not use the 'java' PATH variable and instead use 'C:\Program Files\Java\jre7\bin\java.exe' and setting the inbound firewall rule back to match this worked.
有趣的是Windows看到PATH变量和文字文件路径的方式如此不同,以致于它不满足防火墙规则(也许是设计使然并具有安全功能?).
Interesting that Windows saw the PATH variable and the literal file path so differently that it didn't satisfy the firewall rule (perhaps it's by design and a security feature?).
这篇关于Windows防火墙入站规则和环境PATH变量的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!