2021-11-09 08:27:25

This commit is contained in:
gbaconni
2021-11-09 08:27:25 +01:00
parent b181db83b7
commit 0a61182263

View File

@@ -6,7 +6,7 @@
# By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ # # By: gbaconni@student.42lausanne.ch +#+ +:+ +#+ #
# +#+#+#+#+#+ +#+ # # +#+#+#+#+#+ +#+ #
# Created: 2021/11/07 14:23:18 by gbaconni #+# #+# # # Created: 2021/11/07 14:23:18 by gbaconni #+# #+# #
# Updated: 2021/11/09 07:42:04 by gbaconni ### lausanne.ch # # Updated: 2021/11/09 08:26:49 by gbaconni ### lausanne.ch #
# # # #
# **************************************************************************** # # **************************************************************************** #
@@ -45,37 +45,29 @@ ft_lighttpd ()
if ! dpkg --get-selections | grep -qP '^lighttpd\t+install' if ! dpkg --get-selections | grep -qP '^lighttpd\t+install'
then then
apt-get install -qq -y lighttpd apt-get install -qq -y lighttpd
sed -i -r 's|^(server.document-root[^=]*=).*\1 "/usr/share/wordpress"|g' /etc/lighttpd/lighttpd.conf
sed -i -r 's/80/4243/g' /etc/lighttpd/lighttpd.conf
sed -i -r 's/443/4244/g' /etc/lighttpd/conf-available/10-ssl.conf
cat \
/etc/ssl/certs/ssl-cert-snakeoil.pem \
/etc/ssl/private/ssl-cert-snakeoil.key \
> /etc/lighttpd/server.pem
lighttpd-enable-mod fastcgi lighttpd-enable-mod fastcgi
lighty-enable-mod fastcgi-php lighttpd-enable-mod fastcgi-php
#sed -i 's/80/4243/g; s/443/4244/g;' /etc/apache2/ports.conf /etc/apache2/sites-available/{000-default,default-ssl}.conf lighttpd-enable-mod rewrite
#sed -i 's|/var/www/html|/usr/share/wordpress|g' /etc/apache2/sites-available/{000-default,default-ssl}.conf lighttpd-enable-mod ssl
systemctl force-reload lighttpd systemctl force-reload lighttpd
fi fi
return 0 return 0
} }
ft_apache_alternative ()
{
ft_ssl
if ! dpkg --get-selections | grep -qP '^apache2\t+install'
then
apt-get install -qq -y apache2
a2enmod alias headers ssl
a2ensite default-ssl
sed -i 's/80/4243/g; s/443/4244/g;' /etc/apache2/ports.conf /etc/apache2/sites-available/{000-default,default-ssl}.conf
sed -i 's|/var/www/html|/usr/share/wordpress|g' /etc/apache2/sites-available/{000-default,default-ssl}.conf
systemctl reload apache2
fi
return 0
}
ft_php () ft_php ()
{ {
if ! dpkg --get-selections | grep -qP '^php-fpm\t+install' if ! dpkg --get-selections | grep -qP '^php-fpm\t+install'
then then
apt-get install -qq -y php php-fpm php-mysql apt-get install -qq -y php php-fpm php-mysql
#sed -i -r 's/^(cgi.fix_pathinfo[^=]*)=.*/\1=1/' /etc/php/7.3/fpm/php.ini sed -i -r 's/^;?(cgi.fix_pathinfo)=.*/\1=1/' /etc/php/7.4/fpm/php.ini
#sed -i -r 's|^(listen[^=]*)=.*|\1 = /var/run/lighttpd/php.socket|' /etc/php/7.3/fpm/pool.d/www.conf sed -i -r 's|(listen =).*|\1 /run/php/php-fpm.sock|' /etc/php/7.4/fpm/pool.d/www.conf
systemctl restart php7.3-fpm systemctl restart php7.3-fpm
fi fi
return 0 return 0