Please add redis and memcached

Please add redis and memcached to install script for all php

1 Like

We do not want to overload hestia, but you can just install them manualy if you need them with apt install phpX.X-redis phpX.X-memcached

X.X stands for the wanted php version, for example 7.3.

You can’t add it as a parameter to the new installation script, the same way you install the multiphp option?

It would be great to have options for the automation of caching systems :clap:

How hard is it to run

apt-get install php-memcached php-redis 

In command line? Again we just don’t want to overload Hestia. And currently the installer has way too much options available.

We do not limit the use of any caching software but some basic knowledge of Linux is required to use Hestia with is full potential.

3 Likes

@eris Not that it’s difficult, it just doesn’t work in ubuntu :sweat_smile:

(in cents 7 with vestacp works well)

Result: (I’ve replaced the host name with localhost for privacy)

root@localhost:~# apt-get install php-memcached php-redis
Reading package lists… Done
Building dependency tree
Reading state information… Done
php-redis is already the newest version (5.2.1+4.3.0-1+ubuntu18.04.1+deb.sury.org+1).
The following additional packages will be installed:
libmemcached11 php-msgpack
The following NEW packages will be installed:
libmemcached11 php-memcached php-msgpack
0 upgraded, 3 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
Need to get 279 kB of archives.
After this operation, 1,494 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 httpXXX://asi-fs-n.contabonet/ubuntu bionic-updates/main amd64 libmemcached11 amd64 1.0.18-4.2ubuntu0.18.04.1 [83. 2 kB]
Get:2 httpXXX://ppa.launchpadnet/ondrej/php/ubuntu bionic/main amd64 php-msgpack amd64 2.1.0+0.5.7-1+ubuntu18.04.1+deb.s ury.org+1 [79.1 kB]
Get:3 httpXXX://ppa.launchpadnet/ondrej/php/ubuntu bionic/main amd64 php-memcached amd64 3.1.4+2.2.0-1+ubuntu18.04.1+deb .sury.org+20191129 [116 kB]
Fetched 279 kB in 0s (1,056 kB/s)
Selecting previously unselected package php-msgpack.
(Reading database … 88343 files and directories currently installed.)
Preparing to unpack …/php-msgpack_2.1.0+0.5.7-1+ubuntu18.04.1+deb.sury.org+1_amd64.deb …
Unpacking php-msgpack (2.1.0+0.5.7-1+ubuntu18.04.1+deb.sury.org+1) …
Selecting previously unselected package libmemcached11:amd64.
Preparing to unpack …/libmemcached11_1.0.18-4.2ubuntu0.18.04.1_amd64.deb …
Unpacking libmemcached11:amd64 (1.0.18-4.2ubuntu0.18.04.1) …
Selecting previously unselected package php-memcached.
Preparing to unpack …/php-memcached_3.1.4+2.2.0-1+ubuntu18.04.1+deb.sury.org+20191129_amd64.deb …
Unpacking php-memcached (3.1.4+2.2.0-1+ubuntu18.04.1+deb.sury.org+20191129) …
Setting up libmemcached11:amd64 (1.0.18-4.2ubuntu0.18.04.1) …
Setting up php-msgpack (2.1.0+0.5.7-1+ubuntu18.04.1+deb.sury.org+1) …
Setting up redis-server (5:4.0.9-1ubuntu0.2) …
Job for redis-server.service failed because a timeout was exceeded.
See “systemctl status redis-server.service” and “journalctl -xe” for details.
invoke-rc.d: initscript redis-server, action “start” failed.
â—Ź redis-server.service - Advanced key-value store
Loaded: loaded (/lib/systemd/system/redis-server.service; disabled; vendor preset: enabled)
Active: activating (auto-restart) (Result: timeout) since Mon 2020-06-29 11:48:58 CEST; 6ms ago
Docs: httpXXX://redisio/documentation,
man:redis-server(1)

Jun 29 11:48:58 localhost.com systemd[1]: Failed to start Advanced key-value store.
dpkg: error processing package redis-server (–configure):
installed redis-server package post-installation script subprocess returned error exit status 1
Setting up php-memcached (3.1.4+2.2.0-1+ubuntu18.04.1+deb.sury.org+20191129) …
Processing triggers for libc-bin (2.27-3ubuntu1) …
Processing triggers for php7.4-fpm (7.4.7-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.4-cli (7.4.7-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.3-fpm (7.3.19-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.3-cli (7.3.19-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.2-fpm (7.2.31-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.2-cli (7.2.31-1+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.1-fpm (7.1.33-16+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.1-cli (7.1.33-16+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.0-fpm (7.0.33-29+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php7.0-cli (7.0.33-29+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php5.6-fpm (5.6.40-29+ubuntu18.04.1+deb.sury.org+1) …
Processing triggers for php5.6-cli (5.6.40-29+ubuntu18.04.1+deb.sury.org+1) …
Errors were encountered while processing:
redis-server
E: Sub-process /usr/bin/dpkg returned an error code (1)

Note: Modified links, the forum won’t let me publish them

Just did a test install on Debian 10 and Ubuntu and had no issues… Probably IPV6 has been disabled

nano /etc/redis/redis.conf

Change the line bind 127.0.0.1::1 to 127.0.0.1
Change the line supervised no to spervised systemd

4 Likes

@eris

That was it, thank you very much!

(I’ve been trying to fix this for a week and I couldn’t find the solution, I hope this answer is helpful to many others) :clap:

You can install Redis from source using the following

apt-get install build-essential
apt-get install tcl wget

Download and build

wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable/
make distclean
make
make test
make install

Install Redis server

cd utils/
./install_server.sh

Allow memory overcommit

echo “vm.overcommit_memory = 1” >> /etc/sysctl.conf && sysctl -p

Start and test Redis service

systemctl start redis_yourinstallnamehere
systemctl status redis_yourinstallnamehere

Replace yourinstallnamehere with what you call the Redis service

Forgot to add…

If in the Redis install you get an error
This systems seems to use systemd.
Please take a look at the provided example service unit files in this directory, and adapt and install them. Sorry!

Comment out following lines in redis-stable/utils/install_server.sh file

bail if this system is managed by systemd
_pid_1_exe=“$(readlink -f /proc/1/exe)”
if [ “${_pid_1_exe##*/}” = systemd ]
then
echo “This systems seems to use systemd.”
echo “Please take a look at the provided example service unit files in this directory, and adapt and >install them. Sorry!”
exit 1
fi

then install tk

apt-get install -y tk

then run the installer again

./install_server.sh

1 Like

the above guide install memcached for php 8, can anyone help me to setup memcached for php 7.4.

Thanks

apt-get install php7.4-package should work

2 Likes

Yeah. I think it is that time of year that Redis should be added as an install option to the Hestia.

It is on our maybe for the future todo list. Feel free to submit a pull request or consider sponsoring such feature…

1 Like

The problem I’m seeing on this forum is that I am offered like 10 different solutions sot install Redis. And I don’t know which one of those is the correct, or the most correct method. For example, Salnz, on this thread gives this lengthy installation step-by-step guide, others tell you to just do three easy steps. I don’t know what method to follow.

The one method I followed was Felix’s at this thread: Memcached / redis

I don’t know if it works or not, but it seemed to run the installation just fine.

1 Like

The difference between this two is that @salnz builds it from source, while @Felix uses the system repository with its prebuild packages. We also need to draw a clear line here, we don’t want to make hestia as a replacement for sysadmin skills, it should just help to optimize the work. So as written, the target group are still sysadmins, not people which “just” want to host their website for low costs or people, starting with linux and webhosting.

1 Like