寻觅生命中的那一片浅草......

禁止通过IP访问Jboss

cd /your_install_dir/jbossweb-tomcat50.sar/
/bin/cp server.xml server.xml.100323
vi server.xml

先修改默认的8080端口

<Service name=”jboss.web”
className=”org.jboss.web.tomcat.tc5.StandardService”>

<!– A HTTP/1.1 Connector on port 8080 –>
<!– The compression parameters are taken from the default Tomcat server.xml–>
<Connector port=”8080″ address=”${jboss.bind.address}”

将port=”8080″修改为port=”8888″

禁止通过IP访问,只允许通过域名访问

在<Host name=”localhost”
autoDeploy=”false” deployOnStartup=”false” deployXML=”false”>
前添加一个IP命名的virtual host

假如服务器IP是192.168.0.100,则添加的host如下

<Host name=”192.168.0.100″>
<Valve className=”org.apache.catalina.valves.RemoteAddrValve” deny=”0.0.0.0″/>
</Host>

现在启动Jboss,就不能通过IP访问了,只能通过域名,但任何解析到192.168.0.100的域名都可以访问
有机会再研究下只绑定一个域名的情况

参考:http://xuliangyong.javaeye.com/blog/410148

尚无评论

发表评论

2024年四月
« 5月    
1234567
891011121314
15161718192021
22232425262728
2930