15.2 Browsers

FreeBSD does not come with a particular browser pre-installed. Instead, the www directory of the ports collection contains a lot of browsers ready to be installed. If you do not have time to compile everything (this can take a very long time in some cases) many of them are available as packages.

KDE and GNOME already provide HTML browsers. Please refer to Section 5.7 for more information on how to setup these complete desktops.

If you are looking for light-weight browsers, you should investigate the ports collection for www/dillo, www/links, or www/w3m.

This section covers these applications:

Application Name Resources Needed Installation from Ports Major Dependencies
Mozilla heavy heavy Gtk+
Netscape® heavy light Linux Binary Compatibility
Opera light light FreeBSD version: None. Linux version: Linux Binary Compatibility and linux-openmotif

15.2.1 Mozilla

Mozilla is perhaps the most suitable browser for your FreeBSD Desktop. It is modern, stable, and fully ported to FreeBSD. It features a very standards-compliant HTML display engine. It provides a mail and news reader. It even has a HTML composer if you plan to write some web pages yourself. Users of Netscape will recognize the similarities with Communicator suite, as both browsers shared the same basis.

On slow machines, with a CPU speed less than 233MHz or with less than 64MB of RAM, Mozilla can be too resource-consuming to be fully usable. You may want to look at the Opera browser instead, described a little later in this chapter.

If you cannot or do not want to compile Mozilla for any reason, the FreeBSD GNOME team has already done this for you. Just install the package from the network by:

# pkg_add -r mozilla

If the package is not available, and you have enough time and disk space, you can get the source for Mozilla, compile it and install it on your system. This is accomplished by:

# cd /usr/ports/www/mozilla
# make install clean

The Mozilla port ensures a correct initialization by running the chrome registry setup with root privileges. However, if you want to fetch some add-ons like mouse gestures, you must run Mozilla as root to get them properly installed.

Once you have completed the installation of Mozilla, you do not need to be root any longer. You can start Mozilla as a browser by typing:

% mozilla

You can start it directly as a mail and news reader as shown below:

% mozilla -mail

15.2.2 Mozilla, Java™, and Macromedia® Flash

Contributed by Tom Rhodes.

Installing Mozilla is simple, but unfortunately installing Mozilla with support for add-ons like Java™ and Macromedia® Flash™ consumes both time and disk space.

The first thing is to download the files which will be used with Mozilla. Take your current web browser up to http://www.sun.com/software/java2/download.html and create an account on their website. Remember to save the username and password from here as it may be needed in the future. Download a copy of the file j2sdk-1_3_1-src.tar.gz and place this in /usr/ports/distfiles/ as the port will not fetch it automatically. This is due to license restrictions. While we are here, download the ``java environment'' from http://java.sun.com/webapps/download/Display?BundleId=7905. The filename is j2sdk-1_3_1_08-linux-i586.bin and is large (about 25 megabytes!). Like before, this file must be placed into /usr/ports/distfiles/. Finally download a copy of the ``java patchkit'' from http://www.eyesbeyond.com/freebsddom/java/ and place it into /usr/ports/distfiles/.

Install the java/jdk13 port with the standard make install clean and then install the www/flashpluginwrapper port. This port requires emulators/linux_base which is a large port. True that other Flash plugins exist, however they have not worked for me.

Install the www/mozilla port, if Mozilla is not already installed.

Now copy the Flash plug-in files with:

# cp /usr/local/lib/flash/libflashplayer.so \
    /usr/X11R6/lib/browser_plugins/libflashplayer_linux.so
# cp /usr/local/lib/flash/ShockwaveFlash.class \
    /usr/X11R6/lib/browser_plugins/

Note: If you are using www/mozilla-devel, the destination directories will be different.

Now add the following lines to the top of (but right under #!/bin/sh) Mozilla startup script: /usr/X11R6/bin/mozilla.

LD_PRELOAD=/usr/local/lib/libflashplayer.so.1
export LD_PRELOAD

This will enable the Flash plug-in.

Now just start Mozilla with:

% mozilla &

And access the About Plug-ins option from the Help menu. A list should appear with all the currently available plugins. Java and Shockwave® Flash should both be listed.

15.2.3 Netscape®

The ports collection contains several versions of the Netscape browser. Since the native FreeBSD ones contain a serious security bug, installing them is strongly discouraged. Instead, use a more recent Linux or DIGITAL UNIX version.

The latest stable release of the Netscape browser is Netscape 7. It can be installed from the ports collection:

# cd /usr/ports/www/netscape7
# make install clean

There are localized versions in the French, German, and Japanese categories.

Caution: Netscape 4.x versions are not recommended because they are not compliant with today's standards. However, Netscape 7.x and newer versions are only available for the i386™ platform.

15.2.4 Opera

Opera is a very fast, full-featured, and standards-compliant browser. It comes in two favors: a ``native'' FreeBSD version and a version that runs under Linux emulation. For each operating system, there is a no-cost version of the browser that displays advertising and an ad-free version that can be purchased on the Opera web site.

To browse the Web with the FreeBSD version of Opera, install the package:

# pkg_add -r opera

Some FTP sites do not have all the packages, but the same result can be obtained with the ports collection by typing:

# cd /usr/ports/www/opera
# make install clean

To install the Linux version of Opera, substitute linux-opera in place of opera in the examples above. The Linux version is useful in situations requiring the use of plug-ins that are only available for Linux, such as Adobe Acrobat Reader®. In all other respects, the FreeBSD and Linux versions appear to be functionally identical.

This, and other documents, can be downloaded from ftp://ftp.FreeBSD.org/pub/FreeBSD/doc/.

For questions about FreeBSD, read the documentation before contacting <questions@FreeBSD.org>.
For questions about this documentation, e-mail <doc@FreeBSD.org>.