You are here: Front pagePMC documentationDownload page (mirror script) migration steps

Download as PDF

Download page (mirror script) migration steps

This document outlines the simple changes needed to migrate from the old download mirror system to the new one:

Using www.apache.org/dyn/closer.cgi in your download .cgi script?

Change this to www.apache.org/dyn/closer.lua!

Using a .cgi with an accompanying .html file with the same name?

Great, you probably don't need to do anything! But check that the script works OK to make sure.

Note: the system relies on finding the .html file in the same directory as the .cgi file. If your site uses redirects, that may break the linkage. See below for details as these may affect how the page is displayed.

Using .htaccess files that redirect or refer to a .cgi file?

You may need to make changes, as all .cgi files are now being internally rewritten. The redirect of the .cgi file occurs before the .htaccess file is processed so the mirror system won't see any redirects applied by your .htaccess file to the .cgi file.

You can fix this by updating the links to .cgi files to point to the same parent directory as the redirected .html file. The .cgi file does not actually have to be present at the target location.

However fixing ASF website pages won't fix existing links which may appear on 3rd party sites. The only way to fix these is to ensure that the HTML file is accessible at the same (un-redirected) URL as the CGI file.

If the HTML redirect is to another directory in the same site, then a simple file link should suffice.

Alternatively an HTML file may be created in the original location; this should have a meta-redirect to the redirected location of the CGI file (not the HTML file). The meta-redirect will be processed and the CGI reference will again be intercepted; this time it is in the correct location.

For example, commons.apache.org/lang/ currently redirects to commons/proper/commons-lang/ This means that references to /lang/download_lang.cgi no longer work properly.
Solution 1:
Create a link from ../proper/commons-lang/download_lang.html to lang/download_lang.html
Solution 2:
Create the file lang/download_lang.html with the content

<html>
<head>
<meta http-equiv="refresh" content="0; url=/proper/commons-lang/download_lang.cgi" />
</head>
</html>

If the .htaccess redirects are changed later, any such fixes may have to be changed.

You may want to adopt either closer.lua or simply have an EZT template (see this Tomcat example or source of Tomcat example ) called download.html and then point to download.cgi to have our new system use your template via internal rewrites.

Using a custom CGI file for your downloads?

Please have a static EZT template (see example above) only, call it download.html (or equivalent) and refer to it as download.cgi to have our mirror system pick up the template and use it. You can also call it download-foo.html and refer to it as download-foo.cgi to have it rendered via our mirror system.

Using SSI (Server-Side Includes) in your current download page?

This won't work anymore, please use a static html template (see above)

Still having trouble?

Contact us at infrastructure@apache.org or visit us on HipChat !