PHP Redis Session Handler – WordPress Redis

How to Set Up a Redis Server as a Session Handler:

# nano /usr/local/php74/lib/php.ini
# session.save_handler = redis
# session.save_path = "tcp://127.0.0.1:6379?auth=secretpass123"

Redis Extra Security:

Set a Password for the Redis Server

To add an extra layer of security to your Redis installation, you are encouraged to set a password for accessing the server data. We will edit the same configuration file from the previous step, /etc/redis/redis.conf:

sudo nano /etc/redis/redis.conf

 Copy

Now, uncomment the line that contains requirepass, and set a strong password:/etc/redis/redis.conf

requirepass yourverycomplexpasswordhere

 Copy

Restart the Redis service so the changes take effect:

sudo service redis-server restart

Install HTML Tidy at Centos 8/Directadmin

Requirements:
dnf install libtidy libtidy-devel

1.
To start customizing the compilation parameters, first we need to create a custom compilation file:
cd /usr/local/directadmin/custombuild
mkdir -p custom/php
cp -fp “configure/php/configure.php74” “custom/php/configure.php74”

2.
Open the file:
/usr/local/directadmin/custombuild/custom/php/configure.php74

3.
Add –with-tidy line to the end of the custom/php/configure.php74 file, and make sure the \ character exists at the end of all lines except the last one. The \ character tells the configure line to loop to the next line, making the line easier to read. Without the \ character to trigger the wrap, the next line is incorrectly read as a separate command.

4.
Build PHP:
./build php n

5.
Restart Apache and if necessary, PHP-FPM:
service httpd restart
service php-fpm74 restart

Resources:
https://www.php.net/manual/en/tidy.installation.php
https://docs.directadmin.com/webservices/php/php-extensions.html#add-a-custom-module-to-php-with-custombuild

How to install WP-CLI on Directadmin Centos 8

Install WP-CLI

WP-CLI wordt niet voorgeïnstalleerd op je hostingpakket. Daar zijn eigenlijk twee simpele redenen voor. Niet iedereen met een hostingpakket wil per se WordPress gebruiken. Wel WordPress installeren betekent daarnaast niet dat iemand ook meteen WP-CLI wil. Gelukkig is zelf WP-CLI installeren zo gebeurd en daarna ook makkelijk bij te werken wanneer nodig.

Continue reading

How to install mod_brotli on Directadmin CentOS 8

Just like gzip, Brotli is also a compression algorithm. It is developed by Google and serves best for text compression. The reason being, it uses a dictionary of common keywords and phrases on both client and server side and thus gives a better compression ratio. The advantage for Brotli over gzip is that it makes use of a dictionary and thus it only needs to send keys instead of full keywords. It is supported by all major browsers. Fewer bytes transferred not only leads to faster page load but also helps in reducing costs of Content Delivery Network (CDN).

Continue reading

How to install Memcached on CentOS 8

Free & open source, high-performance, distributed memory object caching system, generic in nature, but intended for use in speeding up dynamic web applications by alleviating database load.

Memcached is an in-memory key-value store for small chunks of arbitrary data (strings, objects) from results of database calls, API calls, or page rendering.

Memcached is simple yet powerful. Its simple design promotes quick deployment, ease of development, and solves many problems facing large data caches. Its API is available for most popular languages.

Continue reading

How to install WordPress + W3 Total Cache + Redis

Redis is an open source (BSD licensed), in-memory data structure store, used as a database, cache and message broker. Because of Memcached is not well maintained (not compatible with PHP 7) and could be considered as end-of-life, Redis should be a good alternative for Memcached.

Redis is a single-threaded server. It is not designed to benefit from multiple CPU cores. People are supposed to launch several Redis instances to scale out on several cores if needed. It is not really fair to compare one single Redis instance to a multi-threaded data store. Redis can also be configured as a cluster.

Continue reading