Installing Sun Java System Web Server 7 on Ubuntu

  • Download the linux version of Sun Java System Web Server - sjsws-7_0u1-linux-i586.tar.gz
  • Extract the files in to a temp directory: ~/tmp/webserver
  • run the install as root: 'sudo ./setup'  (see footnote 1)
  • Files will be installed in /sun/webserver7
  • Start the admin server by executing the following command:
'cd /sun/webserver7/admin-server/bin; sudo ./startserv' 

The server should now be running on (in my case) port 8989.  Also, I changed the doc root from "../docs" to '/mnt/export2/docs' (see footnote 2).  I then created the /mnt/export2/docs directory and then ran the following command:

   sudo chmod a+rwx -R docs

by doing so, I isolate the potential damage a hacker can create by moving them away from the install area. 

Finally: For some reason the web server install script does not give me the option to create the rc files to start the web (and admin) servers at boot time.  I do not know if this is a manifestation of running via the sudo command.  Regardless; if you want either your default or admin servers to start at boot time then you need to create a file in /etc/init.d.  I called mine SunWebServer7.  Its contents are shown below.  Don't forget to make it executable (eg: sudo chmod a+x SunWebServer7).  In my script below, I start and stop both the default web and admin servers.  You might only want to start your web server.

 SunWebServer 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 must then create the appropriate Start and Stop links in the rcx.d directories.  For example:

sudo ln -s /etc/init.d/SunWebServer /etc/rc0.d/K50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc1.d/K50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc2.d/S50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc3.d/S50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc4.d/S50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc5.d/S50SunWebServer
sudo ln -s /etc/init.d/SunWebServer /etc/rc6.d/K50SunWebServer

You are now done.  Happy web serving.

 


Note 1: in my first attempt I failed to sudo this command.  The script ran but installed the web server in my local directory (eg: ~/apps/webserver7).  This is all well and good, but down the rathole, when I tried to enable my default virtual server on port 80, I experienced (what amounted to) socket permission errors.  I then went further into the rathole by attacking the problem as a lack of permissions error on my user's part.  I'm not sure when I woke up and realized that I should have sudo'ed the command, but that was the key to success.  

I'm not saying that you must sudo this command.  If you are planning on running the server on a port above 1024 and/or you don't have root access to your machine (for starting, stopping, and modifiing the server) then you do not need sudo here.

 

Note 2: Question: I just installed Ubuntu and I don't have a /mnt/export2 - what gives?  That's right.  Recall my configuration.  I have three 250 GB disks.  I installed Ubuntu on disk 0 (specifically /dev/sda1).  I then used the Synaptic Package Manager to download and install QTParted.

Digression Warning: QTPated was odd in that, while it installed in my 'Application->System  Tools' menu, it would not execute properly.  When I start it, it would complain: 'No device found.  Maybe you're not using root user'.  Which is true.  I do not see how, in Ubuntu, you declare that a menu entry should run as root - thus you should be prompted for the root password.  Consequently; to get around this problem, simply open a shell and execute the following command: 'sudo qtparted'.  Maybe someone can enlighten me.

I then used QTParted to create and format partitions on my two spare drives.  I mounted them using the following commands:

sudo mount -t ext3 /dev/sdb1 /mnt/export2
sudo mount -t ext3 /dev/sdc1 /mnt/export3

A trick: Before you mount these drives you might want to try the following trick (especially if you are new to unix and not use to working with the mount command).   Background: once these drives are mounted they will appear in the /mnt directory as subdirectories export2 and export3.  If, for whatever reason, these drives are not mounted, the export2 and export3 directories will still appear, but they will be empty.  Furthermore; some applications (and people) not realizing this issue, might continue to fill these directories with data.  This will result in data being written to mnt's parent's volume and, when restored, other data going to the sdb and sdc partitions.  You can endup in a mental fart where you look in the directory and sometimes see one set of data and then other times different data. 

Many years (too many I might add) I started doing the following trick to WAKE me up when this happens.  With the drive unmounted, go to the mount point (eg: /mnt/export2) and run the following command (in this case a Ubuntuized command):

    sudo touch WARNING_THIS_DRIVE_IS_NOT_MOUNTED

If you see this file in your mount point (and, lets be real, how could you miss it) then your drive is unmounted.

