Warning Livedoc is no longer being updated and will be deprecated shortly. Please refer to https://documentation.tjhsst.edu.

TJ Website Editing Guide

From Livedoc - The Documentation Repository
Revision as of 18:49, 22 February 2008 by Brandon Vargo (talk | contribs) (Minor changes)
Jump to: navigation, search

File Organization

  • Anything put in the AFS filesystem appears on the website for existing domains. No webserver configuration for special directories is required.
  • All files now have a logical place in AFS, rather than some files being under /afs/csl/web/site, some others in /afs/csl/web/www, and other amounts of mess.
    • http://domain.tjhsst.edu/directory1/directory2/file.html translates into /afs/csl/web/domain/directory1/directory2/file.html. This is true for all main website documents, including main pages on the website that use the TJ theme.
    • The converse is NOT true: /afs/csl/web/directory does not mean directory.tjhsst.edu exists. Currently, this is only true for the user directory and the tjpf directory. If /afs/csl/web/domain does not exist, then some configuration will be required to setup the webserver.

Editing a Page

  • To edit a page, find the file in AFS following the above file conventions and edit with your favorite editor.

Posting a New Document

  • To post a document to the website, put it in AFS following the above directory conventions.
  • To post a page to the website that uses the main TJ theme, a few additional elements must be added to a page with one of the following extensions: .php .phtml .php5 .shtml .html .htm. It is suggested to use .php.
  • At the top, the following is required:
<?php
$category="Some Category";
$title="A title";
include "/afs/csl.tjhsst.edu/web/media/themes/current/header.php";
?>
  • Category must be one of the categories in /afs/csl/web/media/themes/current/category/, otherwise the image will not appear. Capitalization matters.
  • The title is optional. If it is included, the title of the page in the title bar will read "Category - Title." If it is excluded (leave as ""), the title bar will only read "Category."
  • The include statement, includes the theme information and is required. Be sure to use current, instead of a specific theme, so the entire site can be themed at once without changing many files.
  • Next, include the content of your document.
  • Finally, at the end, include the following:
<?php
include "/afs/csl.tjhsst.edu/web/media/themes/current/footer.php";
?>

Look at any of the pages that use the TJ theme for an example.

User Web-docs:

  • Only accessible via http://www.tjhsst.edu/~someuser, instead of being accessible from many different subdomains.
  • All users, excluding teachers and the legacy teacher webdocs directories, that have web-docs permissions are listed in /afs/csl/web/user/ (teachers and the legacy teacher webdocs directories automatically are given web-docs permissions, although the web-docs directory must still be created and given the proper access rights).

Granting web-docs permissions

  • Once authorized as your /admin user, execute the following command: fs mkmount -vol volume -dir username in the /afs/csl/web/user directory, where volume is the name of the user's home directory volume. An easy way to find the volume name is by using "fs lq" in the user's home directory. For new student home directories, this is currently in the form year.username.
  • In addition, the user must have a web-docs directory in the volume used above. This directory must give the AFS www-data user at least read (rl) access to the directory in order for the webserver to be able to read the data.

Removing web-docs permissions

  • Once authorized as your /admin user, execute the following command: fs rmmount username in the /afs/csl/web/user/ directory.

Banning a user

Banning a user will show the banned error page, instead of showing the 404 error page.

  1. Remove permissions, as shown above.
  2. Add a line in /etc/apache2/conf.d/macros on the webserver in the StandardUserDir macro, following the example given in the comments.

Themes

The website can be themed! Have a new idea to try, or want a few changes in the design? This can all be done in one place under /afs/csl/web/media/themes/. The current theme is selected by changing the current symbolic link, which is why it is necessary to use current in the include paths mentioned above in creating a document. A printer-friendly page, a part of the current theme, is automatically used when printing any portion of the website that uses the TJ theme.

Legacy webdocs

Right now, these sites are housed under /afs/csl/web/webdocs_legacy/. This should change in the future. These directories are left over from the old Novell webserver.

Backup Before the Web Transition

A full backup of /afs/csl/web/ before any transitioning or problems with the webserver is available in /afs/csl/web_old_full/. This volume will most likely be moved at some later date, after everything else is put in place, or even deleted if not needed any longer. The directories have the same AFS ACLs as the originals.