Skip to content

Commit f583c31

Browse files
committed
Validate if www.conf exist and has the right port.
It may occure that the www.conf port has a different port than 9000 due to old multiphp setup, also maybe it doesnt exist. This adjustment checks and validates the configuration and resolves hestiacp#881.
1 parent 1fe639e commit f583c31

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

install/upgrade/manual/migrate_mpm_event.sh

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,5 +47,24 @@ if ! apache2ctl configtest >/dev/null 2>&1; then
4747
exit 1
4848
fi
4949

50-
echo "mpm_event module was successfully activated."
50+
# Validate if www.conf is existent and port 9000 is active
51+
if ! lsof -Pi :9000 -sTCP:LISTEN -t >/dev/null; then
52+
if [ $(ls /etc/php/7.3/fpm/pool.d/www.conf) ]; then
53+
# Replace listen port to 9000
54+
sed -i "s/listen = 127.0.0.1:.*/listen = 127.0.0.1:9000/g" /etc/php/7.3/fpm/pool.d/www.conf
55+
else
56+
# Copy www.conf file
57+
cp -f $HESTIA_INSTALL_DIR/php-fpm/www.conf /etc/php/7.3/fpm/pool.d/
58+
fi
59+
# Restart php7.3 fpm service.
60+
systemctl restart php7.3-fpm
61+
fi
62+
63+
# Check again if port 9000 is now in use.
64+
if lsof -Pi :9000 -sTCP:LISTEN -t >/dev/null; then
65+
echo "mpm_event module was successfully activated."
66+
else
67+
echo "There went something wrong with your php-fpm configuration - port 9000 isnt active. Please check if webmail and phpmyadmin (if installed) are working properly."
68+
fi
69+
5170
systemctl restart apache2

0 commit comments

Comments
 (0)