[ Table of Contents ] [ Previous Chapter ] [ Index ]

Appendix G

Utilities Accessible to Perl and Shell CGI Scripts

 

Web Ten 's UNIX Connection

 

Web Ten runs on MacOS within Tenon's UNIX virtual machine. Web Ten has been incorporated into this environment using a very traditional UNIX organization, while preserving the Macintosh experience and the Finder's desktop integration. Most Web publishing tasks do not require any knowledge of the underlying system. However, to fully exploit Web Ten 's advanced features (e.g., shell and Perl CGIs) it may be necessary to understand some of the organization of the UNIX virtual machine's file system.

 

The UNIX virtual machine uses a stand-alone file system that is self contained inside a single Macintosh file called tenon:Storage:WebTen Storage . This file is specially formatted for the UNIX virtual machine; its contents are not accessible from the Finder desktop. Web Ten 's shell, Perl and binary CGIs do have access to this file system, and the information below is provided as a road map for these CGIs.

 

 

Traditional UNIX Paths

 

Several traditional UNIX file system directories -- /bin , /dev , /etc , /sbin , /tmp , /usr and /var -- are preserved within Web Ten 's fast storage file. A small subset of UNIX commands have been included with this package to make the broadest possible capabilities available from within Web Ten . These commands may be invoked via shell and Perl CGI scripts. The utility programs that may be called from UNIX-style CGIs are shown below. The Bourne shell, for example, is accessible via /bin/sh , while the file comparison program diff is accessible via /usr/bin/diff .

 

/bin

[

df

ls

sh

hostname

domainname

mkdir

sleep

cat

echo

mv

stty

chmod

hostid

pwd

sync

cp

kill

ps

test

date

ln

rm

 

 

 

/usr/bin

chcreat

false

perl5

tar

chtype

fgrep

perl5.004

tr

cmp

grep

printenv

true

diff

mactext

printf

unixtext

diff3

mail

sdiff

vi

du

nslookup

sed

yes

egrep

nvi

suidperl

tee

expr

perl

tail

touch

 

Sendmail

 

CGIs may send mail using either /usr/bin/mail or /usr/sbin/sendmail . This is for outgoing mail only.

 

 

The Web Ten Folder

 

The WebTen folder (the folder containing the Web Ten application and any published Web content) is not contained in the Web Ten fast storage file, but it is linked to the path /usr/local/etc/httpd/ within this file system, making it accessible to any CGI. Any files or sub-folders within the Web Ten folder are accessible by appending their name to this path. For example, the file default.html for a virtual host named www.host1.com would be accessible via /usr/local/etc/httpd/www.host1.com/default.html .

 

 

Perl

 

A complete distribution of Perl 5 is included with Web Ten . The Perl executable is linked in several places for maximum compatibility with Perl scripts from other UNIX systems.

 

/usr/bin/perl

/usr/bin/perl5

/usr/bin/perl5.004

/usr/local/bin/perl

/usr/local/bin/perl5

 

The Perl libraries are installed in /usr/lib/perl5 . The WebTen folder contains a folder named tenon . Within the tenon folder, create a folder called usr , and within the usr folder create a lib folder for custom Perl libraries. Custom libraries can then be referred to via /usr/local/etc/httpd/tenon/usr/lib within any Perl CGI that requires such modules.



[ Table of Contents ] [ Previous Chapter ] [ Index ]