0

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/

Please let me know if somebody has done something similar.

Thanks, Aj

Ajk
  • 1
  • 1
  • 1

2 Answers2

2

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.

Daniel Baktiar
  • 1,692
  • 11
  • 22
0

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.

Heiko Rupp
  • 30,426
  • 13
  • 82
  • 119
  • This takes care of the port issue (i.e., that 80 is the default if none is specified), but that means that you'd still have to say `http://localhost/myapp`, where the OP wants `http://myapp`. – Ted M. Young Apr 12 '12 at 21:18