HSTS Not working

Problems with the Windows version of XAMPP, questions, comments, and anything related.

HSTS Not working

Postby Pyra_ » 17. May 2017 23:41

Ok, so today I was working on my site, attempting to enable HSTS and I did in httpd.conf:

a2enmod headers

<VirtualHost *:443>
Header always set Strict-Transport-Security "max-age=31536000; includeSubDomains"


<VirtualHost *:80>
[...]
ServerName midorimediagroup.us
Redirect permanent / https://midorimediagroup.us/

It said:

6:42:42 PM [Apache] Error: Apache shutdown unexpectedly.
6:42:42 PM [Apache] This may be due to a blocked port, missing dependencies,
6:42:42 PM [Apache] improper privileges, a crash, or a shutdown by another method.
6:42:42 PM [Apache] Press the Logs button to view error logs and check
6:42:42 PM [Apache] the Windows Event Viewer for more clues
6:42:42 PM [Apache] If you need more help, copy and post this
6:42:42 PM [Apache] entire log window on the forums

So here is the log:

(Well the logs were empty.)
Pyra_
 
Posts: 1
Joined: 17. May 2017 23:35
XAMPP version: 7.1.4
Operating System: Windows 8.1 x64, Build 9600

Re: HSTS Not working

Postby gsmith » 18. May 2017 20:25

a2enmod

Only in unixy OSs, I've never seen it in a windows build. Open c:\xampp\apache\conf\httpd.conf and make sure the LoadModule line for mod_headers is uncommented.

If it is already uncommented, try starting apache from a command prompt, you'll definitely see errors then.
gsmith
 
Posts: 237
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 7-10/VC 6,9,11,14,15

Re: HSTS Not working

Postby edmonaft » 02. March 2018 13:31

hi, i wonder if HSTS is now supported in XAMPP? Hoping that it can be used already :-)
edmonaft
 
Posts: 2
Joined: 02. March 2018 13:29
XAMPP version: win32-5.6.33-0-VC11
Operating System: Windows 2012 R2 SP1

Re: HSTS Not working

Postby gsmith » 02. March 2018 18:49

HSTS is just setting a special header, Apache's been able to do that for decades now. Apache/1.3.0 had it, and was released 20 years ago come June 6.

mod_headers needs to be loaded to be able to use the Header directive however, probably what the OP had not done and I didn't think of it at the time of my reply. Shame on me!
gsmith
 
Posts: 237
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 7-10/VC 6,9,11,14,15

Re: HSTS Not working

Postby edmonaft » 06. March 2018 08:03

Wow! You are right! I applied the same settings under my vhosts and it worked! Amazing!!! My HTTPS site is now deployed with HSTS! Thanks!
edmonaft
 
Posts: 2
Joined: 02. March 2018 13:29
XAMPP version: win32-5.6.33-0-VC11
Operating System: Windows 2012 R2 SP1


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 44 guests