Finally: if you want these drives mounted all the time (aka during OS startup) then add the following lines to the end of your fstab file (using, of course, 'sudo vi /etc/fstab'):

    /dev/sdb1 /mnt/export2 ext3
    /dev/sdc1 /mnt/export3 ext3

Comments:

I'm have problem at installation in UBUNTU Web Server apache, i write next: $ sudo apt-get install apache5 and it writes to me: E: can not find a package apache5 . What is such? What to do me? Thanks in advance.

Posted by sash on August 04, 2007 at 09:09 AM EDT #

Frankly; I have been using the Sun Java Web Server (or its predecessor - the Netscape web server) for an amazing 10 years now. While I experimented with apache and the IBM Web Sphere web servers, I never saw a need to switch.

I found the Sun Web Server's front end and cli to be superior and have implemented many large scale sites with few throughput issues. Consequently; I am a poor reference to answer your Apache questions. Sorry.

Posted by Ken Kranz on August 07, 2007 at 04:49 AM EDT #

Maybe you can use the following command for the rc.d stuff:

$ update-rc.d -n SunWebServer defaults 50

Posted by Yago on August 09, 2007 at 01:11 AM EDT #

Dang, all the good scripts are already written. Thanks.

Posted by Ken Kranz on August 10, 2007 at 04:12 AM EDT #

I've just tried this on Ubuntu 7.10/Gutsy Gibbon, and it fails for missing libraries. I got past the first error, ncurses4, by installing ncurses4 libraries, but it's now failing on libtermcap, which is deprecated. What's up with that? Why is a current Sun product requiring a deprecated library?

I see there are workarounds by linking to other libraries, but it seems Sun is only interested in sustaining the Red Hat Enterprise Server (again, why the deprecated libraries?).

Anyway... I've been down this road many times before, and the best course is always to ask. I can probably solve the libtermcap issue, but I'll just get asked for something else not included in Gutsy. Since you've posted the number one Google hit on how to install the Sun server on Ubuntu, where are the answers, please?

Posted by Carey Barnett on December 16, 2007 at 05:58 AM EST #

Hi there, I ran across this entry trying to figure out why an install of 7.0u2 on Ubuntu 8.04 is failing. I'm a long time fan of the SWS/NES webserver (just ask dzm) and am trying to get it installed on a SunFire v20z. It goes through all the normal install questions, but after the question about the JDK it always tells me that it doesn't have enough disk space. It's got 62 Gb available, so I don't really think that's an actual problem. I'm trying to rack my brain because I think I've seen this problem before somewhere in the SWS6.1 world, but I can't seem to recall what it was. Thanks.

Posted by Steve on May 11, 2008 at 09:30 AM EDT #

Steve - You're likely running on a 64-bit installation of Ubuntu without the 32-bit compat libs installed. A component of the installer is a 32-bit executable and requires that you have ia32-libs and libstdc++5 installed.

apt-get install ia32-libs libstdc++5

You should then be golden.

Posted by DzM on July 09, 2008 at 01:46 PM EDT #

"Digression Warning: QTPated was odd in that, while it installed in my 'Application->System Tools' menu, it would not execute properly. When I start it, it would complain: 'No device found. Maybe you're not using root user'. Which is true. I do not see how, in Ubuntu, you declare that a menu entry should run as root - thus you should be prompted for the root password. Consequently; to get around this problem, simply open a shell and execute the following command: 'sudo qtparted'. Maybe someone can enlighten me."

In Ubuntu you can right click the menu and edit the menu. The you goto -> system tools. Once there you select QTParted then click on Properties there you can edit the command to say "gksudo qtparted" . Close both dialogs and now qtparted should prompt you for a password before starting.

Yes I am fully aware at this long way of doing things but I did not design Ubuntu. At the very most you do it once and it will work every time.

Posted by Jonah Brown on August 24, 2009 at 06:19 PM EDT #

"I'm have problem at installation in UBUNTU Web Server apache, i write next: $ sudo apt-get install apache5 and it writes to me: E: can not find a package apache5 . What is such? What to do me? Thanks in advance."

Hi sash The command should say sudo apt-get install apache2.

Posted by Jonah Brown on August 24, 2009 at 06:23 PM EDT #

Post a Comment:
  • HTML Syntax: NOT allowed
About

kenkranz

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today