Вы находитесь на странице: 1из 19

Creating A Web Site on AFS

Professor Blank

NJIT
Introduction
 This is a “quick and dirty” explanation of
creating a Web Site on the NJIT AFS system.
 For a more detailed explanation, try http://
help.njit.edu. This link may have the
information you need: http://
csd.njit.edu/resources/webservices.php
 See also:
http://ist.njit.edu/accounts/afs.php

2 05/19/09
Starting Your Homepage
 Unless you really know what you are doing, you
should use NJIT’s automated process to initially
create your Web site. For instructions, go to
http://web.njit.edu. From the menu on the left
select the last topic, User_Homepage. From the
submenu, select Setup.
 Actually, all you have to do is login to AFS and run
the shell script home.page.setup.
 This will create a default home page and handle
basic tasks like setting file permissions for you.
3 05/19/09
Servers Available to Students
 The AFS system has 39 servers available to
students. http://afs1.njit.edu through afs36 are for
academic use. prophet.njit.edu has Oracle installed
for database courses. web.njit.edu is a web server
that allows others to access your web site in
public_html. harp.njit.edu is a special purpose web
server that allows sound and video, which are
blocked on web. All use the same login and file
structure, so any files you create on one server can
be read, executed and changed on any other.

4 05/19/09
Security Requirement
 As of the Fall 2007 Semester, off-campus access to
AFS must use Secure Shell (ssh) over a Virtual
Private Network (VPN).
 To download software (including regular VPN) you
must use VPN. This is possible with webvpn. Go to
http://webvpn.njit.edu or follow the instructions at
http://telecom.njit.edu/vpn/WebVPNInstall.html
 Once you have a VPN connection, you can download the 
Secure Shell software at 
http://ist.njit.edu/software/index.php
5 05/19/09
Connect to AFS and Log In
 Use the
Secure Shell
Client and
your UCID
username and
password to
log on the one
of the AFS
machines,
such as
afs23.njit.edu:

6 05/19/09
Use Secure FTP
 You can use
the Secure
File Transfer
Protocol
program to
upload your
materials. The
SSH Secure
File Transfer
Client is
provided when
you get SSH.

7 05/19/09
Use Secure FTP
 The SSH FTP Client is a simple drag and drop
interface. Most students should have little trouble
figuring it out.
 If you do have trouble, try the Help selection on the
menu. If that does not work, post your problems on
Web Board and I will add enough detail to this
presentation to guide you through it.

8 05/19/09
Your FTP address
 It helps to know the base address of your site.
Mine is:
/afs/cad/u/g/b/gblank/public_html
 The only thing that you need to change is the
/u/g/b/gblank/ part. In my case, the u is for
users, so yours will also be u. The g and b are
the first two characters of my username. Use the
first two characters of yours. The next section is
your username. If your user name is xyz123
then you would specify:
/afs/cad/u/x/y/xyz123/public_html

9 05/19/09
Create a Menu
 Your menu file should be an html file named
index.html or menu.html. A Web Browser can
find either of those automatically.
 I recommend that you create a directory for your
projects, such as /cis602, with a separate
directory for each assignment, such as /hw1. You
can have an index.html file at your base
directory that can load the other files. If you go to
my Web Site and "view source" in your browser you
can see how I do it. That will give you directories
like:
/afs/cad/u/x/y/xyz123/public_html/cis602/hw5

10 05/19/09
Using Unix
 Use Unix commands to create your directories:
You can find a list by searching the Web.
 mkdir - create a directory
 cd – change directory
 ls – list files
 cp – copy a file
 mv – rename or move a file
 rm – delete (remove) a file
 setacl – give permissions to read/write a file

11 05/19/09
File Permissions
 For people to read files on your Web Site, you may
have to set the file permissions.
 The normal Unix permissions like chmod are
ignored by AFS. Instead, it uses an access control
list managed with the command setacl.
 For a description of setting permissions, go to
http://web.njit.edu. From the menu on the
left select the first topic, AFS, then subtopic
CheckPerms, then subtopic How to set AFS
permissions.
12 05/19/09
Creating and Accessing Files
 I recommend that you use AFS1 through AFS36 to
develop your website and do your course homework.
Actually, AFS1 and AFS2 are the most heavily used
after WEB and PROPHET. AFS12 through AFS33
tend to be more available and have better
performance since they have fewer users.
 If you create a web site, others can view your web
pages in public_html and its subdirectories on WEB,
or on HARP if it uses sound or video.

13 05/19/09
Finding Your Web Site
 Your Web site will be at
http://web.njit.edu/~xyz123/index.html with
a full path of
http://web.njit.edu/~xyz123/cis602/hw5/hw5.java
etc. Of course, you will have to substitute your
username for xyz123.
 Don’t forget the Tilde ( ~ )!

14 05/19/09
Public Access to Web Site
 Other users can find your Web site at
http://web.njit.edu/~xyz123/ if you have
an html file named index.html or menu.html
in your public_html directory. Otherwise, they
will also have to know the name of the file to run.
Of course, they will have to substitute your
username for xyz123.
 If your Web site has sound or video they can use
http://harp.njit.edu/~xyz123/

15 05/19/09
A Quick and Dirty Home Page
 For a fast start to creating your home page, just
steal my sample home page at
http://web.njit.edu/~gblank/cis602/StealThis.html
 Follow the instructions on that page and edit it to
create your own menu. If you do not have an
HTML editor, you can use Microsoft Word, as
long as you select html as the file type when you
save the file.

16 05/19/09
Common Problem
 When I try to access with a browser I get:
http://afs1.njit.edu/~ro5/myclasses
403 Forbidden
You don't have permission to access
/~ro5/myclasses on this server.
 (This student did not use the script mentioned
on slide 3 to create his Web site.)

17 05/19/09
Solution
 To point a browser to a URL like
http://afs1.njit.edu/~ro5/hello.html
first run on AFS the following program:
$ home.page.setup (just type it and press enter)
See this web site below for more information
http://web.njit.edu/all_topics/User_Homepage/Setup/
This will create a public_html directory. If you create
the directory manually any subdirectory inside the
public_html directory you created before you ran the
program above must be removed first. Otherwise
you will get a message saying access forbidden.
18 05/19/09
Note:
 You should not use a Web browser on AFS1
through AFS 36 for http at all. Those systems are
reserved for creating your programs, or running
homework programs in a Unix shell. The only AFS
systems you should be using to access Web
services are http://web.njit.edu and
http://harp.njit.edu . This will allow more people to
use the system without overloading it. You can see
the AFS for yourself in the GITC 2315C AFS Lab.

19 05/19/09

Вам также может понравиться