문제

We have a domain name with DNS management facility. We also have a web application developed in a GlassFish server hosted in a virtual server with a path is

http://198.98.103.233:8080/pemis/

I want to direct to the home page of that application when some one type the domain name. After navigating through the pages, we must be able to see

http://www.pemis.lk/faces/public.xhtml

in the browser rather than

http://198.98.103.233:8080/pemis/faces/public.xhtml

How can we configure that.

Thanks in advance.

도움이 되었습니까?

해결책 2

I'm on the same path and, as you don't posted the solution that you found (if you found it), I'll add here some future reference for anyone facing this problem.

I'll break the question in two parts: Eliminating host:port and changing how the URL behave.

I don't have a complete response to the first, however if you chose to listen at port 80, by HTML standard, you will supress the port on the URL, getting half the solution you want.

The second part, changing the URL behavior and/or shortening it can be achieved by either using mod_rewrite in apache or Tuckey's URL Rewrite Filter (http://www.tuckey.org/urlrewrite/). A google search using URL Rewrite can achieve you a more in depth explanation and there's a guide on the website.

You should, however, update your question with an answer, if you found one.

다른 팁

You need to install your application as the root application in Glassfish, as explained here. But it's not hard:

asadmin deploy --contextroot "/" your-webapp.war

or set the context-root property in the sun-web.xml or glassfish-web.xml depending on the version of Glassfish you use.

To change the port Glassfish listens on you need to modify the HTTP Listener configuration. On default installations you'll want to change http-listener-1's port. You can do so using the console. But you can also directly edit the domain's domain.xml:

<network-listeners>
  <network-listener port="80" protocol="http-listener-1" transport="tcp" name="http-listener-1" thread-pool="http-thread-pool"></network-listener>
  ... 
</network-listeners>

Last, to make www.pemis.lk point to that server you need a DNS entry that points to the address the server is attached to. The details of how to do that depend on the comapny that sold you the domain, quite often they have online tools that allow you to enter or modify the name-address mapping. In case of doubt it's best to contact them by phone or mail.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top