Creating a new website

Here's what needs to be done to add a website that uses the common features that the CHESS, E3S, Embed sites use (workgroups, calendars, FAQs, etc.)

This description uses cps-forces.eecs.berkeley.edu as an example. Be careful to substitute the appropriate text where necessary.


Registering a hostname

Even if the website has a .org toplevel domain, it is easiest if there is also a hostname in the EECS domain that matches.

In September, 2012, Mark Kraitchman wrote:

With Apache httpd and free SSL multi-domain certs from InCommon, most folks find they no longer need to use DNS names with seperate A records / seperate IP addresses. Instead with multi-domain SSL certs, dns nicknames can be used. Using dns nicknames and multi-domain SSL certs also simplifies requesting holes in the IRIS border firewall for https and http.

icyphy and terraswarm both appear to be available IRIS device names.

An "Update a Device" form for andrews can be submitted requesting the dns nicknames. Will that work for you?

Request that an A record to 128.32.48.150 and an MX to moog.eecs.berkeley.edu be setup for the new host.

Create new mailman installation for the new site. (See the FAQ Adding a Mailman installation when adding a new website.)

Send mail to hostmaster@eecs requesting these DNS changes:

Add the following to /etc/mail/local-host-names:

    cps-forces
    cps-forces.eecs
    cps-forces.eecs.berkeley.edu
  
If the new website has a .org toplevel domain, add an entry to local-host-names.

If sendmail has been recently updated, you can recreate the configuration, otherwise just edit /etc/mail/sendmail.cf, look for the other domains and add similar lines.

Recreating the configuration from recent sources
cd to /usr/cluster/etc/mail. Edit sendmail-gigascale.mc, adding the following line:
    MASQUERADE_EXCEPTION(`cps-forces.eecs.berkeley.edu')dnl
  
after any other MASQUERADE_EXCEPTION lines.

Build the new sendmail.cf file by simply running the command

    make
  

As root, restart sendmail:

    $ pkill -HUP sendmail
  

Log on to http://repo.eecs.berkeley.edu and create a new non-personal space for the new site. The name would be cps-forces

On http://repo.eecs.berkeley.edu

  1. Select the new non-personal space and create a *www SVN Repo (cps-forceswww).
  2. Add a vc@cps-forces.org user with the password the same as the www password.
  3. Create a new group with the same name as the website (cps-forces) (The group name does not matter much)
  4. Set up the group so that it has read/write to the repo.
  5. Add the vc@ user to the new group
  6. Add yourself and any admins to the new group

Create new databases (as mere mortal):

Make the following changes to /usr/local/apache/conf/extras/httpd-vhosts.conf, depending on whether the server you are working on is using IP-based virtual hosts or not. (moog does, markov doesn't):

Add the following line to /usr/local/apache/conf/rewrite.conf:

    Alias /cps-forceswww/ "/home/www/cps-forceswww"
  
near the similar Alias line for /gsrcwww/.

Make the following changes to /usr/local/tomcat/conf/server.xml:

Temporarily create the new webapp directory:

Update apache's copy of mod_jk.conf:

Set up DOCUMENT_ROOT:
Note that when you check out the top pages, use :ext:www@source.eecs.berkeley.edu:/home/cvs_shortname where shortname is cps-forces
The reason to use www@source.eecs.berkeley.edu is so that if you set up a CVS update button on the main page (like chess and cps-forces), then the CVS update will work properly.

    root% bash
    root% cd /home/www
    root% svn co --username vc@cps-forces.org https://repo.eecs.berkeley.edu/svn/projects/cps-forces/cps-forceswww
    root% cd cps-forceswww
    root% (cd ../gsrcwww; tar cf - images *.js *.css) | tar xvpf -
  
Then rename files as necessary and add them to the svn repository.

Set up wwwdata:

    root% cd /home/www/wwwdata
    root% mkdir cps-forces.eecs.berkeley.edu
    root% chown apache.webmastr cps-forces.eecs.berkeley.edu
Set up cvswww:
root% cd /home/www/cvswww
root% mkdir cps-forces.eecs.berkeley.edu
root% chown cvs cps-forces.eecs.berkeley.edu

As www, make a copy of icyphy's PHP code, which will result in a website that looks just like icyphy's. Part of the idea is that the new websites share code in ~www/php/ucb. (Subsequent changes to this prototype starting point are up to you.) Here, we use cps-forces instead of cps-forces.

www% cd /home/www/php
www% cp -rp icyphy cps-forces
www% ln -s cps-forces www.cps-forces.org
www% cd cps-forces
Remove all CVS directories in the new site tree:
www% find /home/www/php/cps-forces -name .svn -exec /bin/rm -r {} ;
Descend through the new directory tree, adding everything to svn.
www% su - www
www% cd ~www/php
www% svn add cps-forces
www% svn commit -m "Added cps-forces"

Search for "gsrc", "gigascale" in all PHP files under /home/www/php/cps-forces, and change it.

Edit /home/www/php/cps-forces/config.php3. If this is a "named virtual host" (i.e., this is markov), the value assigned to the sslPortExtension parameter in this file must match the new HTTPS port number used in /usr/local/apache/conf/httpd.conf.

Create the new site under the javapages CVS tree.

In some convenient directory, check out the javapages tree:
% svn co --username vc@terraswarm.org https://repo.eecs.berkeley.edu/svn/projects/gsrc/javapages/trunk/javapages
% cd javapages
Edit makefile, adding "cps-forces" to the DIRS macro.
% mkdir cps-forces
% cd cps-forces
% (cd ../icyphy; tar cf - *) | tar xvpf -
% find . -name .svn-exec /bin/rm -rf {} ;
Customize the files just copied into this new cps-forces directory, for the new site. (This is the development process for the new site, and may take days or weeks. You might chose to do the next steps first.)

  1. Add the new directory to svn:
    svn add cps-forces
    svn commit -m "new website: cps-forces" cps-forces
    
  2. Edit javapages/makefile and add your new directory to DIRS
  3. Search the javapages for icyphy and make changes. In particular, edit javapages/cps-forces/gsrc/conf/site.properties
Now it's a matter of making all the desired changes, both to the Java code and to the PHP code under /home/www/php/cps-forces.eecs.berkeley.edu. When it's releasable, you'll tag the javapages module with a new tag and install it, per infrax faq, "Installing a new release of the website Java software".