Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I need to change www.myhost.com:8080/myproject-war to www.myhost.com. Here is what I've been trying:

I configurate the Virtual Server: server. I have still have default Network Listeners to be http-listener-1 and http-listner-2. I change the Default Web Module to ScholarActive#ScholarActive-war.war (The only option in the drop down list, since I only deploy 1 application).

For the docroot, I try this

${com.sun.aas.instanceRoot}/applications/ScholarActive/ScholarActive-war_war

or this

${com.sun.aas.instanceRoot}/applications/ScholarActive/

Both does not work. What does docroot need to point to, for this to work?

what I try to do is: when I type localhost:8080/ScholarActive-war, then my application load, I want to make so that if I type locahost:8080, it will load the app as well, then what left is changed the port to 80. But no luck. Any Idea?

share|improve this question
add comment

2 Answers

Please check for the following URLs, hope this can help you.

http://blogs.steeplesoft.com/2007/05/virtual-hosting-using-apache-and-glassfish/ https://support.eapps.com/index.php?_m=knowledgebase&_a=viewarticle&kbarticleid=232

share|improve this answer
    
It help me how you set up gf to listen to port 80, but not sure about default project. However, i eventually figure it out. thank you +1 –  Harry Pham Jan 15 '11 at 16:15
add comment

You're basically saying that you'd like to remove the context of the application and have the listener, which is listening on port 8080 currently, receive requests coming over port 80.

To remove the context myproject-war from www.myhost.com:8080/myproject-war open the admin console at http://yourDomainName.com:4848 and select Applications from the main menu. Select the application you are attempting to modify and change the Context Root: from myproject-war to /. This tells Glassfish to deploy the application to the root of the virtual server. You may need to restart the domain for the changes to take effect.

Now to remove the port 8080 from the request you need to either modify http-listener-1 to listen on port 80 which you can do by simply editing http-listener-1's port in the admin console under Configurations->server-config->Network Config->Network Listeners->http-listener-1. Where you see the port field, change it from 8080 to 80. However, this only works if you don't have any other applications listening on port 80. You may need to (if you're using linux) modify the iptables to forward all traffic coming through port 80 to port 8080 where http-listener-1 is listening. Checkout this webpage forwarding port 80 traffic to see how to do it... it's pretty simple.

Good Luck :)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.