Some websites don't need publications and such and can use the simple Berkeley web template.

1. Get DNS Set up

eecs.berkeley.edu website

If the site is a .eecs.berkeley.edu site, then request a MX and A record by updating the eecs department host database by going to http://iris.eecs.berkeley.edu, then clicking on Forms, then System Update-Registration and in the comments for the request section, enter:
Please add a MX and A record for human-cps.eecs.berkeley.edu:

human-cps.eecs.berkeley.edu. 86400  IN      MX      5 moog.eecs.berkeley.edu.
human-cps.eecs.berkeley.edu. 86400  IN      A       128.32.48.150

Thanks!

berkeley.edu website (not eecs.berkeley.edu)

See Can I have hostname foo.berkeley.edu?

Yes. Hostnames are provided on a first-come-first-served basis. Hostnames are generally assigned as part of a CNS work-order (installation). Requests to change a hostname or add an alias can be sent to hostmaster@nic.berkeley.edu.

So, email hostnamster@nic.berkeley.edu and cc root@moog.eecs.berkeley.edu:
Please add a MX and A record for xxx.berkeley.edu:

xxx.berkeley.edu. 86400  IN      MX      5 moog.eecs.berkeley.edu.
xxx.berkeley.edu. 86400  IN      A       128.32.48.150

Thanks!

.org or .com

See Non-eecs websites.

Basically, on the hostname registrar, set up the A and MX records as above.

2. Wait until the change is made

Typically, you will need to wait until the change is propagated to the DNS server. To test, run dig:
[root@moog human-cpswww]# dig any human-cps.eecs.berkeley.edu

; <<>> DiG 9.8.2rc1-RedHat-9.8.2-0.17.rc1.el6_4.6 <<>> any human-cps.eecs.berkeley.edu
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 15321
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 2, AUTHORITY: 5, ADDITIONAL: 7

;; QUESTION SECTION:
;human-cps.eecs.berkeley.edu.   IN      ANY

;; ANSWER SECTION:
human-cps.eecs.berkeley.edu. 86400 IN   MX      5 moog.eecs.berkeley.edu.
human-cps.eecs.berkeley.edu. 86400 IN   A       128.32.48.150

;; AUTHORITY SECTION:
eecs.berkeley.edu.      86400   IN      NS      ns.CS.berkeley.edu.
eecs.berkeley.edu.      86400   IN      NS      adns2.berkeley.edu.
eecs.berkeley.edu.      86400   IN      NS      adns1.berkeley.edu.
eecs.berkeley.edu.      86400   IN      NS      ns.eecs.berkeley.edu.
eecs.berkeley.edu.      86400   IN      NS      cgl.UCSF.edu.

;; ADDITIONAL SECTION:
moog.eecs.berkeley.edu. 86400   IN      A       128.32.48.150
ns.CS.berkeley.edu.     86400   IN      A       169.229.60.61
ns.eecs.berkeley.edu.   86400   IN      A       169.229.60.153
adns1.berkeley.edu.     7750    IN      A       128.32.136.3
adns1.berkeley.edu.     2313    IN      AAAA    2607:f140:ffff:fffe::3
adns2.berkeley.edu.     9554    IN      A       128.32.136.14
adns2.berkeley.edu.     2313    IN      AAAA    2607:f140:ffff:fffe::e

;; Query time: 1 msec
;; SERVER: 128.32.48.21#53(128.32.48.21)
;; WHEN: Fri Dec  6 07:54:59 2013
;; MSG SIZE  rcvd: 318

[root@moog human-cpswww]# 
If the address has not been propagated, then the A and MX records will not be present.

3. Update the Apache configuration

After DNS has been updated, log on to moog and become root.

It is easiest to search the Apache configuration in /usr/local/apache/conf and /usr/local/apache/conf/extra and make similar edits.

  1. Edit /usr/local/apache/conf/httpd.conf and add
    <Directory "/home/www/human-cpswww">
        Options +Includes +Indexes +FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
    
    The above is necessary for Server Side Includes (SSI) to work. If it is not present, then the web page will not get the decorations, it will just be text
  2. Edit /usr/local/apache/conf/extra/httpd-vhosts.conf. This file has alphabetical sections for the different websites. Here, search for a previous website like cps-forces, copy the text and paste it in. The only change is to change
        ServerName cps-forces.eecs.berkeley.edu
        DocumentRoot /home/www/cps-forceswww
    
    to
        ServerName human-cps.eecs.berkeley.edu
        DocumentRoot /home/www/human-cpswww
    
    and
     TransferLog "|/usr/local/sbin/cronolog -l /usr/local/apache/logs/access_log_cps-forces /usr/local/apache/logs/%Y/%m/%d/access_log_cps-forces"
    
    to
     TransferLog "|/usr/local/sbin/cronolog -l /usr/local/apache/logs/access_log_human-cps /usr/local/apache/logs/%Y/%m/%d/access_log_human-cps"
    

4. Create the files for the website

You can either copy the files from another website or get them from http://www.berkeley.edu/webstyle/.

To copy the files, as root do:

cd /usr/www
mkdir human-cpswww
chown cvs human-cpswww
chgrp cvs human-cpswww
chmod g+ws human-cpswww
cd human-cpswww
(cd ../cps-forceswww; tar -cf - .) | tar -xpf -

5. Tell the server about the change to the configuration
/etc/init.d/apachectl graceful

