Please all comment you can give me.
--jesse
--------------------------------------------------------------------
J. op den Brouw Johanna Westerdijkplein 75
Haagse Hogeschool 2521 EN DEN HAAG
Faculty of Engeneering Netherlands
Electrical Engeneering +31 70 4458936
-------------------- [EMAIL PROTECTED] --------------------
Linux - because reboots are for hardware changes
#
# HOWTO set up a local mirror (copy) of the HTDIG web site
# date: 23 feb 2001
# version: 1.0
# author: J. op den Brouw <[EMAIL PROTECTED]>
# (c) The Htdig Group
#
# Responsibility: None. If you wind up with a broken server, you
# should have learned Un*x on Winblows better.
Abstract
-------
This simple document tells a little story about how to
mirror all or a part of the HTDIG web and ftp sites. There are
four pieces to mirror:
1) The HTDIG web site (main and development)
2) The CVS repository
3) The HTDIG FTP site
4) The HTDIG patch site
We use cvs(1) and mirror(1L). Wget(1) is a very good alternative
for mirror(1L).
Some Notes Before We Begin
--------------------------
There are a *lot* of options for use with cvs(1), which are
not explained here. It's merely a short howto on how to
set up a local mirror of the htdig site.
The development pages are no longer on their own; they are
combined with the main web site.
To fully implement a mirror you'll need to activate server
side includes on your web server. Your system administrator
knows more. See addendum at the end.
If you've mirrored the HTDIG FTP site, you can make these files
visible on your web server by setting an Alias in your web server
configuration file, but you'll need to activate directory indexing.
See addendum at the end.
I assume you have a up-and-running web server like Apache.
I assume you have a up-and-running FTP server line wu-ftpd. Anonymous
FTP access is chroot-ed (change-rooted). Forget it if you don't know
what I'm talking about.
Setting up a copy of the HTDIG website
--------------------------------------
1) You need to have cvs(1) installed on your system.
It will not work without. Check out:
man cvs
If your don't have it on your box, ask the administrator to
install it for you. I use RedHat and there you can install a RPM
package quite easily.
2) You'll need to gain anonymous access at the CVS repository.
cvs -d:pserver:[EMAIL PROTECTED]:/cvsroot/htdig login
When asked for a password, leave it blank (i.e. press the enter key)
You only need to do this once (for the same machine of course).
3) Create a place (directory) where you will place your local copy.
I placed it under my web site in the directory htdig. Note that
the cvs(1) command later on will create another directory under
the just created htdig directory.
cd /home/htdigmirror/www/
mkdir htdig
4) Change to that directory.
cd htdig
5) Check out the htdig module. In newbie-speak: create a local copy of the
htdig web site.
cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/htdig \
co maindocs
Note the backslash!!! It's just there to glue the two lines above.
You will see some output on your terminal.
The cvs(1) command has created a sub directory named maindocs.
6) Start your favorite browser and surf to the web page. Something like
http://www.htdigmirror.com/htdig/maindocs
7) Ready.
Updating your local copy of the HTDIG web site
----------------------------------------------
1) You already have cvs(1) otherwise you couldn't have created the initial
copy in the first place.
2) You already have anonymous CVS access.
3) Change to the directory that holds the copy of the htdig web site
cd /home/htdigmirror/www/htdig/maindocs
Note that you have to cd(1) to the directory created by cvs(1)!
4) Start the update
cvs -q update -Pd
You will see rows with updated files. If there's nothing to update, you
will see a new prompt only; there is no output.
5) You can run this at night via cron(8). Example of crontab(1) entry
40 2 * * * cd /home/htdigmirror/www/htdig/maindocs && /usr/bin/cvs -q update -Pd
Make sure that cron(1) knows its $PATH.....
Geoff also notes that if you do not want any output, you should use
40 2 * * * (cd /home/htdigmirror/www/htdig/maindocs && /usr/bin/cvs -q update \
-Pd) >/dev/null 2>&1
Note: above two lines should read as one without the backslash.
Setting up a Copy of the CVS Repository
---------------------------------------
Because you all know the procedure now, I'll just give the commands.
cd /home/htdigmirror/www/htdig
cvs -z3 -d:pserver:[EMAIL PROTECTED]:/cvsroot/htdig co htdig
You'll get a subdirectory named htdig containing the CVS tree. You'll need to
adapt your web server configuration file so that it will show directory indexes.
See addendum.
Mirroring the HTDIG FTP site with mirror(1L)
--------------------------------------------
1) Make sure you have installed mirror(1L)
2) Make sure you've created a package file. You can also
add the lines to the mirror.defaults file as I did.
It contains the FTP site to connect to, the path to
the HTDIG directory etc. See addendum.
3) Mirror the site.
/usr/bin/mirror -d -p htdigmirror
4) Check if things are working with the FTP command.
ftp www.htdigmirror.com
Login as anonymous and send as password your e-mail address.
Change to the right directory:
cd /pub/ftp.htdig.org/pub/htdig
4) Ready
Mirroring the HTDIG Patch FTP site with mirror(1L)
--------------------------------------------------
See Mirroring the FTP site. It's just another mirror(1L)
session with other parameters. See addendum.
E-mail addresses
----------------
The HTDIG site is maintained by Geoff Hutchison <[EMAIL PROTECTED]>
The HTDIG Patch site is maintained by Joe R. Jah <[EMAIL PROTECTED]>
Addendum
--------
Apache 1.3.x configuration file (part) for HTDIG mirror sites.
For use with virtual hosts:
# Host www.htdigmirror.com
<VirtualHost 1.2.3.4>
ServerAdmin [EMAIL PROTECTED]
ServerName www.htdigmirror.com
DocumentRoot /home/htdigmirror/www
ErrorLog /home/htdigmirror/etc/error_log
TransferLog /home/htdigmirror/etc/access_log
Alias /htdig/maindocs/files "/home/ftp/pub/ftp.htdig.org/pub/htdig"
<Directory /home/ftp/pub/ftp.htdig.org/pub/htdig>
Options Indexes
</Directory>
<Directory /home/htdigmirror/www/htdig/maindocs>
Options Includes
</Directory>
<Directory /home/htdigmirror/www/htdig/htdig>
Options Indexes
</Directory>
</VirtualHost>
Mirror package file for mirroring the htdig FTP site. For use with mirror(1L).
This is a part of it. Set your defaults in the default package. There are a
*lot* of options for mirror(1L). See the man page.
package=htdigmirror
hostname=www.htdigmirror.com
site=ftp.htdig.org
# Keep all relative to here
local_dir=/home/ftp/pub/ftp.htdig.org/pub/htdig
# The local_dir must exist FIRST
local_dir_check=true
remote_user=anonymous
[EMAIL PROTECTED]
remote_dir=/pub/htdig
# Don't mirror file modes. Set all dirs/files to these
dir_mode=0755
file_mode=0444
# By defaults files are owned by root.zero
user=ftp
group=ftp
package=htdigpatches
hostname=www.htdigmirror.com
site=ftp.ccsf.org
# Keep all local_dirs relative to here
local_dir=/home/ftp/pub/ftp.ccsf.org/htdig-patches
# The local_dir must exist FIRST
local_dir_check=true
remote_user=anonymous
[EMAIL PROTECTED]
remote_dir=/htdig-patches
# Don't mirror file modes. Set all dirs/files to these
dir_mode=0755
file_mode=0444
# By defaults files are owned by root.zero
user=ftp
group=ftp