Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Glassfish Server on Ubuntu Server

  1. #1
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Glassfish Server on Ubuntu Server

    I have a standard Ubuntu Hardy Server with no GUI installed. I would like to set it up as a Glassfish Server using version 2 of Glassfish, ideally from the original download site.

    I do have ssh access from my desktop computer to the Ubuntu Hardy Server.

    I am assuming that I should install Netbeans and the Glassfish GUI administration program on the desktop computer.

    I am a relative newbie, so specific instructions would be much appreciated.

    Many thanks,

  2. #2
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Glassfish Server on Ubuntu Server

    Here are some notes that I wrote about 6 months ago about my experience in installing Glass fish on Ubuntu server.

    BTW: You dont need NetBeans. Once you are setup you can browse to the admin console of Glassfish. (http://hostname:4848)

    Install Sun Java JDK 5.0

    1.At the command line
    2.Download and install the Sun Java JDK from the remote repository,
    Code:
    sudo apt-get install sun-java5-jdk
    (must have the multi universe repositories setup).

    3.APT will now download the required packages and dependences for you and install them.
    4.The installer will ask you to accept the licence agreement.

    Install Glassfish V2

    1.Download glassfish
    Code:
    wget http://java.net/download/javaee5/v2ur2/promoted/Linux/glassfish-installer-v2ur2-b04-linux.jar
    Download this file to the parent folder that you want to install glassfish too (e.g. /user/local/).
    2.Execute the installer
    Code:
    sudo java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
    accept the licence agreement.
    3.Setup the permissions for the glassfish ant binaries and run the setup file.
    Code:
    cd /usr/local/glassfish 
    chmod -R +x lib/ant/bin
    lib/ant/bin/ant -f setup.xml
    4.Starting stopping glassfish
    Code:
    cd [GlassFishHome]/bin
    ./asadmin start-domain domain1
    ./asadmin stop-domain domain1
    Let me know how you get on.
    Last edited by tinny; July 24th, 2008 at 12:41 AM.

  3. #3
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Re: Glassfish Server on Ubuntu Server

    Quote Originally Posted by tinny View Post
    Here are some notes that I wrote about 6 months ago about my experience in installing Glass fish on Ubuntu server.

    BTW: You dont need NetBeans. Once you are setup you can browse to the admin console of Glassfish. (http://hostname:4848)

    Install Sun Java JDK 5.0

    1.At the command line
    2.Download and install the Sun Java JDK from the remote repository,
    Code:
    sudo apt-get install sun-java5-jdk
    (must have the multi universe repositories setup).

    3.APT will now download the required packages and dependences for you and install them.
    4.The installer will ask you to accept the licence agreement.

    Install Glassfish V2

    1.Download glassfish
    Code:
    wget http://java.net/download/javaee5/v2ur2/promoted/Linux/glassfish-installer-v2ur2-b04-linux.jar
    Download this file to the parent folder that you want to install glassfish too (e.g. /user/local/).
    2.Execute the installer
    Code:
    sudo java -Xmx256m -jar glassfish-installer-v2ur2-b04-linux.jar
    accept the licence agreement.
    3.Setup the permissions for the glassfish ant binaries and run the setup file.
    Code:
    cd /usr/local/glassfish 
    chmod -R +x lib/ant/bin
    lib/ant/bin/ant -f setup.xml
    4.Starting stopping glassfish
    Code:
    cd [GlassFishHome]/bin
    ./asadmin start-domain domain1
    ./asadmin stop-domain domain1
    Let me know how you get on.
    tinny:

    Thanks - I made good progress with your help. I'll modify your instructions in a few minutes, but a couple of questions, if I may:

    1. I would like to be able to access my server from the desktop. If my server is named server-01, then do I need to do anything on the server itself to be able to enter this in my browser from the desktop?

    2. I had to use sudo for most of the commands. I also setup a user 'glassfish' on the server and made that the owner of the directory where the glassfish software was installed. How do I make sure that the server will start up when the server is started?

    Thanks!

  4. #4
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Glassfish Server on Ubuntu Server

    1. I would like to be able to access my server from the desktop. If my server is named server-01, then do I need to do anything on the server itself to be able to enter this in my browser from the desktop?
    No, http://hostname:4848 should be fine.

    2. I had to use sudo for most of the commands. I also setup a user 'glassfish' on the server and made that the owner of the directory where the glassfish software was installed. How do I make sure that the server will start up when the server is started?
    You could create a glassfish user and give them permissions to /usr/local/glassfish/... right?

    As for a start-up script, I think this is what I did in the past...

    Create the following file /etc/init.d/glassfish
    Code:
    GLASSFISHHOME=/usr/local/glassfish/glassfish_v2ur2_b04
    case "$1" in
    start)
        ${GLASSFISHHOME}/bin/asadmin start-domain domain1
        ;;
    stop)
        ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
        ;;
    restart)
        ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
        ${GLASSFISHHOME}/bin/asadmin start-domain domain1
        ;;
    *)
        echo $"usage: $0 {start|stop|restart}"
        exit 1
    esac
    Then

    Code:
    sudo update-rc.d glassfish defaults

  5. #5
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Re: Glassfish Server on Ubuntu Server

    Quote Originally Posted by tinny View Post
    No, http://hostname:4848 should be fine.


    You could create a glassfish user and give them permissions to /usr/local/glassfish/... right?

    As for a start-up script, I think this is what I did in the past...

    Create the following file /etc/init.d/glassfish
    Code:
    GLASSFISHHOME=/usr/local/glassfish/glassfish_v2ur2_b04
    case "$1" in
    start)
        ${GLASSFISHHOME}/bin/asadmin start-domain domain1
        ;;
    stop)
        ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
        ;;
    restart)
        ${GLASSFISHHOME}/bin/asadmin stop-domain domain1
        ${GLASSFISHHOME}/bin/asadmin start-domain domain1
        ;;
    *)
        echo $"usage: $0 {start|stop|restart}"
        exit 1
    esac
    Then

    Code:
    sudo update-rc.d glassfish defaults
    1/ I don't think that I can give the glassfish user access until after I have set everything up.

    2/ I set up the script and rant the update-rc.d command (whatever that is).

    3/ I was able to log in to my server, once I twigged that user is admin and password is adminadmin. I guess I'd better change that.

    Thanks, and I'll update the instructions in detail in a few minutes.

  6. #6
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Re: Glassfish Server on Ubuntu Server

    I'm adding some detailed notes to these instructions. Once these have been reviewed and updated, I'd like to put them in a WIKI entry, which might make them more accessible.

    Problem: I want to install Glassfish version 2 from the Sun site. I have two machines:
    1. A laptop, running ubuntu 8.04 as a desktop
    2. A server, running ubuntu 8.04 server. Note that there is no GUI on this server.


    Steps:
    1. Install the ubuntu server. Include Open SSH, but none of the other optional software. If you need instructions, please reference http://www.ubuntugeek.com/ubuntu-804...ver-setup.html, but only select the OpenSSH server option, not the LAMP server. option. In particular, pay attention to the setup of the static IP address and adding the entry into the /etc/resolv.conf file on the desktop.
    2. reboot the server.
    3. on the desktop, open a terminal and type 'ssh username@servername', where username is the username that you used when setting up the server and servername is the name of the server. You will receive a notification that the certificate requires an exception. Answer 'yes' (type the word in full) and then you will be asked for the password.
      1. If there is a problem, then reference the following post: http://ubuntuforums.org/showthread.php?t=851263
    4. The terminal is the 'front-end' for the server and you must use command lines. When following the instructions from tinny in this post, check the results. If you get an access error, then put sudo in front of the command.


    Note that on the script, the value for GLASSFISHHOME is /usr/loca/glassfish.

  7. #7
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Re: Glassfish Server on Ubuntu Server

    tinny:

    Further question - I haven't found either Derby or MySQL on the server. What do I need to do to get these things.

    Thanks,

  8. #8
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Glassfish Server on Ubuntu Server

    Quote Originally Posted by fballem View Post
    tinny:

    Further question - I haven't found either Derby or MySQL on the server. What do I need to do to get these things.

    Thanks,
    I haven't tried Derby on a server before. But for MySQL

    Install MySQL server. (I think this script gets run automatically for you "mysql_install_db")
    Code:
    sudo apt-get install mysql-server
    Setup the root MySQL user and allow them to connect from anywhere.
    Code:
    mysql -u root
    >SET PASSWORD FOR 'root'@'%' = PASSWORD('newpwd');
    >GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'some_pass' WITH GRANT OPTION;
    Allow MySQL to receive connection from remote hosts.
    Code:
    Comment out "bind-address = 127.0.0.1" in /etc/mysql/my.cnf
    /etc/init.d/mysql restart
    Restart the server.
    Code:
    /etc/init.d/mysql restart
    BTW: If you like you can PM me your documentation on this process (GlassFish / MySQL) and Id be happy to review it for you. (I think there are a couple of things that could be improved from your previous post)

  9. #9
    Join Date
    May 2008
    Location
    Toronto, Ontario, Canada
    Beans
    755
    Distro
    Ubuntu

    Re: Glassfish Server on Ubuntu Server

    BTW: If you like you can PM me your documentation on this process (GlassFish / MySQL) and Id be happy to review it for you. (I think there are a couple of things that could be improved from your previous post)
    Thanks for the offer. Could you please tell me what 'PM' is, and how do I do this? I'm still going through a steep learning curve.

    Many thanks,

  10. #10
    Join Date
    Nov 2007
    Location
    New Zealand
    Beans
    1,026
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Glassfish Server on Ubuntu Server

    Quote Originally Posted by fballem View Post
    Thanks for the offer. Could you please tell me what 'PM' is, and how do I do this? I'm still going through a steep learning curve.

    Many thanks,
    Private message.

Page 1 of 3 123 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •