Installing Hestia with PHP Restricted Access

Hello everyone, as we know, access to the PHP repository from Russia is restricted by the creator. When upgrading, of course, we use mirrors, but when installing Hestia from scratch, a question arose. Since the php.list file with the repository address is in /etc/apt/sources.list.d, and I suppose if it is placed there modified, it will be replaced during installation, are there any options to write a PHP mirror before installing Hestia?
P.S. I take care of the moral side of the issue, I am interested in purely technical ones)

  1. Use Ubuntu
  2. Use https://deb.sury.su
1 Like
  1. I agree with this decision.
  2. I have mirrors, I just wanted to know how to add them before running the Hestia installation script, if I immediately put the modified php.list file, for example, will it be replaced?
    I suppose if it is impossible to change it during installation, Ubuntu remains).
    Thank you

Modify the installer …

You can edit hst-install.sh and modify the function check_wget_curl to add this block (this is an example replacing suri.org by sury.su) so once it downloads the installer for debian it will change the blocked repo by the new one.

if [[ $type == debian ]]; then
     sed -Ei 's/sury\.org/sury\.su/g' "hst-install-$type.sh"
fi

So the entire function will look like this:

check_wget_curl() {
        # Check wget
        if [ -e '/usr/bin/wget' ]; then
                if [ -e '/etc/redhat-release' ]; then
                        wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh -O hst-install-rhel.sh
                        if [ "$?" -eq '0' ]; then
                                bash hst-install-rhel.sh $*
                                exit
                        else
                                echo "Error: hst-install-rhel.sh download failed."
                                exit 1
                        fi
                else
                        wget -q https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh -O hst-install-$type.sh
                        if [ "$?" -eq '0' ]; then
                                if [[ $type == debian ]]; then
                                        sed -Ei 's/sury\.org/sury\.su/g' "hst-install-$type.sh"
                                fi
                                bash hst-install-$type.sh $*
                                exit
                        else
                                echo "Error: hst-install-$type.sh download failed."
                                exit 1
                        fi
                fi
        fi

        # Check curl
        if [ -e '/usr/bin/curl' ]; then
                if [ -e '/etc/redhat-release' ]; then
                        curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-rhel.sh
                        if [ "$?" -eq '0' ]; then
                                bash hst-install-rhel.sh $*
                                exit
                        else
                                echo "Error: hst-install-rhel.sh download failed."
                                exit 1
                        fi
                else
                        curl -s -O https://raw.githubusercontent.com/hestiacp/hestiacp/release/install/hst-install-$type.sh
                        if [ "$?" -eq '0' ]; then
                                if [[ $type == debian ]]; then
                                        sed -Ei 's/sury\.org/sury\.su/g' "hst-install-$type.sh"
                                fi
                                bash hst-install-$type.sh $*
                                exit
                        else
                                echo "Error: hst-install-$type.sh download failed."
                                exit 1
                        fi
                fi
        fi
}
2 Likes

Thank you, it’s priceless, really!

1 Like