users@glassfish.java.net

[gf-users] deploy to a specific port?

From: thufir <hawat.thufir_at_gmail.com>
Date: Tue, 24 Feb 2015 23:53:27 -0800

Is it possible to specify a port through asadmin without running as root?

In the past, I've looked into deploying to a specific port:

http://askubuntu.com/questions/544853/

Not deeply, but a little bit. I don't mind doing all that, but,
randomly, ran across:


http://www.jvmhost.com/articles/host-web-application-glassfish-root-url


which suggests --port=##

This sounds promising:


asadmin>
asadmin> deploy NetBeansProjects/CRM/dist/CRM.ear --port=80
Remote server does not listen for requests on [localhost:80]. Is the
server up?
Unable to get remote commands.
Closest matching local command(s):
     help

Command deploy failed.
asadmin>
asadmin> deploy --port=80 NetBeansProjects/CRM/dist/CRM.ear
Remote server does not listen for requests on [localhost:80]. Is the
server up?
Unable to get remote commands.
Closest matching local command(s):
     help

Command deploy failed.
asadmin>
asadmin> deploy NetBeansProjects/CRM/dist/CRM.ear
Application deployed with name CRM.
Command deploy executed successfully.
asadmin>
asadmin> undeploy CRM
Command undeploy executed successfully.
asadmin>
asadmin> eploy NetBeansProjects/CRM/dist/CRM.ear --port=5438
Remote server does not listen for requests on [localhost:5438]. Is the
server up?
Unable to get remote commands.
Closest matching local command(s):
     export

Command eploy failed.
asadmin>


but doesn't work for me...

I also tried:

thufir_at_doge:~$
thufir_at_doge:~$ glassfish-4.1/glassfish/bin/asadmin --port 80
Use "exit" to exit and "help" for online help.
asadmin>
asadmin> list-applications
Remote server does not listen for requests on [localhost:80]. Is the
server up?
No such local command: list-applications. Unable to access the server
to execute the command remotely. Verify the server is available.
Command list-applications failed.
asadmin>
asadmin> exit
Command multimode failed.
thufir_at_doge:~$



see also:



http://docs.oracle.com/cd/E19798-01/821-1751/givjd/index.html



which suggests:


          Example 2–9 Running a Set of asadmin Subcommands From a File


This example contains the following:

  *

    A listing of a file that is named commands_file.txt, which contains
    a sequence of asadmin subcommands

  *

    The command to run the subcommands in the file commands_file.txt

The commands_file.txt file contains the asadmin utility subcommands to
perform the following sequence of operations:

 1.

    Creating the domain customdomain

 2.

    Starting the domain customdomain

 3.

    Listing all available subcommands

 4.

    Stopping the domain customdomain

 5.

    Deleting the domain customdomain

The content of the commands_file.txt file is as follows:

create-domain --portbase 9000 customdomain
start-domain customdomain
list-commands
stop-domain customdomain
delete-domain customdomain

This example runs the sequence of subcommands in the commands_file.txt
file. Because the *--portbase* option is specified for the create-domain
subcommand in the file, the *--port* asadmin utility option must also be
set.


*asadmin --port 9048 multimode --file commands_file.txt*

------------------------------------------------------------------------






-Thufir