6. Visit the site

Go to http://human-cps.eecs.berkeley.edu

7. Problems

7.1 The website does not have decorations

We use Server Side Includes. The html files must be executable for this to work. Use
chmod a+x *.htm *.html

See http://chess.eecs.berkeley.edu/ptolemy/wiki/Ptolemy/PtolemyWebsite for other hints

8. Add the website to the svn repository

We now use svn on http://repo.eecs.berkeley.edu.
  1. There are various "spaces" for the different centers (chess, trust etc.) Determine which space the repository should go into, then go to http://repo.eecs.berkeley.edu log in and select that space. If you do not have access to that space, ask Christopher
  2. Create a new svn repository for the website: Under Repositories, click add, then enter the name of the repo and select SVN, then click OK.
  3. Add the spaces-wide group so that it has read-write access. Each space has a group with the same name. For example, the trust space has a trust group.
    1. Click on permissions,
    2. then on the right column, select the spaces group (for example, trust),
    3. then select Read-Write,
    4. then click the box at the top to select all the repositories,
    5. then click on the assign button.

9. Check in the temporary files

Become the vc user check out the repo, copy the files in and commit them.

Note that as this repository is in the trust space, we use vc@truststc.org

If you are prompted for the password, use the secondary password (begins with a k).

If you are prompted to save the password unencrypted, then select yes.

su - vc
cd /tmp
svn --username vc@truststc.org co https://repo.eecs.berkeley.edu/svn/projects/trust/human-cpswww/
cd human-cpswww
(cd ~www/human-cpswww/; tar -cf - .) | tar -xpf -
svn add *
svn commit -m "Initial checkin"

10. Replace the temporary directory with the repo

As root, we move the temporary directory out of the way and then move in the directory created above.
cd ~www
mv human-cpswww /tmp/human-cpswww.bak
mv /tmp/human-cpswww .

To update the site, we will modify a php file and add a link so that if a user clicks on the link, then the update occurs. Before doing that work, it is a good idea to test the command. As root:

cd ~www/human-cpswww
~www/bin/vc-svn --username vc@truststc.org update

Replace truststc.org with the name of the main website.

If you are prompted for the password, use the secondary password (begins with a k).

Then, fix the permissions:
chown -R vc.vc human-cpswww
chmod -R g+wX human-cpswww

If the permissions are not fixed, attempting to update the website will fail, see svn: Can't open file '.svn/lock': Permission denied.

11. Edit the php to create the link to update the site

The way this works is that we create a special link that checks to see if the user is admin in a particular group and if they are, then invokes svn to update to the site.

For trust sites (hi-cons etc), edit ~www/php/trust.eecs.berkeley.edu/group.php

For cps-forces sites (cybear, gie, success) and robotics.eecs sites (isaacs, aucgoc, edit ~www/php/ucb/group.php

  1. Look for code like:
        /* Perform pre-processing according to the authoring style 
         */
        switch ($groupinfo['authoring']) {
        case "cvs":
        case "svn":
        case "vc":
            // Do a CVS update if requested                                                                
          if ($Action == "cvsupdate"  || $Action == "svnupdate" || $Action == "vcupdate" || $Action == "vcupdate-augcogwww" || $Action == "vcupdate-cacwww" || $Action == "vcupdate-cybear" || $Action == "vcupdate-gie" || $Action == "vcupdate-success" || $Action == "vcupdate-isaacswww")  {
    
    Add the website to be updated to the if statement and below:
                if ($Action == "cvsupdate" || $Action == "svnupdate" || $Action == "vcupdate") {
                    $pageinfo['script'] = "svn_update('$group');";
                } else if ($Action == "vcupdate-augcogwww" && $group == 'roboadmin' && user_ok($group, "admin")) {
                    $pageinfo['script'] = "svn_update('augcogwww');";
                } else if ($Action == "vcupdate-cacwww" && $group == 'roboadmin' && user_ok($group, "admin")) {
         		$pageinfo['script'] = "svn_update('cacwww');";
                } else if ($Action == "vcupdate-cybear" && $group == 'forcesadmin' && user_ok($group, "admin")) {
                    $pageinfo['script'] = "svn_update('cybear');";
                } else if ($Action == "vcupdate-gie" && $group == 'forcesadmin' && user_ok($group, "admin")) {
                    $pageinfo['script'] = "svn_update('gie');";
                } else if ($Action == "vcupdate-success" && $group == 'forcesadmin' && user_ok($group, "admin")) {
                    $pageinfo['script'] = "svn_update('success');";
                } else if ($Action == "vcupdate-isaacswww" && $group == 'isaacs' && user_ok($group, "admin")) {
                    $pageinfo['script'] = "svn_update('isaacswww');";
                }
    
    Add your Action, group and svn_update lines above.
  2. Edit ~www/php/include/svn.inc.php and add the repository.

14. Try the URL!

Try the url and see what happens!

Problems

svn: Can't open file '.svn/lock': Permission denied

If clicking on the link results in:
Go back

Working Directory: /home/www/augcogwww
Command:

/home/www/bin/vc-svn update --username vc@robotics.eecs.berkeley.edu --config-dir /home/vc/.subversion-robotics 2>&1 

Updating module augcogwww:
     svn: Can't open file '.svn/lock': Permission denied
Done!
Go back

Then be sure that the permissions are updated.