30.07.2012 Views

Reference Guide

Reference Guide

Reference Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Working with Zend Download Server<br />

This component is not relevant for Windows and IBM i Servers.<br />

Zend Server <strong>Reference</strong> Manual<br />

The Zend Download Server (ZDS) can be used to increase your Apache Web server's capacity by<br />

automatically taking over static downloads. This releases Apache processes to handle more dynamic<br />

requests.<br />

Files can be sent through the ZDS in two ways:<br />

1. Automatically - By configuring Apache to pass specific file types to PHP: For example, images,<br />

PDF files or any other relatively large static files. When the ZDS is loaded and configured, PHP<br />

passes the request to the ZDS, which takes over sending the file to the user.<br />

2. Manually - By calling the Zend Download Server API functions from within your PHP script. This<br />

is useful for situations where you require some code or logic to run before allowing a download,<br />

such as authenticating users before permitting them to download.<br />

Configuring Zend Download Server to Automatically Handle Files<br />

This procedure describes how to configure your environment to handle certain file types with the ZDS.<br />

Although transparent to end users, this action is expected to increase server capacity.<br />

To set up ZDS to automatically handle specific file types:<br />

1. Locate the Apache configuration file that contains the PHP handler configuration by<br />

searching for the line starting with "AddHandler php5-script" (you can do this using grep<br />

or similar tools). This line defines the file extensions that are passed to PHP.<br />

2. Add the extensions of the file types you want ZDS to handle at the end of this line.<br />

3. Make sure that the same file extension is listed in the ZDS MIME type configuration file<br />

located in /etc/zend_mime_types.ini. If not, add it and make sure to define<br />

the correct MIME type for it. The configured MIME type is sent as the value of the<br />

"Content-type" HTTP response header, which (according to the browser's individual<br />

settings) determines the browser's behavior when it receives the file.<br />

4. Save your files and restart the Apache server.<br />

All the defined files types are now handled by the ZDS (as long as this component is set to 'On' in the<br />

Administration Interface).<br />

107

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!