2012-06-28 94 views
7

我在我的Ubuntu服务器上安装了jenkins,我只用sudo apt-get install jenkins安装了jenkins,因此,现在可以从指向我的方框的所有域中访问jenkins,只需将:8080在URL上。防止Jenkins在端口8080上访问

我已经成功地配置Apache来代理詹金斯我可以从ci.mydomain.com访问它,但我不能工作了如何防止詹金斯被在8080端口上

这里访问的是我的Apache的conf:

<VirtualHost xx.xx.xx.xx:80> 
    ServerAdmin [email protected] 
    ServerName ci.mydomain.com 

    ProxyPass  /http://localhost:8080/ 
    ProxyPassReverse/http://localhost:8080/ 
    ProxyRequests  Off 

    <Proxy http://localhost:8080/*> 
     Order deny,allow 
     Allow from all 
    </Proxy> 
</VirtualHost> 

我按照Ubuntu说明here,但他们似乎没有任何效果。

+0

你可以用'iptables',因为它是Ubuntu的,为阻止端口8080的所有非本地访问所有非本地访问。 'iptables -A INPUT -t tcp -dport 8080 -s localhost -j ACCEPT'和'iptables -A INPUT -t tcp -dport 8080 -j DROP' – ionFish

+0

@ionFish谢谢,它抱怨'--dport'选项虽然无法识别,添加此作为答案也许? – Dunhamzzz

回答

10

你可以使用iptables的,因为它是Ubuntu的,为阻止端口8080

iptables -A INPUT -p tcp --dport 8080 -s localhost -j ACCEPT 
iptables -A INPUT -p tcp --dport 8080 -j DROP 
+0

我得到的回应是'iptables v1.4.12:未知选项“--dport”' – Dunhamzzz

+0

我会稍微研究一下,在这一秒我有重要的事情要做。 – ionFish

+0

它是'-p'而不是'-t'导致dport问题,我已经更新了你的回答 – Dunhamzzz

相关问题