EECS Instructional Support Group, Department of Electrical Engineering & Computer Science
[ ISG home page ] [ who we are ] [ send us email ] [ search ] [ FAQ ]

How to Set up a Home Page
on the EECS Instructional Computers

Home pages for individual students are not listed on the EECS Instructional WWW server, but students can contact the CSUA and ask to be added to their list.

Topics:
  • What is a "home page"?
  • How to Set up a Class Home Page; WEB services (for instructors)
  • How to Set up a Personal Home Page (for students)
  • HTML Code Sample: a Simple Homepage
  • How to "Publish" using an HTML Editor
  • Debugging Tips;   Server Access and Error Logs
  • Updating your .htaccess files
  • Features:   SSI, CGI, PHP, GD, sym links, redirect
  • Restricting Access to your WEB Site
  • Usage Policies for Information Servers
  • General References about WWW utilities
  • Apache HTTP Server Project Home Page
  • Apache Manual for this WWW Server


  • What is a "home page"?

    A "home page" is a text document that may also contain references ("links") to other home pages and to text and graphics documents. It is generally a single page or the top level of a hierarchy of pages on a specific subject (such as you). The source text file for it may be browsed by selecting the "View Document Source..." option of your
    Web browser. The special features of a WWW home page are defined by simple HTML commands that are typed into the source text file.


    How to Set up a Class Home Page (for instructors)

    There are several WEB services for courses.   Our recommendation to EECS instructors is:

    1. create a course site on the EECS Inst server
    2. use the EECS Inst site for posting public content
    3. use the EECS Inst site for dynamic content (CGIs)

    In addition, if you wish to communicate on-line with the students and post password-protected content:

    1. create a course site one of the campus course management systems: bSpace or bCourses
    2. advise students to login there and join your course site
    3. use the Discussion, Chat and Email tools there for communicating with students (see bSpace presentation)
    4. use the bSpace Resources tool for posting private content
    5. use the bSpace Web Content tool to add a window to your EECS Inst site

    For a summary of the course WEB services at UCB, see WEB services for courses below.

    The EECS Instructional WEB server:


    WEB services for courses:

    There are several UCB WEB servers that EECS instructors can use to post course materials.   Here is a summary.

    These are related WEB services that have been retired:


    How to Set up a Personal Home Page (for students)

    A home page can be stored in a student's home directory on the Instructional UNIX computers and it will be accessible through the Instructional WEB server. (inst.eecs.berkeley.edu).

    You can't login directly to the Instructional WEB server, so you should login to an Instructional UNIX login server such as cory.eecs.berkeley.edu or to a UNIX workstation in one of our labs. Then these commands

    mkdir ~/public_html echo '<HTML>My home page.</HTML>' > ~/public_html/index.html chmod 755 ~/public_html ~/public_html/index.html will create a simple home page that appears when you go to the URL
    	http://inst.eecs.berkeley.edu/~your-username
    
    (replace your-username with your own user name, of course).

    See below for a more complete sample home page (formatted with HTML commands) that you could save as "index.html". The student's home directory, the "public_html" directory and the "index.html" file must all be world readable.

    For example, for the user "jdoe" who has an Instructional account, this is how the directory and file permissions might look:

      % cd ~jdoe/public_html
      % ls -al
      drwx--x--x  2 jdoe   512 Feb  2 10:38 ./
      drwxr-x--x 42 jdoe  2560 Feb  2 10:37 ../
      -rwxr-x--x  1 jdoe  2221 Feb  2 10:37 index.html
    

    You can set the permsssions that way with these UNIX commands:

      % chmod 711 ~jdoe 
      % chmod 711 ~jdoe/public_html
      % chmod 755 ~jdoe/public_html/index.html
    

    You can set the permsssions for all files and directories under the "jdoe" public_html directory with these UNIX commands:

      % find ~jdoe/public_html -type d -exec chmod 711 {} \;
      % find ~jdoe/public_html -type f -exec chmod 755 {} \;
    
    This will allow everyone in the world to read those files, including people who are using a WEB browser and who are logged into any Instructional computer. For ways to add security, see Restricting Access to your WEB Site below.

    The URL to access the home page would be:

      http://inst.EECS.Berkeley.EDU/~jdoe
    
    That URL can be used from any WWW client, such as Firefox, Internet Explorer and Lynx. Note that the EECS Instructional home page will not include references to individual student home pages, but students can request that service from the CSUA.

    If you want users to be able to list a directory:

      - run "chmod 755 directory-name" to set the read bit
      - do not put an "index.html" file in the directory
    
    Note that the "1"s in "711" set the execute ("x") bit on the directories but not the read ("r") bit. The "x" bit on a directory does not allow a listing, but it does allow access to a specific file within the directory. By default, the WEB server looks for an "index.html" file and can read that under "711", but it can't list the directory if there is no "index.html" file.

    HTML Code Sample: index.html for a Class WEB Page

    This is a simple WEB page that can be edited with text editor such as "vi" or "emacs". This file redirects to the current WEB page for the class.

    <HTML> <HEAD> <META HTTP-EQUIV="X-instructional-class-redirect" CONTENT="CS123"> <TITLE>CS123 Home Page</TITLE> <META HTTP-EQUIV="Refresh" CONTENT="0;URL=./sp05"> </HEAD> <HTML> <BODY> <CENTER> <A HREF="http://www.berkeley.edu/">University of California at Berkeley</A> <BR> <A HREF="http://www.eecs.berkeley.edu/">Dept of Electrical Engineering &amp; Computer Sciences</A> <BR> <H1>CS123<BR></H1> </CENTER> <P> This page should jump to the current WEB page for this course. &nbsp; If not, please visit <a href="./archives.html">the WEB site archive list<a/>. <P> For information regarding this course: <A HREF="http://schedule.berkeley.edu/">Course Catalog and Schedule of Classes</A> </P> </BODY> </HTML>
    Set the file permsssions with these UNIX commands:

      % chmod 711 ~/				# your top level home directory
      % chmod 711 ~/public_html
      % chmod 755 ~/public_html/index.html
    

    The timer before jumping is set by the "0" in this line:

    <meta http-equiv="Refresh" content="0;URL=./sp05"> If you set it to 0, the jump is immediate.


    HTML Code Sample: archives.html for a Class WEB Page

    This file is maintained automatically by a script. It has a list of previous class WEB sites for the class.

    <HTML> <HEAD> <META HTTP-EQUIV="X-instructional-class-archives" CONTENT="CS123"> <TITLE>CS123 Home Page</TITLE> </HEAD> <BODY> <CENTER> <A HREF="http://www.berkeley.edu/">University of California at Berkeley</A> <BR> <A HREF="http://www.eecs.berkeley.edu/">Dept of Electrical Engineering &amp; Computer Sciences</A> <BR> <H1>CS123<BR></H1> </CENTER> <P> <P> Prior semester archives: <!-- A SCRIPT WILL INSERT NEW ENTRIES HERE --> [<A HREF="sp05/">Spring 2005</A>] <P> For information regarding this course: <A HREF="http://schedule.berkeley.edu/">Course Catalog and Schedule of Classes</A> </P> </BODY> </HTML>
    Set the file permsssions with this UNIX command:

      % chmod 755 ~/public_html/archives.html
    


    HTML Code Sample: a Simple Homepage

    You can create a simple homepage by using a UNIX text editor (such as "vi" or "emacs") to enter this HTML code and save it to a file called "index.html" in the "public_html" subdirectory of your home directory:
    <HTML> <HEAD> <TITLE>My Home Page</TITLE> <CENTER> <H1>Welcome to <I>My</I> Home Page</H1> </CENTER> </HEAD> <BODY> <P> Here is some text about me. </BODY> </HTML>
    Set the file permsssions with these UNIX commands:
      % chmod 711 ~/				# your top level home directory
      % chmod 711 ~/public_html
      % chmod 755 ~/public_html/index.html
    

    The http://inst.eecs.berkeley.edu WEB server will display that file using the URL http://inst.eecs.berkeley.edu/~yourlogin.

    You can see examples of other people's HTML code by selecting the "Page Source" option that is available in most WEB browsers. Many people use a graphical WEB page editor such as Netscape Composer or Microsoft FrontPage (see Publishing, below), but there is no shame in coding it by hand!


    How to "Publish" using an HTML Editor

    Your WEB site files are under the "public_html" directory in your UNIX home directory. Your file called "public_html/index.html" is your default home page on our WWW server (http://inst.eecs.berkeley.edu).

    There are 3 ways create and update you WEB pages:   edit on UNIX,   edit on Windows and   file transfer


    Debugging Tips

    If you are getting an error message from a WEB page or CGI program that you are displaying via http://inst.eecs.berkeley.edu, you may find clues about the problem by searching for either your login name, the WEB page name or the program name in the Server Access and Error Logs.

    Here are some common error conditions and solutions:

    "Internal Server Error" error

    "Premature end of script headers:" error


    Updating your .htaccess files

    The inst.eecs.berkeley.edu WEB server was updated in January 2011 with a new version of the "modauth" module, which handles access control via .htaccess files. As a result, you may need to update your .htaccess files.

    The new version of Apache (2.2.17) changes some of the directives that are used in .htaccess files that control access to WEB sites. The changes are that the "AuthBasicProvider" line should be added and the "AuthDBMAuthoritative" line should be removed.

    Here is a typical updated .htaccess file:

    	SSLRequireSSL
    	AuthName "An authorized account is required..."
    	AuthType Basic
    	AuthBasicProvider dbm file		
    	AuthDBMType GDBM
    	AuthDBMUserFile  /pool/www/data/master-access
    	AuthDBMGroupFile /pool/www/data/master-access
    	#AuthDBMAuthoritative off			# this line is obsolete
    	AuthUserFile  /home/ff/cs123/public_html/login/SSL/users
    	AuthGroupFile /home/ff/cs123/public_html/login/SSL/groups
    	Require group allow
    

    The *UserFile and *GroupFile lines define what sources will be searched to authenticate the users.

    The "master-access" DBM file contains the users and groups from the Instructional UNIX systems.

    The files "users" and "groups" are files that you can create with login/password matches of your own invention. You can locate these files anywhere under your own public_html directory. Include the full path to them after the AuthUserFile and AuthGroupFile directives.

    The Require line defines which users within those sources will be accepted. In the Require line:

    	"valid" = all UNIX accounts (taken from the dbm password service)
    	"allow" = a group of users that may be listed in the "groups" file
    

    Please see
    http://inst.eecs.berkeley.edu/setup.html#restrict for more information about using .htaccess files.

    If you find an error on one of your WEB pages, please send email to inst@eecs.berkeley.edu with the URL of that page and a description of the content that is incorrect. Thank you.


    Features of this WWW Server

    Home pages:

    Server-side "includes" (SSI):

    PHP:

    GD:

    CGI scripts:

    Symbolic links:

    Redirecting WEB pages:


    Restricting Access to your WEB Site

    You can restrict the access to files in your WEB site:
    1. by computer    (list the authorized computers in .htaccess)
    2. by user    (list the users and passwords in .htpasswd)
    3. by file permission    (use a CGI program to access files that are not world-readable)
    4. by SSL    (use the SSLRequireSSL directive in .htaccess; can also use .htpasswd)
    These methods are described below.

    For more information about adding access control individual subdirectories, please see

    Allow access only to certain computers:

    Allow access only to certain people:

    Limitations of using .htaccess and .htpasswd files:

    Using a CGI script to restrict access by UNIX file permissions:

    Security using SSL:


    Usage Policies for Information Servers

    "Informed Consent" Required for Displaying Student Identities

    Information that you display publically via University computers may not include the names of a student without an "informed consent" from the student. Restricting access to WEB pages, say to the EECs or BERKELEY.EDU domains, is not sufficient: informed consent is still required. This is a requirement by federal law. An example of "informed consent" is:

    Please refer to the Policy Analysts at the Office of the Registrar, 127 Sproul Hall, for further clarification about the requirement for "informed consent".

    Other topics:


    General References about WWW utilities

    These are public documents that have more about the WWW and the HTML language used in writing home pages (these may not always be available):

    Last modified: Monday, August 11, 2014
    inst@eecs.berkeley.edu