2021-11-09 10:58:55

This commit is contained in:
gbaconni
2021-11-09 10:58:55 +01:00
parent 56d9139247
commit 4f8950e4d9
2 changed files with 12 additions and 1 deletions

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ #
# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# #
# Updated: 2021/11/09 09:58:20 by gbaconni ### ########.fr #
# Updated: 2021/11/09 10:58:53 by gbaconni ### ########.fr #
# #
# **************************************************************************** #
@@ -46,6 +46,8 @@ ft_lighttpd ()
then
apt-get install -qq -y lighttpd
sed -i -r 's/80/4243/g' /etc/lighttpd/lighttpd.conf
grep -q 'url.redirect' /etc/lighttpd/lighttpd.conf \
|| echo -e '\n$HTTP["scheme"] == "http" {\n\t$HTTP["host"] =~ "([^:]*)(:[0-9]+|)$" {\n\t\turl.redirect = (".*" => "https://%1:4244${url.path}${qsa}")\n\t}\n\turl.redirect-code = 302\n}\n' >> /etc/lighttpd/lighttpd.conf
sed -i -r 's/443/4244/g' /etc/lighttpd/conf-available/10-ssl.conf
sed -i -r 's|"bin-path"([^=]*=>).*|"host"\1 "127.0.0.1",|g' /etc/lighttpd/conf-available/15-fastcgi-php.conf
sed -i -r 's|"socket"([^=]*=>).*|"port"\1 "9000",|g' /etc/lighttpd/conf-available/15-fastcgi-php.conf