SquidGuard is a URL redirector used to use blacklists with the proxysoftware Squid. There are two big advantages to squidguard: it is fast and it is free.
SSL with Lighttpd
Lighttpd installation
Lighttpd needs to be configured and compiled with SSL enabled:
./configure --with-openssl
make
make install
After lighty has been installed, you can confirm that it has been compiled with ssl enabled:
lighttpd -v
SSL Configuration
mkdir /root/.lighttpdssl
cd /root/.lighttpdssl
openssl req -new -x509 -keyout lighttpd.pem -out lighttpd.pem -days 365 -nodes
chmod 400 lighttpd.pem
Edit /service/lighttpd/root/lighttpd.conf
and add:
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/root/.lighttpdssl/lighttpd.pem"
}
Redirect http to https
How to Redirect HTTP to HTTPS
Enable mod_redirect
in your lighttpd.conf
:
server.modules = (
"mod_redirect",
)
- redirect everything
$HTTP["scheme"] == "http" {
# capture vhost name with regex conditiona -> %0 in redirect pattern
# must be the most inner block to the redirect rule
$HTTP["host"] =~ ".*" {
url.redirect = (".*" => "https://%0$0")
}
} - specific url
$HTTP["scheme"] == "http" {
$HTTP["host"] =~ ".*" {
url.redirect = ("^/phpmyadmin/.*" => "https://%0$0")
}
} - only for specific vhost and url
$HTTP["scheme"] == "http" {
$HTTP["host"] == "sth.example.com" {
url.redirect = ("^/phpmyadmin/.*" => "https://sth.example.com$0" )
}
}
- Log in to post comments