Lab 6- WWW
Setting Up Your Account
- Know your
server! If you’re the administrator, you need to configure where the “web
root” and the cgi-bin are. If
you are a “mere user,” you need to know how the administrator setup the
web services.
- mkdir ~/public_html – this
(or another appropriately named) is the directory that will hold your *.html documents
- chmod 755 ~/public_html – this
allows other users to enter the directory and see its contents
- Create an
~/public_html/index.html (or appropriately
named) document that will be the default page for your site
- chmod 644 ~/public_html/index.html – this
allows the web server to read and serve your document
Create Your Site
- Plan all
of your documents and develop a site map showing each page, all links and
included images, style sheets, frames, etc.
- Create
each of the pages, images, style sheets, frames, etc.
- Links to
pages within your directory do not need a path (relative pathing), i.e.
<A
HREF=”thispage.html”>This Page</A> works. Links to pages in
subdirectories you make should also use a relative path, i.e. <IMG SRC=”images/new.gif”> works.
- chmod 644 *.html *.jpg *.gif *.png *.css , etc. –
this allows the web server to read and serve your documents and
information
CGI
- Know your
server! If you’re the administrator, you need to configure where the “web
root” and the cgi-bin are. If
you are a “mere user,” you need to know how the administrator setup the
web services.
- mkdir ~/public_html/cgi-bin – this
is where all the binaries you want to execute will reside.
- Create a ~/public_html/cgi-bin/file – this
is your executable.
Important: The first line of data your script needs to output is: Content-Type: text/html
- chmod 645 ~/public_html/cgi-bin/file – this
allows the server to read and execute your file
- Your HTML
documents should reference the CGI as follows:
<A HREF=”cgi-bin/file”>Run
Me</A> -- Note the use of a relative path, as mentioned above
Things To Remember
- Consider
your audience. Remember my guidelines from the presentation: size, use of
images, complexity, etc.
- Plan your
site! People will know if you used buble-gum and duct tape when creating
the site.
- Look at
sites and learn what a good and a bad site are. Try to define (in your own
words) what makes a site good for you and emulate it on your own site.
- Steal!
The easiest way to get ideas for a site, learn how to do something in HTML
or JavaScript, or get images is to take them from another site. If people
didn’t want you to access their information, they wouldn’t put it on the
web.
Important: Look for and be aware of copywrite notices on a page and
honor them! When in doubt, ask for permission.
- Be
careful with CGI that accepts input: don’t be responsible for a hack
machine because somebody buffer-overflowed your script!
- Before
changing an active site, make copies of the original file. Leave the
originals active and do your testing with the copy.
- Have fun
and be creative!!! The web is an empowering tool. Use it wisely and to
your advantage. Remember, anybody on (or off, if you’re lucky enough to get
a ride in the Space Shuttle) can see what you put out there…
- If
hosting on an LSU server, be aware of the LSU Web
Guidelines: http://www.lsu.edu/homedocs/disclaimer.html