[bd] Data Storage 1.2.5b

Store data in remote servers.

  1. xfrocks
    Store data in remote servers.

    Features

    All data which is currently stored in external data directory (/data) will be processed by this add-on and pushed to remote server. By default, XenForo saves avatars and attachment thumbnails in here. That means with this add-on, you can serve avatar from Amazon S3! It's much easier to run a cluster of web servers now.
    • Store data with Amazon S3
    • Store data in remote server via FTP
    • Store sitemaps on remote storage

    Installation
    • Upload files and directories inside upload to XenForo's root directory. Select "Merge" for everything if you are asked
    • Import the .xml file using XenForo add-on importer
    • Edit config.php (see below)
    • Upload existing files in external data directory (/data) to your remote server before enabling the add-on.
    • Optional: turn on sitemap support in AdminCP > Options > XML Sitemap Generation > Keep sitemap files in [bd] Data Storage

    Configuration

    Store files in Amazon S3

    PHP:
    $config['bdDataStorage'] = array(
        array(
            
    'type' => 's3',
            
    'key' => '<paste your key here>',
            
    'secret' => '<paste your secret here>',
            
    'bucket' => '<enter bucket name here>',
            
    // 'region' => 'us-east-1',
            // 'url' => '',
            // 'acl' => 'public',
            // 'backup' => '<enter local directory if you want to backup files>',
            // ‘meta’ => array(‘key’ => ‘value’, ‘key2’ => ‘value2’),
        
    ),
    );
    If you use any a different region from US Standard, you have to uncomment region line (remove the slashes) and use one of the values below:

    Code:
    us-west-1 = Northern California
    us-west-2 = Oregon
    eu-west-1 = Ireland
    eu-central-1 = Frankfurt
    ap-southeast-1 = Singapore
    ap-northeast-1 = Tokyo
    ap-southeast-2 = Sydney
    ap-northeast-2 = Seoul
    sa-east-1 = Sao Paulo
    
    If you don't want to use s3.amazonaws.com urls (using your domain or using CDN services), you can enter the root address for url, make sure you uncomment the line.

    If you use CloudFront and want to restrict access to the file (only available via CloudFront), you can change the line acl to "private", make sure you uncomment it first.

    A complete Amazon S3 config.php example:

    PHP:
    $config['bdDataStorage'] = array(
        array(
            
    'type' => 's3',
            
    'key' => 'BROIQ53MQHOLEPAKLQCE',
            
    'secret' => 'p29m83MpQkO9+veIn3i9ENXQpN0ceqn4nr/nPXbq',
            
    'bucket' => 's3.xfrocks.com',
            
    'region' => 'ap-southeast-1',
            
    'url' => 'http://s3.xfrocks.com',
            
    'backup' => 'data',
        ),
    );
    Store files in FTP server

    PHP:
    $config['bdDataStorage'] = array(
        array(
            
    'type' => 'ftp',
            
    'host' => '<enter FTP host here>',
            
    'username' => '<enter your username here>',
            
    'password' => '<enter your password here>',
            
    'path' => '<enter FTP upload path here>',
            
    'url' => '<enter URL to upload path here>',
            
    // 'port' => 21,
            // 'passive' => true,
            // 'backup' => '<enter local directory if you want to backup files>',
        
    ),
    );
    It's important to set path and url correctly.

    If your FTP server use some port other than 21, uncomment the line (remove the slashes) and put the port number there.

    If it is required to connect to your FTP server with passive mode one, uncomment the passive line. If you are unsure, you can test with the line and without it to find a mode that works.

    A complete FTP config.php example:

    PHP:
    $config['bdDataStorage'] = array(
        array(
            
    'type' => 'ftp',
            
    'host' => '192.168.1.2',
            
    'username' => 'xfrocks',
            
    'password' => 'rMtd4vSt',
            
    'path' => '/domains/ftp.xfrocks.com/public_html',
            
    'url' => 'http://ftp.xfrocks.com',
            
    'port' => 12121,
            
    'passive' => true,
            
    'backup' => 'data',
        ),
    );
    config.php

    You can also use these flags in config.php to customize add-on behaviors:

    PHP:
    # Cache life time.
    $config['bdDataStorageCacheTtl'] = 640800;

    # Cache life time for bad file (usually non-existent ones).
    $config['bdDataStorageCacheTtlBadFile'] = 60;

    # Switch to `true` to generate a bdDataStorage_StreamWrapper_Abstract.log in internal_data.
    $config['bdDataStorageDebug'] = false;

    # The specified permissions will be applied automatically for all new directories.
    $config['bdDataStorageFtpCreateDirOptimize'] = 0777;

    # Control whether to download files from remote storage. Setting this true will force the add-on to use cached data only.
    $config['bdDataStorageDoNotDownloadFile'] = true;

    # Optmize url_stat calls by assuming all file must have an extension and directory must not.
    # Add-ons that do things differently may fail to work with this flag turned on.
    # Please test carefully before using it!
    $config[‘bdDataStorageUrlStatOptimize’] = false;
    Liquor, wakon5544 and XFNewbie like this.

Recent Updates

  1. Minor Update
  2. Maintenance Update
  3. Minor Update

Recent Reviews

  1. Vietnamese
    Vietnamese
    5/5,
    Version: 1.2.1
    Thank
Loading...