Firefox Browser as Local App
Introduction
This document is a guide for the setup and use of Mozilla-Firefox as a LOCAL APPLICATION on Linux Terminal Server Project. To ease switching the WORKSTATION configuration between the LOCAL browser and one running on the SERVER, requires some additonal entries to the lts.conf file and use of a shell script to launch Mozilla-Firefox. The installation of additional shared libraries to support Firefox and printing from the workstation are required. To use multimedia plugins and printing from Firefox WORKSTATION requires the addition of shell scripts on the LTSP workstation root filesystem to handle these functions.
Copyright and License
This document, LTSP Firefox Local Browser is copyright (c) 2005 by William J. Stotts. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is available at
http://www.gnu.org/copyleft/fdl.html
Disclaimer
No liability for the contents of this document can be accepted. Use the concepts, examples and information at your own risk. There may be errors and inaccuracies, that could be damaging to your system. Proceed with caution, and although this is highly unlikely, the author(s) do not take any responsibility.
All copyrights are held by their by their respective owners, unless specifically noted otherwise. Use of a term in this document should not be regarded as affecting the validity of any trademark or service mark. Naming of particular products or brands should not be seen as endorsements.
Feedback
Feedback is most certainly welcome for this document. Send your additions, comments and criticisms to the following email address:
Mail
Requirements
The method outlined in this document assumes that LTSP version 4 or above has already been installed and working on the server and workstation(s). LOCAL APP support must also be installed and working. It is important to note that this should work in other Linux distributions, however it has only been tested in the following distributions:
- White Box Linux (based on GPL components of Red Hat Advanced Server version 3... other similar distributions such as CentOS should also work)
Installation of Firefox
Installing Firefox
To install Firefox as a LOCAL APP I used the Firefox Installer even though as a general rule I try to always use the distributions package management system to install software on production servers. Start by opening a root shell on your X session. If you are not already logged in as root, be sure to use ("su -") before doing this so you inherit root's environment. See listing below:
~$ su -
Password:******
~# cd /tmp
~# tar -zxvf /mnt/dld/mozilla/firefox-1.0.installer.tar.gz
~# cd firefox-installer && ./firefox-installer
After you have a fully installed Firefox on your SERVER, you then need to duplicate it onto the $LTSP_DIR tree, duplicating the installation path. (ie: /usr/lib/firefox becomes /opt/ltsp/i386/usr/lib/firefox) Once again do this as root. See listing below:
~# rsync -tlprogv /{absolute path to firefox}/{firefox-install-directory} \
$LTSP_DIR/i386/{absolute path to firefox}/{firefox-install-directory}
Installing the Support Libraries
The next step will be to install the LTSP Local Firefox Support Libraries package that provides the proper shared library environment for Firefox. These libraries were built with the same GLIBC version as the LTSP lbe environment and hence are compatible. Without them, Firefox will fail to run as a local app. This is a self extracting archive which will install the libraries to your LTSP file system after you provide the paths requested by the installation script.
See installation example below. Note the default directories inside brackets:
~$ su -
Password:******
~# {path to installation archive}/LTSP_Firefox_localapp-v.9.sh
LTSPv.4.x.x Mozilla-Firefox LOCAL APP Package v0.9 - starting installation... please wait
press CTRL-C to abort installation...
Enter the full path of your LTSP dir [/opt/ltsp]:
press CTRL-C to abort installation...
Enter the location of the firefox directory relative to the \
LTSP root [/opt/ltsp/i386/usr/lib/firefox]:
copying libraries to LTSP root...
Installation of Mozilla-Firefox libraries is complete
Testing the Local Browser
Before testing the installation, each user's HOME directory needs a directory named ".tmp" created. In order to automically create this directory for users added in the future, I added a .tmp directory to the "/etc/skel" file tree used during user account creation. During R&D and testing of this method I found it was necessary to add this ENV var to enable streaming multimedia. If you have no intention of using multimedia apps as helper apps this may not be necessary. Once this is completed you can test the local browser setup using the following command:
~$ ssh $LTSP_HOSTNAME TMPDIR=~/.tmp DISPLAY=$DISPLAY /{path to firefox}/firefox
In order to debug, don't add an ampersand since you'll want to be sure to see any error that may occur. If everything went as expected you should see Firefox on your desktop in a short time depending upon the workstation memory size and CPU speed.
Accessing the Local App Browser
To give the workstation user access to the local browser a new desktop link and/or menu entry will be necessary. These will depend upon the desktop and window manager being used. The administrator also must decide if he/she wishes to leave usage of the local browser up to the end-user, or configurable only by the administrator.
Creation of Menu Entry and Desktop Link
For add a menu entry for Local Firefox inside the KDE menu I created a new *.desktop file. On
RedHat? adding this file to the "/usr/share/applications/" directory, and then creating a symlink to it in "/usr/share/applnk-redhat" puts it on every users menu.
*
redhat-locapp-web.desktop: Menu link file for Local App Firefox
To add the link as a desktop icon, place a KDE "Shortcut" to the redhat-locapp-web.desktop file on the desktop of the user. Or copy it into the users Desktop folder.
Controlling Access to Local Firefox from lts.conf
To serve the function of allowing the LTSP configuration to control access to Local Firefox I use an entry in the lts.conf file. Create a configuration entry in the particular workstation config section for each workstation you wish to use a local browser on. This entry should be LOCAL_BROWSER=Y or LOCAL_BROWSER=N. For this to work correctly you must start your browser session from a script. This will allow a mix of workstations to have either local or server browsers depending upon the configuration setting in lts.conf. For each workstation you wish to configure for local browser access see excerpt from lts.conf below:
[ws009] # workstation with local browser
....
LOCAL_BROWSER = Y # defaults to N
Starting the Browser With a Script
To use this lts.conf entry the browser must be started from at the very least a minimal shell script as shown below:
------------------------------snip
#!/bin/sh
# partially lifted from htmlview script in Red Hat
#
# start browser in LTSP
#
xhost +;
exists() {
local p
if echo "$1" | grep -q "/"; then
if [ -x "$1" ]; then
return 0
fi
fi
for p in `echo $PATH |sed -e "s,:, ,g"`; do
if [ -x "$p/$1" ]; then
return 0
fi
done
return 1
}
# set path and name of browser
#
i="/usr/lib/firefox/firefox"
# check lts.conf for LOCAL_BROWSER setting
#
ltspinfo -h $LTSP_HOSTNAME -c LOCAL_BROWSER
if [ "$LTSP_LOCAL_BROWSER" = "Y" ]; then
LOCAL_BROWSER="Y"
else
LOCAL_BROWSER="N"
fi
# run browser locally if $LOCAL_BROWSER = "Y"
#
if [ $LOCAL_BROWSER = "Y" ]; then
exists $i && exec ssh $LTSP_HOSTNAME env TMPDIR=~/.tmp DISPLAY=$DISPLAY $i $*
else
export DISPLAY=$DISPLAY
exists $i && exec env TMPDIR=~/.tmp DISPLAY=$DISPLAY $i $*
fi
fi
------------------------------snip
With the setting above and running Red Hat, the script I modified is named "htmlview". This is the replacement script:
- htmlview: Modified Red Hat htmlview script
Printing from the Local Browser
To be finished soon!
Helper Applications and Multimedia Applications
To be finished soon!
Troubleshooting Hints
To be finished soon!
Where To Find Help
Email William J. Stotts at
Mail
This information is derived from a yet unreleased
LTSP Firefox LOCAL Browser HOWTO currently be authored by myself.
--
WilliamStotts - 13 Mar 2005