Link to home
Start Free TrialLog in
Avatar of uuccu
uuccu

asked on

Stand alone linux/unix box just for web browsing

Hi Can anyone suggest where I can find good info on how to set up a stand alone computer that only has the ability to view web pages?
It would be on our LAN and would be for people to access our library database (which is web accessable) although if its successful we may use it as an open web browsing machine. We want it to be as secure as possible so I assume having it on a box with nothing else on it than a cut down OS and web browser is best option, as opposed to a windows installation which requires a license and is likely to be more open to hacking etc.

As a side note is there any way to restrict which pages such a machine can visit ie only the library site pages? I resonably new to linux/unix but am looking forward to learning, and would appreciate any help .

Many thanks
Ian G
Avatar of Anonymouslemming
Anonymouslemming

The easiest way to do this would be to setup a Linux machine with no DNS, and if the Library web server is on the same network, no router information.

Then add the hostname and IP address of the Library webserver to /etc/hosts and the Linux machine will be able to view it in a web browser.

Because there is no DNS, users would not be able to resolve hostnames for other sites so would not be able to connect to them unless they already know the IP address. If both machines are on the same network, then no gateway is required, so even if a user knows the IP address of a website, they won't be able to reach it.

That's the easiest solution, and as such is quite primitive. There are other things you could do with a squid proxy, but that may be more than you require.
In addition to what Anonymouslemming stated, you probably want to create a Linux Kiosk.  An excellent treatise on doing something like this is available at:

http://www.linux.com/howtos/Kiosk-HOWTO-1.shtml
The Plaza hotel has a system like this in their rooms.

Not a kiosk, just a linux booting up to a simple window manager (e.g. fvwm2 with nothing accessible), and a cron job every minute or two to make sure the browser is running.  
Avatar of uuccu

ASKER

Many thanks guys - very helpful, and that site is excellent. bytta that sounds similiar to the HOW TO web site listed, using FVWM - this is probably a stupid question but exactly what is a cron job - does it just check that the browser is loaded? and is fvwm just like x windows?
cron is a daemon that runs previously scheduled jobs at regular intervals.     For example, you can run a job every n minutes, every n hours, every n days, every n months, the nth occurance of a day, etc.  It's quite flexible.  I use cron jobs to retrieve my mail every 10 minutes and to schedule snapshot backups every hour.  The possibilities are endless.

An excellent read (if you have a Linux or Unix box available) is

man 5 crontab

which will give you all of the details.
Sorry about that - I didn't bother to check the link.
I thought a kiosk was something else, but I was in fact describing the one in the link. No points for me...
If you use the howto - just make sure to replace "Netscape Navigator" with something more recent (like Firefox or Opera).

But to clarify, a window manager is an X client (in X windows) that allows you to run GUI programs like browsers. There are "simple" ones like fvwm2, and full desktops like KDE and Gnome.
The "simple" ones can be configured from being "empty" (easy in fvwm2) up to doing more than KDE and Gnome (easy in IceWM).  The possibilities are endless.
Here's a list of most of them: http://xwinman.org/

Avatar of uuccu

ASKER

Just looking at the site for fvwm2 and have downloaded the latest stable version in order to follow the HOW TO site. This is my first install on linux so thats fun! To install fvwm2 do I just run .tar.gz files? This is all new to me and how do I go about making the machine boot into fvwm automatically? The site seems to only deal with indeph problems, as opposed to someone completely novise as my self. Any ideas?
FIRST you need to have a Linux OS running on your machine.
THEN you can download and install fvwm2.
The HOWTO assumes you have done that already (only a few lines in "2. Overview" about the setup).

Most, if not all, Linux distros (Debian, Suse, RedHat etc.) have fvwm2 as an install option, so if you downloaded fvwm2 I assume you don't have a Linux OS running on your machine.

Get a Linux distro CD, install a custom setup where you skip almost everything but the basics + fvwm2 + browser + tools for administrators. There are hundreds of questions about "the best distro" and how to set up linux here.
I would reccommend Suse for easy install, debian for easy maintenance.
Avatar of uuccu

ASKER

Thanks for all the help everyone, I think the howto guide is my way to go, now I know this is a bit of the track but im still having difficulties. For one thing I cant find any reference to fvwm when setting up my red hat v 9. I went through all the packages and didnt see it listed. So i guess ill have to download it. which should be fine, but does bring me to the point of finding drivers for my net gear network cards, in order to get on our network and access the internet. And how can i get drivers for things if i cant access the internet. ohhh i thought this would be simpler somehow. If i get drivers download them on a windows machine how can i get them to my linux machine, would a usb key work? burn to cd? I know these are more newbie questions I when i get the time i should just start searching the net for the answers.
To be honest,  I'd do two things:

