1

How do I install Glassfish 4.x and run it on port 80? While it's easy enough to download Glassfish and unzip it, should it go in a particular directory? Which user should start and stop the server?

see also:

https://glassfish.java.net/documentation.html

How do install glassfish on ubuntu server 12.x?

https://www.digitalocean.com/community/tutorials/how-to-install-glassfish-4-0-on-ubuntu-12-04-3

Thufir
  • 4,441
  • 17
  • 80
  • 146
  • is this a question or an answer? – Alvar Nov 02 '14 at 21:00
  • run as root because port 80 is blocked? follow exactly the digital ocean guide? I'm asking. – Thufir Nov 02 '14 at 21:02
  • What's your OS flavour and version? – Jan Nov 02 '14 at 21:04
  • 14.04 ubuntu, but I'll be upgrading to 14.10 soon. – Thufir Nov 02 '14 at 21:10
  • the tutorial on digital ocean looks good. But remember that you may have to run some commands with sudo or as root, since a normal user doesn't have the privileges to use them... – Alvar Nov 02 '14 at 21:50
  • but, just so you know oracle are working on a new version that will give support for java 8. But you will have to install sdk 7 until then... – Alvar Nov 02 '14 at 22:10
  • Have you read the Glassfish documentation? – Thorbjørn Ravn Andersen Nov 02 '14 at 22:27
  • @ThorbjørnRavnAndersen yes, and pardon, should've linked to it. I looked through a few manuals on Glassfish. Please do point me to where in the fine manual it explains which user to run Glassfish as. While I've looked through the manuals, no, I've not read them closely. – Thufir Nov 03 '14 at 00:39

1 Answers1

3

see http://www.nabisoft.com/tutorials/glassfish/installing-glassfish-41-on-ubuntu

This tutorial tells you in detail how to install Glassfish 4.1 on Ubuntu 14.04 LTS server and it should also work for 14.10 and newer versions of Ubuntu. It also cover some security concerns. Basically, to answer you questions:

  1. you can't run it on port 80 unless you run it as root

  2. however running it as root is a really bad practice (security!!)

  3. there are a few other options to use port 80 and 443, I prefer simply port forwarding via iptables (no apache in front of it, described in my tutorial...)

  4. directories: well, choose what ever you like. in my tutorial I create a user glassfish with an own home at /home/glassfish/ (everything goes in here). But you could choose anything else as well...

  5. Never ever use toot to start the server. in my tutorial I have created a dedicated user "glassfish" which is used to run glassfish.

Nabi
  • 191
  • 5
  • `thufir@tleilax:~$ sudo usermod -a -G glassfishadm $myAdminUser Usage: usermod [options] LOGIN` -- not sure that's correct.. – Thufir Feb 23 '15 at 14:42
  • 1
    well you would have to replace $myAdminUser with a certain user. what else should be wrong? – Nabi Feb 25 '15 at 08:38