Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
879 views
in Technique[技术] by (71.8m points)

websocket - How to run glassfish 4 on port 80 instead of 8080? root access is not an issue

Did some google on it and the solution was to redirect using iptables or mod in apache? Since my application uses websockets the above solution breaks my websocket connectivity and I again have to connect to my websockets using port 8080. Is there any way that I can run the glassfish itself on port 80 so that my websockets also run on port 80 making easier for users behind corporate firewall to access the app since corparates may block 8080.

I have root access as well.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

To run GlassFish on port 80 you need to :

  1. Connect to the administration interface (by default on port :4848)

  2. In the left menu go to Configurations

  3. Then select the appropriate configuration you need to change eg server-config

  4. Then go to Network Config

  5. Then go to Network Listeners

  6. Select the appropriate listener, probably http-listener-1

  7. Change the Port value to 80

  8. Save and reboot your GlassFish server/instance/cluster according to your needs

Using the command line utility

asadmin set configs.config.server-config.network-config.network-listeners.network-listener.http-listener-1.port=80 

you may need to replace server-config and/or http-listener-1


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...