1) Abandon RH9 and get a more modern version.  If you like RH9 then get Fedora Core.  It will probably have the drivers that you need.
2) Install Linux and play with a fully working system first.   If you gain a bit of understanding of the OS prior to embarking on what is essentially a custom system, you'll be much happier.

To make the waters even murkier, you can do what I have done here to make custom terminals:  I use Knoppix (www.knoppix.org).  This is a Linux distro that runs from CD, so you don't need to install floppy disks or hard drives, thus making your systems more quiet and with lower power consumption.  I have some cheapy boxes that act as terminals for web browsing, web mail and terminal server access.  Sounds kind of like your requirement, eh?  

Knoppix is  fully customizable, so you can create a single CD image to you needs, then burn as many copies as you'd like.  It supports darned near every hardware device supported by Linux.  Just a thought...
Avatar of uuccu

ASKER

Actually I have played around with Knoppix before and i do like it a lot, but how can you customise it? I mean i runs from a cd, do i copy it to a hard disk or something?
The process is called remastering.  You can either do a google search for "knoppix remastering" or take a look at this project:

http://www.knoppix.net/forum/viewtopic.php?t=12530
Avatar of uuccu

ASKER

Hi Ive made a lot of progress using a Suse installation, and have made my way through about half of the tutorial listed http://www.linux.com/howtos/Kiosk-HOWTO-1.shtml which is excellent. But if anyone is familiar with this tutorial I have a question. Run Level 4 is used as a Kiosk mode (so that on starting the machine it will go straight into the web browser). And I have made the change in the  /etc/inittab script to go into level 4 by default. And that works great. When I start the machine it boots up so far and displays message about entering run level 4. But then it just stops at the linux prompt.

In the tutorial it says make the script /etc/rc.4/S99xkiosk - which i have done exactly as in tutorial but the system never seems to reach the script, there is an echo message at the bginning of it so i know its not reachoing the script and having a problems with some command in it.

 So my main question is how do i get the script i created (S99xkiosk) to run automatically after entering run level 4.

By the way in the tutorial it lists the directory as rc.4 but on my system the directory is called something similair but different - like rc4.d (i am not at the llinux right now). Any comments?
In SuSE you'll want that script to be in:

/etc/rc.d/rc4.d

Ensure that you make it executable:

chmod +x /etc/rc.d/rc4.d/S99xkiosk


The variation of the location of the file is due to the difference between the "SuSE" and whatever flavor that the kiosk site is using.
Avatar of uuccu

ASKER

Ahhh my mistake I had forgotten to chmod the script, now at least it gets to the script, but there seems to be an error with it (I copied it directly from the site)
i get the messages...
S99xkiosk: Line 1 : syntax error near unexpected token 'new line'
S99xkiosk: Line 1 : '<!Doctype html Public "-//w3c// DTD HTML 4.01 Transitional //en">'
Runlevel 4 has been xkiosk

I have copied both the S99xkiosk and xkiosk scripts directly from the site. Do these error message mean anything to anyone?
Simple - you saved S99xkiosk as a web page... :)

Copy and paste from the browser into an editor instead of saving the web page from the file menu.
Check both files and make sure they just contain the script parts.

S99xkiosk:
starting with "#!/bin/bash" and ending with "# All done"
But for your own sanity - change "netscape" to something more recent - like firefox

/root/xkiosk: #just one/two lines  - the "\" at end of line 1 is to "escape" the enter so the command continues on line 2:
/usr/X11R6/bin/xinit /root/kiosk.xinitrc -- /usr/X11R6/bin/X \
-xf86config /root/kiosk.XF86Config bc
OR
/usr/X11R6/bin/xinit /root/kiosk.xinitrc -- /usr/X11R6/bin/X -xf86config /root/kiosk.XF86Config bc
Avatar of uuccu

ASKER

Doh! Thats what I get for using the mozilla editor to make the scripts.
Many thanks, although now when I boot the machine into Run level 4 it just restarts over and over!

I tried editing out the line in S99kiosk that says "/sbin/shutdown -r now" and it doesnt restart, but finds errors in the script saying that a ] is missing and that permission is denied to root/xkiosk

