Apache virtualhost: redirect a vhost from port 80 to 443 (ssl)

Categories: Interwebz, Linux

To redirect access to starndard www port to https one you’ve to change the default vhost configuration from VirtualHost *:80 to VirtualHost *:443 and add the “redirect section”: I’ve added this: <VirtualHost *:80> ServerName example.twopenguins.it ServerAlias www.example.twopenguins.it <Location /> Redirect permanent / https://example.twopenguins.it </Location> </VirtualHost> And changed the “old” section from :80 to :443: <VirtualHost […]

FreeBSD: set up self-signed SSL certificates for Apache virtualhosts

Categories: BSD

cd /usr/local/etc/apache22/ openssl genrsa -des3 -out server.key 1024 (choose a password) ´╗┐openssl req -new -x509 -days 3650 -nodes -sha256 -key server.key -out server.crt answer the questions and you’re done. Remove the password from the cert: cp server.key server.key2 openssl rsa -in server.key2 -out server.key

Debian lenny: switch Apache in a chroot environment

Categories: Slackware

To do this i’ve followed an howto from unixlife.it with some modifications. Assuming you have your websites on /var/www/ and you want to move it on a chroot dir, /var/chroot/apache/, for example, let’s see what do you need to do: Remember to do a complete backup before doing anything that could be “dangerous”. In /etc/apache2/apache2.conf […]