Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Being by installing the following:

    Code Block
    sudo apt-get install redis-server php-redis


  2. Edit the Redis config with this:

    Code Block
    sudo nano /etc/redis/redis.conf


  3. Search for the bind command and add your IP to the end of it:

    Code Block
    bind 127.0.0.1 YOUR_IP_ADDRESS


  4. Add this at the end of the file

    Code Block
    maxmemory 256mb
    maxmemory-policy allkeys-lru


  5. Open your php.ini, find and replace the following line with:

    Code Block
    session.save_handler = redis


  6. In the php.ini also uncomment and replace this line:

    Code Block
    session.save_path = "tcp://YOUR_IP_ADDRESS:6379"


  7. Drupal 8
    1. Grab the Redis module, enable it on your instance
    1. Make sure the Redis module is enabled before you add these settings into your settings.php in, it will cause a WSOD if you don't
       

      Code Block
      // Redis Settings
      $settings['redis.connection']['interface'] = 'PhpRedis';
      $settings['redis.connection']['host']      = '127.0.0.1';
      $settings['cache']['default'] = 'cache.backend.redis';
      $settings['cache']['bins']['bootstrap'] = 'cache.backend.chainedfast';
      $settings['cache']['bins']['discovery'] = 'cache.backend.chainedfast';
      $settings['cache']['bins']['config'] = 'cache.backend.chainedfast';
      $settings['container_yamls'][] = 'modules/contrib/redis/example.services.yml';
      
      


  8. Wordpress
    1. Install the WP Redis plugin
    2. Create a file wp-content/object-cache.php and put this in it:

      Code Block<?php # This is a Windows-friendly symlink require_once WP_CONTENT_DIR . '/plugins/wp-redis/object-cache.php';
      1. https://gist.github.com/labboy0276/92b91b9cae164da26bc13bdaec69d9b2

    3. Verify by going to wp-admin/plugins.php?plugin_status=dropins , you should see the object-cache.php file in there.

...