Saturday, March 15, 2008

Sun Webserver on Debian

Recently I needed to put together a web server for a few websites. The
hardware was put together on the cheap. It is amazing what you can get
with a few hundred dollars. The hardware consisted of a MSI motherboard
with an AMD dual core processor, two gig of ram and two sata hard
drives. All the hardware came in under $450.00. I installed the latest
version of the AMD64 Debian to run a headless system with software raid
1. I then installed Sun's web server which is available for free
without support. It also comes with 64 bit support for the AMD
processor. The only wrinkle I ran into during the install was that the
JDK that comes with the installation of the web server will not install
on Debian because of missing libraries. I worked around this by
installing the latest JDK from the Debian repository. I am using the
stable version so I did use apt pinning to pull that from the unstable
branch as some libraries are needed that are not in the stable branch.
I also installed Postgres 8.3 this way. Other than that, the install of
the web server went flawless. The start and stop scripts even appeared
to start the web server on system boot which was very nice, especially
since Debian is not officially supported by Sun.

After the install, web server maintenance was a breeze. I needed to
setup a few virtual hosts and I wanted them to be ip based. It took all
of about three minutes through the web interface. I looked at the Sun
web server a few years back and found the web interface to be somewhat
confusing. However, they have since redone the whole interface and it
is much more intuitive and straight forward. I found it very easy to
work with.

The web server also supports webdav out of the box. I decided to try
to allow users to change their files using webdav instead of setting up
an ftp server. This would trim one running process and also be one less
security detail to lock down. The webdav was easy enough to set up, but
I did have a slight problem getting the security to work properly.
However, a short trip to the Sun web server forum, where I received
several helpful answers almost immediately, solved the issue.

I chose to try Sun's web server over Apache because not being a long
time Linux guru, and needing extremely tight security on web systems in
todays environment, I felt much more comfortable with Sun's server.
With Apache, set up can be quite complicated and, in my opinion, it is
much easier to accidentally open up a security hole. It is too bad
Sun's marketing material bills the web server as best used for medium to
large installations, because it will work just as well for a small company.

One other thing I wanted to mention was what I was very impressed with
the speed of the server. It is fast at serving content up. I do not
claim to have benchmarks and what not, but coming from 32 bit hardware
and operating systems running IIS and SQL server, I was impressed. I am
sure it was a combination of the Linux kernel optimized for the
processor and then the web server optimized for the 64 bit chip, but the
speed is impressive nonetheless.

On a different note, when time permits, I will be trying out running a
Phobos app on Sun's web server. The web server is convenient over the
application server in the fact that it binds to port 80 and runs out of
the box as user nobody and has lots of virtual hosting tools. You can
use Glassfish to do the same thing, but of course it is not geared as
much for that purpose. Phobos could take the place of say asp or php on
a web server for a web host. A company could advertise web hosting
with server side javascript enabled out of the box with an open source
database.

I am happy to see Sun accepting the model they have for software as far
as licensing and support. Even though small companies may never want to
pay what a Sun support contract would cost them, I have found the Sun
employees on the forums to be most helpful. The more system admins and
developers that can use the software, the bigger ecosystem of free
support will be available out there on the web free of charge for small
users. With software, the better products doesn't always necessarily
win, it is the product that develops the largest user base for one
reason or another. Profits understandably must made, but is uncanny how
sometimes that profit will kill the product in the long run because
another product become more popular. I believe Sun is heading in the
right direction as far as growing their user base for their products and
I am happy to see it. Now if we could only get Solaris to run on dirt
cheap hardware . . .

8 comments:

Chhandomay said...

Nice to see that you like our product. As for cheap hardware, we do have powerful servers in the order of thousand bucks. you can actually try one free for 60 days without any obligation via our try-&-buy program.

server:http://www.sun.com/servers/entry/x2100/
try & buy program: http://www.sun.com/tryandbuy/

thanks

jyri said...

Most likely Solaris will run on that same dirt cheap hardware! ;-)

Tony Zakula said...

About six months ago when I tried Open Solaris with some SATA drives, I could not get it to load. After reviewing the Open Solaris web site, it seemed that only a few Sata Drivers were supported. I have yet to have trouble loading Linux on anything. I realize Linux and Solaris are different systems and Solaris has been in the large enterprise for many years running mostly on Sun hardware.

/k said...

What kind of memory footprint does Sun web server use ? My hosting environment (VPS based on Xen) is memory constrained so I have been using Nginx over Apache. However, I would like WebDAV and some other goodies.

Tony Zakula said...

Good question. You can check Sun's website for the recommended technical specs. I will say that my entire headless Debian system with Sun's Webserver, Postgres 8.3 and a couple of other utilities running, is only using 745.86 MB of Ram. With 2G available, I am not close to going to swap yet. I have five virtual hosts set up with Java apps on three. Hope this helps.

cvr said...

Nice reading and great summary! Thanks so much. In addition to performance and scalability, what's interesting about Sun Web Server is that its support for heterogeneous (native and Java) dynamic web technologies, coupled with its manageability and ease of deployment.

Glad to see you had good experience with Sun Web Server. Also interesting is your perspective on the software business model (the word freemium comes to mind!).

Cheers.

meena said...

I tried running Sun Java System Web Server 7.0 update 3 on Debian Lenny . Here is top output :

Simple Web Server (core) without web container :
VIRT RES SHR %MEM
76392 12m 5204 5.1

Simple Web Server (core) with WebDAV without web container :
VIRT RES SHR %MEM
76864 13m 5500 5.2

Simple Web Server with web container :
VIRT RES SHR %MEM
588m 107m 19m 42.7



where
%MEM - Memory usage (RES) A task's currently used share of available physical memory.

VIRT - Virtual Image (kb) The total amount of virtual memory used by the task. It includes all code, data and shared libraries plus pages that have been swapped out.
VIRT = SWAP + RES.

SWAP - Swapped size (kb) The swapped out portion of a task\342\200\231s total virtual memory image.

RES - Resident size (kb) The non-swapped physical memory a task has used.

SHR - Shared Mem size (kb) The amount of shared memory used by a task. It simply reflects memory that could be potentially shared with other processes.

meena said...

For Administration Server instance, top output is :
VIRT RES SHR %MEM
569m 81m 20m 32.7