This page is part of © FOTW Flags Of The World website
Build your own FOTW copy or mirror
Last modified: 1999-10-22 by skip at vexillum
Keywords: fotw | mirror | web | ftp |
Links: FOTW homepage |
disclaimer and copyright |
write us |
Warning: Before building a local copy or a mirror of FOTW web site, read carefully our copyright rules
Build your local copy of FOTW web siteTo build your own local copy of FOTW web site:
Approximately 60 megabytes of space as of 10/1/99
- On your local hard drive create a directory called fotw. Create three subdirectories under that directory called flags, images, and misc.
- Using an ftp program log into fotw.vexillum.com using the login anonymous and your email address as the password
- Download all the files in the directories flags, images, and misc on the ftp site to the same directories on your hard drive.
- Now you can browse the site on your hard drive by opening the file /fotw/flags/index.html with your browser.
Keep your copy updated
FOTW contents change almost every day. To update your copy you must have the updated files. Updating your local copy once per month is the recommended time interval. Follow these instructions:
- If you know the date of the last time you updated your local copy of FOTW skip to the next step. If you do not know open up each of fotw directories (flags, images, misc) on your local site with your file manager program and find the latest file by sorting in descending order by date/time.
- Using an ftp program log into fotw.vexillum.com using the login anonymous and your email address as the password.
- In each of the directories on the ftp site - sort by date and download those files which have been changed since the last time you updated your site into their respective directories on your local hard disk.
- To automatically update your local copy with the newest files please see the instructions below for creating a mirror site.
Build your FOTW mirror site
Using the following instructions you can automatically build and keep your local copy of FOTW web site updated. Then you may make it available to the Internet community as a FOTW mirror.
Unix, WindowsNT, or Windows95/98.
Perl4 or preferably Perl5 installed.
Ability to use FTP, Perl, and Crontab
60+ Megabytes of space as of 10/1/99 (plus space to grow)
The following instructions are for a Unix server. Some modifications might need to be made for your particular operating system.
If you do not have the ability to run a crontab or programs on your server contact your administrator. If you are able to run perl and programs but are unable to use cron you can still use the automated update program but you will have to use it manually instead of having the server run it at set time intervals.
Flags of the World takes no responsibility at all for any damages caused to your computer or other computers by using these instructions and programs. Do so at your sole risk and responsibility. The following instructions were tested and verified to work on a system using Mirror 2.9, Perl 5, Red Hat Linux 5.1, on an Intel architecture machine. You may need to modify these instructions to get the program to work for your particular OS and hardware.
INSTRUCTIONS PART ONE - MIRROR:
- You need to obtain a copy of mirror for your operating system. You can download mirror 2.9 from our anonymous ftp site at ftp://fotw.vexillum.com/mirror. For full documentation and updated mirror programs as well as other mirror solutions please visit http://src.doc.ic.ac.uk/packages/mirror/.
- Create under a directory such as fotw the directories flags, images, misc, control, and custom.
- Create a directory to place the mirror program in. Uncompress the mirror package into that directory.
- Locate the file "mirror.defaults" which should be in the mirror directory. Open it in your text editor.
- Find the line "package=defaults" and change it to read "package=fotw".
- Find the line "hostname=sunsite.org.uk" and change it to read "hostname=YOURDOMAIN" where YOURDOMAIN is your web site's domain name.
- Find the line "local_dir=/public/" and change it so that it points to the full path of the directory that you created the directories flags, images, custom, control, and misc in. In unix you can type "pwd" at the prompt to tell what the path is where you are in the directory tree. Your entry should look something like "local_dir=/usr/home/YOURDOMAIN/html/fotw/" depending on your server filesystem tree.
- Find the line "email@example.com" and change it so that it reads "remote_password=YOUREMAILADDRESS" where YOUREMAILADDRESS is the email address that you normally use for your site.
- Insert a new line after the "remote_password=YOUREMAILADDRESS" that reads "remote_user=anonymous".
- Insert a new line after the last one that says "remote_dir=\".
- Insert a new line after the last one that says "site=fotw.vexillum.com".
- At the beginning of the following lines place the "#" symbol (similar to other lines in the text) so that they read as follows:
- Please make sure that you made all of the changes as listed above and that the information entered is correct. You are now ready to test the program. Type "perl mirror.pl -n". If all is well you will get normal messages showing what would happen if you ran the program for real (and this will take some time because there are literally thousands of files to transfer). If you get an error again check the modifications you made to the mirror.defaults file. Make sure that everything works correctly under the test mode before running the program "live" on your data.
- WARNING! Please do not run this command unless you are sure the test mode above worked correctly. Now you are ready to actually create your mirror site. Run the mirror program by typing "perl mirror.pl". The site will be transferred and put in the proper locations automatically.
INSTRUCTIONS PART 2 - CUSTOM BANNER AND PAGE
You can put your banner (or the banner of the organization that hosts the site) on all the FOTW pages as follows:
Note - if you are updating your site manually you will need to copy the linea2.gif file into the images directory and the host.html file into the flags directory each time you update or exclude those files when you retrieve files from the ftp site. It is placed in the custom directory and copied by the cron job when using the automatic process so that when the originals are overwritten the custom ones are kept safe in another directory.
- Prepare your banner as a gif file. The preferred size is 468 x 60 pixels.
- Name it linea2.gif
- Put the file in the /custom directory.
- change the contents of host.html file so that it points to your homepage and place it in the custom directory. If you want it to redirect to your home page automatically add the following line in the host.html file:
<meta http-equiv="REFRESH" content="1; URL=http://www.yourdomain.com">
INSTRUCTIONS PART 3 - CONTROL SCRIPT
This file runs the mirror program and then copies the files linea2.gif and host.html files from the custom directory to the live directories.
- Using your text editor create a file called "control.bash" in the control directory.
- Type the following replacing the PATH in the following example to the absolute paths on your server:
cp PATH/custom/linea2.gif PATH/images/linea2.gif
cp PATH/custom/host.html PATH/flags/host.html
NOTE: The syntax for this step can be very different on other OS such as WindowsNT. Please consult your operating system documentation to accomplish the same thing.
INSTRUCTIONS PART 4 - CRONTAB:
- Create a new file called "cron.txt" with your text editor in the control directory.
- On the first line put "0 0 * * * perl PATH TO CONTROL.BASH/control.bash" where the PATH TO CONTROL.BASH is the absolute path to the control.bash script. So the resulting entry should look something like this:
0 0 * * * /usr/home/domainname/html/control/control.bash
- The above line assumes that you want to update the site every day at midnight. The syntax for cron is as follows:
The minute of the hour(0-59)
The hour of the day(0-23)
The day of the month (1-31)
The month (1-12)
The day of the week (Sun=0, Mon=1, ... Sat=6)
Minute - Hour - Day - Month - Day of Week
* stands for no entry
So if you wanted to update your mirror every Sunday at 3:00a.m. you would use the syntax "0 3 * * 0" instead of "0 0 * * *".
- Save the file.
- At the command prompt type "crontab cron.txt".
- Then type "crontab -l". This should list the crontab contents that you just typed.
You have just now successfully set up an automatically updated FOTW mirror site!
You can not
- modify the contents of FOTW pages and images
- put third-party advertisement on FOTW pages (e.g. you cannot put third-party logos and advertisement in linea2.gif file)
- sell the access to FOTW pages and images
Make your mirror an official one
After your mirror site is set up and freely visitable, you may add it to the list of the FOTW official mirror sites:
Send a message to the FOTW Director and your site will be added to the official mirror sites list. Sites that are not at least updated monthly may be deleted from the list without notice.