Installing on Ubuntu

Skip to end of metadata
Go to start of metadata

Using Sun Java System Web Server 7.0 with Ubuntu

Note: These directions are known to work for Gutsy Gibbon (7.10) and Hardy Heron (8.04)

A growing number of our Linux users have asked how they can use Sun Java System Web Server on Ubuntu. "Can it still be used with Ubuntu even if it's not supported?" It's true that Ubuntu is not yet a certified platform for Sun Web Server, but there are many users known to be using it on this operating system without any problems. Here's how they got started:

  • Download the most recent Linux version of Sun System Web Server following the download links at [the beginning of this wiki|http://wikis.sun.com/display/WebServer].
    • At the time of this writing, this is Sun Web Server version 7.0 Update 3
    • Make sure that you download the 32-bit OR 64-bit package, depending on which Ubuntu build you're using
    • If you are using the 64-bit version of Ubuntu, be certain that you have installed ia32-libs and libstdc++5. The installer application makes use of these
    • Make certain that ncurses4 and libtermcap are installed. The installer application makes use of these if you are executing it in an environment without support for X
  • Extract the files in to a temp directory: /tmp/webserver
  • Run the installer program as root if you plan to run on standard privileged ports (port 80 for non-SSL traffic, port 443 for SSL), or if you will need the process to change the UID it runs as after being started 1: sudo ./setup
  • Files will be installed by default in /sun/webserver7. Since this path is used within the configuration files, it's generally a good idea to make sure the path you specify is where you want the final installation to be
  • Start the admin server by executing the following command: sudo /sun/webserver7/admin-server/bin/startserv

Once started the Administration Server will report on the command line what port it's running on. This is typically 8888 or 8989. You can now use your browser to access the indicated URL and perform more configuration and setup as described in the documentation.

Finally: Some users report that the installer does not offer to create the rc files to start the instance (and/or admin) at boot time. You can create an rc file to start the admin or instances at boot time and copy the file in /etc/init.d. This sample is called SunWebServer7. Don't forget to make it executable (eg: sudo chmod a+x SunWebServer7). In this script both the default web instance and the admin servers are started and/or stopped. You might want to only start your web server.

SunWebServer7 Contents:

case "$1" in
start)
        /sun/webserver7/admin-server/bin/startserv
        /sun/webserver7/https-kkranz-ubuntu/bin/startserv
        ;;
stop)
        /sun/webserver7/admin-server/bin/stopserv
        /sun/webserver7/https-kkranz-ubuntu/bin/stopserv
        ;;
restart)
        /sun/webserver7/admin-server/bin/restartserv
        /sun/webserver7/https-kkranz-ubuntu/bin/restartserv
        ;;
*)
        echo $"usage: $0 {start|stop|restart}"
        exit 1
esac

You can then simply propagate the links to the appropriate rc directories:

$ update-rc.d -n SunWebServer defaults 50

All done! Happy web serving.

Note 1: When the installer is run without privileges, it installs the software "locally" into your user directory (eg: ~/apps/webserver7) and configures the administration server and any instances to run with your user ID. This will prevent your instances from running on standard ports (port 80 and port 443) because these privileged ports requires root access to bind. Privileged access is also required to enable the software to change the UID it runs as after it has bound to a privileged port. Sun Web Server is designed to protect its privileged access after binding to the lower ports, and the processes that retain their privilege (in order to re-spawn processes that may be terminated, etc) do not interact with network traffic.

Thanks to Ken Kranz for blogging about this nearly a year ago at: http://blogs.sun.com/kkranz/entry/installing_sun_java_system_web

This article is based heavily on his blog entry.

Labels:
None
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.

The individuals who post here are part of the extended Oracle community and they might not be employed or in any way formally affiliated with Oracle. The opinions expressed here are their own, are not necessarily reviewed in advance by anyone but the individual authors, and neither Oracle nor any other party necessarily agrees with them.