Linux

Tips and tricks for using Netscape in Linux

It's been a long, hard road, but as Jack Wallen, Jr. shows you, making Netscape work smoothly under Linux is worth the effort.

I can safely say that using Netscape in Linux can be a pretty painless experience—after you’ve done a bit of tweaking. To make Netscape work smoothly under Linux, you simply have to install a couple of helper applications, create a few scripts, and make a few configuration edits. It's been a long, hard road, but it's more than worth the trouble!

These tips and tricks are designed for the normal user. The hard-core Linux user will find other, more elegant ways in which to bring Linux Netscape to life. In this Daily Feature, however, we’ll take the slow boat and get our Netscape a bit more stable and a lot more usable.

Start page and DNS
I'll say this as simply as I can: Do yourself a favor and make Netscape start with a blank page! By doing this, you’ll greatly reduce the start-up time. Netscape uses its own DNS resolver—which is a bad thing. Why? Because Linux already has a good DNS resolver, and the Netscape resolver was ported from Windows 3.1. So there's the rub!

Fortunately, there's a fairly simple way to deal with the DNS issue. Open your .bashrc and .Xdefaults files, and enter the following text (in .bashrc, at the end; in .Xdefaults, in the xterm (and friends) section):
MOZILLA_NO_ASYNC_DNS=True

Once you’ve entered this text, log off from X Windows and restart. The next time you open up Netscape, it should appear much more quickly.

Java
Ah, yes! The bane of Linux's Netscape port, to this date, has been Java. How often have you found that perfect Web site, only to have Netscape come crashing down on you because of some errant Java issue. Well, take a deep breath—we're going to help you out here.

There are, unfortunately (or fortunately, in some people’s opinions), many ways to solve this problem. I’ll start with the painless and migrate to the painful.

Painless
The first method of solving this issue is to eliminate Java altogether from Netscape. Yes, this removes you from the list of those happy-go-lucky viewers of those wonderful Java applets littering the Web, but it will allow you to use Netscape with nary a hitch.

To configure Netscape to no longer use Java, you have to select Preferences from the Edit drop-down menu and click the Advancedtab. Then, deselect the Enable Java option and close the Preferences box.

With Java disabled, I guarantee your browsing experience will be far less flashy but far more stable.

Add a bit of pain
The next level involves a bit o' the command line, so if you live in fear of the Linux console, you might want to brace yourself—we're goin' in!

This level of configuration deals with font paths. It's well known that an issue with Linux Netscape and Java centers around a missing fontpath entry. To be more specific, the 75dpi font path is, many times, missing from the font path.

Before you add anything to the font path, first check to see whether that's your problem. To check your font path, run the following command:
/usr/sbin/chkfontpath --list

The above command should return something like this:
Current directories in font path:
1: /usr/X11R6/lib/X11/fonts/misc:unscaled
2: /usr/X11R6/lib/X11/fonts/75dpi:unscaled
3: /usr/X11R6/lib/X11/fonts/misc
4: /usr/X11R6/lib/X11/fonts/Type1
5: /usr/X11R6/lib/X11/fonts/Speedo
6: /usr/X11R6/lib/X11/fonts/75dpi
7: /usr/share/fonts/default/TrueType
8: /usr/share/fonts/default/Type1


Note: The above output is from a Red Hat 6.2 distribution.

The line you want to take note of is
/usr/X11R6/lib/X11/fonts/75dpi:unscaled

If this line isn’t in the font path, add it. In order to add the new font path, run, as root, the following command:
chkfontpath --add /usr/X11R6/lib/X11/fonts/75dpi

Do another check, and you’ll notice the new font path in place.

Now Netscape should be really cookin'. If not, it's even more pain for you.

Even more pain
The last method we'll discuss involves implementing Java in Linux Netscape. This method is a bit more involved and requires downloading a few applications. You can download the applications you need from Rpmfind.net. The applications are simple to install.

The first application you’ll want to install/upgrade is Netscape itself. I suggest you use the 4.72-6 version. The RPMs you need are:
  • netscape-common-4.72-6
  • netscape-communicator-4.72-6

Get these from Rpmfind.net, save them in your home directory, and install them (as root). If you’re upgrading from a previous version, use:
rpm -Uvh ~/netscape*

If you’re downgrading from a later version, use:
rpm -ivh --force --nodeps ~/netscape*

Once you’ve installed these RPMs, you’ll need to get the application jdk-1.2.2 and install it on your system:

I’d love to tell you to go to Rpmfind.net, get the RPM of 1.2.2, and install it with grace. However, the only place I've actually found jkd-1.2.2 is on the Caldera 2.4 CD. This makes things a bit more difficult. Fortunately, you can get the source of 1.2.2 or you can grab an earlier RPM version. (I can't say for sure that the earlier versions will work nearly as well as 1.2.2, so you do this at your own risk.)

The source installation of jdk is not the simplest feat. Take care, once you've uncompressed and untarred the file, to read both the readme and install files located in the newly created directory. These files will do you a world of good before running that first ./configure step.

Once you've installed jdk (either by source or binary), you should be able to restart Netscape and navigate to a good Java-enabled site.

That pesky lock file
We've all had to deal with it at some point or other: Netscape has crashed on us, leaving behind that annoying lock file (in the ~/.netscape directory), and we've had to go to the command line and enter:
rm ~/.netscape/lock

Although the above command is not the most difficult to memorize or type, it's frustrating. How do we solve this problem? I've finally broken down and given myself a GNOME menu entry (within a panel drawer for networking) that’s configured to run that command at the push of a button. Anytime Netscape won't start, I press the rm lock button and the lock file is gone!

Of course, you could also create a shell script for launching Netscape that would always check for the lock file before Netscape even launches. Such a file might look like:
#! /bin/sh

if [ -h ~/.netscape/lock ]; then
 rm ~/.netscape/lock
fi
netscape-communicator


Put this file in your home directory, call it ns_start, give it executable permission (chmod u+x ~/ns_start), and use it to start up Netscape.

Conclusion
Although using Netscape can be a hassle in Linux, with a bit of patience you should be able to get the browser working quite smoothly. Give the above tips a shot. If they don't help, and you still find yourself horribly frustrated with Netscape, you may have to wait until the KDE team finishes Konqueror!

Jack Wallen, Jr. is very pleased to have joined the TechRepublic staff as editor in chief of Linux content. Jack was thrown out of the "Window" back in 1995, when he grew tired of the "blue screen of death" and realized that "computing does not equal rebooting." Prior to Jack's headfirst dive into the computer industry, he was a professional actor, with film, TV, and Broadway credits. Now, Jack is content with his new position of Linux Evangelist. Ladies and gentlemen—the poster boy for the Linux Generation!

The authors and editors have taken care in preparation of the content contained herein, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for any damages. Always have a verified backup before making any changes.

About

Jack Wallen is an award-winning writer for TechRepublic and Linux.com. He’s an avid promoter of open source and the voice of The Android Expert. For more news about Jack Wallen, visit his website getjackd.net.

0 comments

Editor's Picks