Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


suPerlative: Development and Public Servers

We actually maintain two complete copies of the WDVL. One, of course, is the public version you are reading. The other is our development version. Here is where we work on new articles and changes to existing ones. Every evening, the new/changed files are copied from the development server to the public one.

One of the functions of the ht script is to add the name of each file, including the path within the WDVL, and timestamp to a log file. For files we want to move that are not generated by ht such as images or the home page, we use a script uw to append the file name to the log file. When our mirror script is run, this log file is "rolled over" and used to generate the various files needed to do the mirroring.

A Perl script called make_mirror.pl reads the log and creates an associative array of the files to be mirrored. This eliminates duplicates and also give us the opportunity to remove files not yet ready to be mirrored. The Perl script goes on to create four output files:

  1. Update.ht - a list of the files updated in the mirror. The ht_subs.pl script finds the title of each file so the link uses the page name rather than just the URL. This file is itself run through the ht pre-processor to create the actual HTML file.
  2. mir_tar.sh - a Unix script to create the tar file containing all the files that need to be copied. If there is an .ht version of a file, it will be included in the tar, else the .html version will be.
  3. do_ht.sh - another Unix script to ht all the moved .ht files on the public server.
  4. check.lst - a list of files changed, with their full path name. This file is used to check for broken links.
These files are only created if there are files to be mirrored. For example, if the only files changed during the day were those not yet ready for publication, the four files would not be created and the mirroring shell would stop.

Once the list for files to copy has been created but before the script is run to create the tar file, the vlinks.pl program is run to ensure that there are no broken links in the pages to be mirrored. As defined elsewhere, this Perl program reads the named files and generated an associative array of links, noting the pages the links are called from. Each link is then checked. If anything other than an good page is returned, the broken link is added to the file broken.html as a live link and the calling page or pages noted. If the broken.html file is created, the mirroring script notifies the webmaster that there may be some broken links and ends.

If no broken links are found, or when the webmaster is satisfied that they are good, another Unix script, mirror2.sh is called which actually creates the tar file of new or modified files, copies the tar file to the public server, installs the new files and runs do_ht.sh to re-ht the .ht files.

suPerlative: The Site Map
suPerlative Web Construction !
suPerlative: CGI and Other Scripts


Up to => Home / Software / Perl




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers