Koozali.org: home of the SME Server

Redirecting all web traffic from HTTP to HTTPS

santiagon

Redirecting all web traffic from HTTP to HTTPS
« on: March 19, 2007, 10:53:35 PM »
Hi all--

I tried searching SSL and HTTPS, to no avail.

Is there a way of effectively redirecting any traffic bound for port 80 (HTTP) to port 443 (HTTPS)?

I know that the server manager does it, along with some contribs, but is there a way to make it work for the entire Apache setup?

Please advise.

Offline bpivk

  • *
  • 908
  • +0/-0
    • http://www.bezigrad.com
Redirecting all web traffic from HTTP to HTTPS
« Reply #1 on: March 19, 2007, 11:58:56 PM »
Stupid question... Why would you want to do that?
"It should just work" if it doesn't report it. Thanks!

santiagon

Redirecting all web traffic from HTTP to HTTPS
« Reply #2 on: March 20, 2007, 12:14:56 AM »
I'm using this box basically as a secure DB server, so all web traffic should be SSLed.

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Redirecting all web traffic from HTTP to HTTPS
« Reply #3 on: March 20, 2007, 05:05:25 PM »
Quote from: "santiagon"
I'm using this box basically as a secure DB server, so all web traffic should be SSLed.
Add a general rewrite rule like done for the server-manager and webmail, see the configuration templates and the /etc/httpd/conf/httpd.cionf configuration file.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)

Offline william_syd

  • *****
  • 1,608
  • +0/-0
  • Nothing to see here.
    • http://www.magicwilly.info
Redirecting all web traffic from HTTP to HTTPS
« Reply #4 on: March 21, 2007, 04:46:50 AM »
Part solution... stop listening on port 80.
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
touch /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/35Listen80
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith restart
Regards,
William

IF I give advise.. It's only if it was me....

Offline cactus

  • *
  • 4,880
  • +3/-0
    • http://www.snetram.nl
Redirecting all web traffic from HTTP to HTTPS
« Reply #5 on: March 21, 2007, 09:34:36 AM »
Quote from: "william_syd"
Part solution... stop listening on port 80.
Code: [Select]
mkdir -p /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf
touch /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/35Listen80
expand-template /etc/httpd/conf/httpd.conf
/etc/rc7.d/S86httpd-e-smith restart

In combination with the rewrite rule above would make it complete.
Be careful whose advice you buy, but be patient with those who supply it. Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than its worth ~ Baz Luhrmann - Everybody's Free (To Wear Sunscreen)