You are here

INSTALL.txt in Stage File Proxy 7

Same filename and directory in other branches
  1. 6 INSTALL.txt
STEPS TO INSTALL:
=========
1.  Enable the module.
    $ drush pm-download stage_file_proxy
    $ drush pm-enable --yes stage_file_proxy

2a. Set variables with drush:
    $ drush variable-set stage_file_proxy_origin "http://www.example.com"
    OR
2b. Add variables to $conf in settings.php:

REQUIRED:
=========

The origin website.

$conf['stage_file_proxy_origin'] = 'http://example.com'; // no trailing slash

If the site is using HTTP Basic Authentication (the browser popup for username
and password) you can embed those in the url. Be sure to URL encode any
special characters:

For example, setting a user name of "myusername" and password as, "letme&in" the
configuration would be the following:

$conf['stage_file_proxy_origin'] = 'http://myusername:letme%26in@example.com';

OPTIONAL
========
$conf['stage_file_proxy_use_imagecache_root'] = TRUE;

Default is TRUE.

If this is true (default) then Stage File Proxy will look for /imagecache/ in
the URL and determine the original file and request that rather than the
processed file, then send a header to the browser to refresh the image and let
imagecache handle it. This will speed up future imagecache requests for the
same original file.

$conf['stage_file_proxy_hotlink'] = FALSE;

Default is FALSE.

If this is true then Stage File Proxy will not transfer the remote file to the
local machine, it will just serve a 301 to the remote file and let the origin
webserver handle it.

$conf['stage_file_proxy_origin_dir'] = 'sites/default/files';

Default is 'sites/default/files';

If this is set then Stage File Proxy will use a different path for the remote
files. This is useful for multisite installations where the sites directory
contains different names for each url. If this is not set, it defaults to the
same path as the local site (sites/default/files).

$conf['stage_file_proxy_sslversion'] = 3;

Default is 3.

CURL will try to figure out which ssl version to use, but if it fails to do that
properly it can lead to getting an empty file and a 0 status code. The default
is 3 which seems relatively common, but if you get 0 byte files you can try
changing it to 2.

DRUSH USERS
===========

To automatically enable stage_file_proxy on your dev machine after sql-sync,
add the following to your dev site alias file:

  $aliases['dev'] = array (
    'root' => '/path/to/drupalroot',
    'uri' => 'http://example.org',
    'target-command-specific' => array(
      'sql-sync' => array(
        'enable' => array('stage_file_proxy'),
      ),
    ),
  );

In order for this to work, you must copy the file
drush/examples/sync_enable.drush.inc to your ~/.drush folder.
For more information, see:

http://drupalcode.org/project/drush.git/blob/HEAD:/examples/sync_enable.drush.inc

File

INSTALL.txt
View source
  1. STEPS TO INSTALL:
  2. =========
  3. 1. Enable the module.
  4. $ drush pm-download stage_file_proxy
  5. $ drush pm-enable --yes stage_file_proxy
  6. 2a. Set variables with drush:
  7. $ drush variable-set stage_file_proxy_origin "http://www.example.com"
  8. OR
  9. 2b. Add variables to $conf in settings.php:
  10. REQUIRED:
  11. =========
  12. The origin website.
  13. $conf['stage_file_proxy_origin'] = 'http://example.com'; // no trailing slash
  14. If the site is using HTTP Basic Authentication (the browser popup for username
  15. and password) you can embed those in the url. Be sure to URL encode any
  16. special characters:
  17. For example, setting a user name of "myusername" and password as, "letme&in" the
  18. configuration would be the following:
  19. $conf['stage_file_proxy_origin'] = 'http://myusername:letme%26in@example.com';
  20. OPTIONAL
  21. ========
  22. $conf['stage_file_proxy_use_imagecache_root'] = TRUE;
  23. Default is TRUE.
  24. If this is true (default) then Stage File Proxy will look for /imagecache/ in
  25. the URL and determine the original file and request that rather than the
  26. processed file, then send a header to the browser to refresh the image and let
  27. imagecache handle it. This will speed up future imagecache requests for the
  28. same original file.
  29. $conf['stage_file_proxy_hotlink'] = FALSE;
  30. Default is FALSE.
  31. If this is true then Stage File Proxy will not transfer the remote file to the
  32. local machine, it will just serve a 301 to the remote file and let the origin
  33. webserver handle it.
  34. $conf['stage_file_proxy_origin_dir'] = 'sites/default/files';
  35. Default is 'sites/default/files';
  36. If this is set then Stage File Proxy will use a different path for the remote
  37. files. This is useful for multisite installations where the sites directory
  38. contains different names for each url. If this is not set, it defaults to the
  39. same path as the local site (sites/default/files).
  40. $conf['stage_file_proxy_sslversion'] = 3;
  41. Default is 3.
  42. CURL will try to figure out which ssl version to use, but if it fails to do that
  43. properly it can lead to getting an empty file and a 0 status code. The default
  44. is 3 which seems relatively common, but if you get 0 byte files you can try
  45. changing it to 2.
  46. DRUSH USERS
  47. ===========
  48. To automatically enable stage_file_proxy on your dev machine after sql-sync,
  49. add the following to your dev site alias file:
  50. $aliases['dev'] = array (
  51. 'root' => '/path/to/drupalroot',
  52. 'uri' => 'http://example.org',
  53. 'target-command-specific' => array(
  54. 'sql-sync' => array(
  55. 'enable' => array('stage_file_proxy'),
  56. ),
  57. ),
  58. );
  59. In order for this to work, you must copy the file
  60. drush/examples/sync_enable.drush.inc to your ~/.drush folder.
  61. For more information, see:
  62. http://drupalcode.org/project/drush.git/blob/HEAD:/examples/sync_enable.drush.inc