开发者

How to change the IP address and Port number of Tomcat to some url

I am new to web development. I have created a flex based website and now i want to deploy it in my tomcat server. I want to change the URL from http://localhost:8080/myapp/ to http://myapp/

Pl开发者_JS百科ease let me know if somebody has done something similar.

Thanks, Aj


You can do that through:

  • Setting on your router NAT (which can map request to certain IP:port to other IP:port), or
  • Setting on your domain name server (be it local or global), or
  • Adding a reverse proxy server that can do the translation, this way e.g.
    • Apache Web Server + mod_proxy
    • Apache Web Server + mod_jk
    • Apache Web Server + mod_rewrite
    • IIS + ISAPI
    • nginx
    • Varnish

I'd recommend the 3rd approach, as you don't usually want to expose your Tomcat directly on production.


You need to change the listen port of the HttpConnector in conf/server.xml:

<Connector port="80" protocol="HTTP/1.1" 
           connectionTimeout="20000" 
           redirectPort="8443" />

Note that giving no port in the URL means port 80, which on Unixoids (like Linux) means that the task that opens the port must run as root.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