PiHole on Centos8

The PiHole installer fails due to unresolved dependencies. Centos8 does not provide the fastcgi for lighttpd. A workaround is provided here: <#link>

 <- COPY START
if [ ! -f "/usr/local/sbin/lighttpd" ]; then
dnf install -y autoconf make automake libtool pcre-devel zlib-devel bzip2-devel git

git clone https://git.lighttpd.net/lighttpd/lighttpd1.4.git
cd lighttpd1.4
./autogen.sh
./configure --disable-dependency-tracking
make
make install

cat << EOF > /etc/systemd/system/lighttpd.service
[Unit]
Description=Lightning Fast Webserver With Light System Requirements
After=syslog.target network-online.target

[Service]
PIDFile=/var/run/lighttpd.pid
EnvironmentFile=-/etc/sysconfig/lighttpd
ExecStart=/usr/local/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf

[Install]
WantedBy=multi-user.target
EOF

systemctl daemon-reload
systemctl enable lighttpd

mkdir -p /srv/www
mkdir -p /etc/lighttpd/conf.d
mkdir /etc/lighttpd/vhosts.d
cp doc/config/*.conf /etc/lighttpd/
cp doc/config/conf.d/*.conf /etc/lighttpd/conf.d

groupadd lighttpd
useradd -r -M -g lighttpd lighttpd

mkdir /var/log/lighttpd
chown lighttpd: /var/log/lighttpd
fi

setenforce 0
sed -i "s/^SELINUX=enforcing/SELINUX=permissive/" /etc/selinux/config

dnf install -y epel-release php-json git

git clone --depth 1 https://github.com/pi-hole/pi-hole.git Pi-hole
cd "Pi-hole/automated install/"
sed -i "s/lighttpd\slighttpd-fastcgi//" basic-install.sh
chmod +x basic-install.sh
./basic-install.sh
# <- COPY END

Leave a comment

Your email address will not be published. Required fields are marked *