sigh - sorry
You need execute permissions on both files:
chmod 755 /root/xkiosk

Don't know about the "]", but I think it must be in this line:
if [ -f /.netscape/lock] ; then
----------------------^^^----   <- add a space between "/.netscape/lock" and "]"

Looks like you're almost there...
Avatar of uuccu

ASKER

hhmmm ok that sorted out the error messages, but the machoine still reboots unless I comment out the /sbin/shutdown -r now bit. So it worked the first time, started up into kiosk mode. great (although it couldnt find my proxy settings so no access to internet). Now though when i switch machine off and restart  it starts to boot into run level 4, and then stops reporting :
Fatal Server error: Cannot run in frame buffer mode. please  specify bus ids for all frame buffer devices.

Perhaps I have chmod the wrong file? I cant think i have done anything else from the first time  it worked.

Oh so close and yet so far.
/root/xkiosk contains the "xinit" command to start up the X server - You have never used it like this before, and that is the one that is failing.
It is calling xinit and assumes you have the config files /root/kiosk.xinitrc and /root/kiosk.XF86Config
Read the xinit manpage for more info

Your problem is that the HOWTO is missing a few files that should be in your /root/ directory (everything containing /root/ in the files you've saved points to files you probably don't have)

You can skip the config files by changing /root/xkiosk to:
------
/usr/X11R6/bin/xinit  -- /usr/X11R6/bin/X bc
------ or
/usr/X11R6/bin/xinit  -- /usr/X11R6/bin/X :0
------
and hope for the best - it worked before, right?

If it fails, here's one version of the files you need (from another kiosk HOWTO - ch 4)
 http://csu.colstate.edu/webdevelop/linux/kiosk_howto/index.htm
...but the defaults on your machine are probably better.
Avatar of uuccu

ASKER

Thanks for that,  I changed the xkiosk file to as you listed , i even tried starting from scratch but the same thing is happening as before, it loads a very basic looking gui with an xterm window running that lists itself as in the Sh-2.05# dir. But no sign of mozila. and when i type exit into window it just exits the gui.
It seems like your understanding of linux is rather limited.

This is how it goes...
1 - your machine boots up
2 - S99xkiosk runs - calling /root/xkiosk and waits for it to finish
3 - /root/xkiosk runs - calling xinit, which starts the GUI and waits for it to finish
---- The GUI is defined in xinitrc - so if you don't call /root/kiosk.xinitrc it uses the default, which is just "a very basic looking gui with an xterm window running"
4 - when everything in xinitrc has finished - it exits so /root/xkiosk can finish
5 - when everything in /root/xkiosk has finished - it exits so S99xkiosk can finish
6 - the S99xkiosk ends by rebooting so the circle is complete -> back to 1

your GUI is defined in the xinitrc. you need a /root/kiosk.xinitrc that opens fvwm2 and a browser.
there's on in ch. 3 of the original HOWTO - so you need to save it to /root/kiosk.xinitrc and change /root/xkiosk back to:
/usr/X11R6/bin/xinit /root/kiosk.xinitrc -- (+whatever works for you after the "--")

Note that  kiosk.xinitrc from the howto references 3 xpm files you don't have so you might want to change that. Also change the following lines to what you are using:
        if [ -f /.netscape/lock] ; then   # change this to the lock file you use
                rm /.netscape/lock
        fi
        /usr/bin/netscape -geometry 800x600 # change this to e.g.: /usr/bin/firefox -width XXX -height YYY




Avatar of uuccu

ASKER

Success !! Man you have been so patient with me, many thanks you are indeed correct I am a real newbie to linux, and your last post really put things into focus for me. A little understanding goes a long way. It does indeed boot straight into the GUI and runs my browser, all I need to do now is get it to find my proxy settings, but I should be able to work that out, I guess I have to add certain network services to the run level using the YAST editor (im guessing there are other ways of doing this other such as copying the files into the rc4.d folder).

Anyway many thanks.

Ian G
Avatar of uuccu

ASKER

I have it up and running now, many thanks, just out of interest, which file should should I add details such as background colour etc to the kiosk.xinitrc file or some other file (I would have thought it should be getting these details from the system.fvwm2rc file because when I boot up in run level 5 it looks great, but still in my run level 4 while it works just has nasty black and white background).
Many thanks
ASKER CERTIFIED SOLUTION
Avatar of bytta
bytta
Flag of Iceland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of uuccu

ASKER

Many thanks