2021-11-09 10:58:55
This commit is contained in:
@@ -17,6 +17,14 @@ bash -x bonus.sh -u
|
|||||||
- Click on the white background
|
- Click on the white background
|
||||||
- Type `thisisunsafe`
|
- Type `thisisunsafe`
|
||||||
|
|
||||||
|
```
|
||||||
|
# HTTP (4243 instead of 80) -- redirect to HTTPS
|
||||||
|
curl -v http://localhost:4243
|
||||||
|
|
||||||
|
# HTTPS (4244 instead of 443)
|
||||||
|
curl -sk https://localhost:4244 | less
|
||||||
|
```
|
||||||
|
|
||||||
Debian Preseed:
|
Debian Preseed:
|
||||||
- [Preseed](https://wiki.debian.org/DebianInstaller/Preseed)
|
- [Preseed](https://wiki.debian.org/DebianInstaller/Preseed)
|
||||||
- [Automating the installation using preseeding](https://www.debian.org/releases/stable/amd64/apb.en.html)
|
- [Automating the installation using preseeding](https://www.debian.org/releases/stable/amd64/apb.en.html)
|
||||||
@@ -45,6 +53,7 @@ Wordpress:
|
|||||||
Lighttpd:
|
Lighttpd:
|
||||||
- [Install Lighttpd with PHP and MariaDB](https://www.howtoforge.com/how-to-install-lighttpd-with-php-and-mariadb-on-debian-10/)
|
- [Install Lighttpd with PHP and MariaDB](https://www.howtoforge.com/how-to-install-lighttpd-with-php-and-mariadb-on-debian-10/)
|
||||||
- [How to install lighttpd on Debian](https://www.osradar.com/install-lighttpd-debian-10/)
|
- [How to install lighttpd on Debian](https://www.osradar.com/install-lighttpd-debian-10/)
|
||||||
|
- [lighttpd redirect from custom HTTP port to HTTPS](https://stackoverflow.com/questions/62109311/lighttpd-redirect-from-custom-http-port-81-to-https-port-443)
|
||||||
|
|
||||||
```
|
```
|
||||||
curl -sLo preseed.cfg https://www.debian.org/releases/stable/example-preseed.txt
|
curl -sLo preseed.cfg https://www.debian.org/releases/stable/example-preseed.txt
|
||||||
|
|||||||
4
bonus.sh
4
bonus.sh
@@ -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 09:58:20 by gbaconni ### ########.fr #
|
# Updated: 2021/11/09 10:58:53 by gbaconni ### ########.fr #
|
||||||
# #
|
# #
|
||||||
# **************************************************************************** #
|
# **************************************************************************** #
|
||||||
|
|
||||||
@@ -46,6 +46,8 @@ ft_lighttpd ()
|
|||||||
then
|
then
|
||||||
apt-get install -qq -y lighttpd
|
apt-get install -qq -y lighttpd
|
||||||
sed -i -r 's/80/4243/g' /etc/lighttpd/lighttpd.conf
|
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/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|"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
|
sed -i -r 's|"socket"([^=]*=>).*|"port"\1 "9000",|g' /etc/lighttpd/conf-available/15-fastcgi-php.conf
|
||||||
|
|||||||
Reference in New Issue
Block a user