資安防護設定相關文章:
1.啟用 apache headers 模組
$sudo a2enmod headers
2.重新啟動 apache
$sudo service apache2 restart
3.編輯 /etc/apache2/conf-available/security.conf ,加上 header 設定
$sudo nano /etc/apache2/conf-available/security.conf
Header always set Strict-Transport-Security "max-age=31536000;includeSubdomains; preload"
步驟3.的方式會將整個設定複雜化,可以直接將
Header always set Strict-Transport-Security "max-age=31536000;includeSubdomains; preload"
寫入到/etc/apache2/sites-available/default-ssl.conf 。這樣設定會比較單純。所以
3.1 編輯 /etc/apache2/sites-available/default-ssl.conf
Header always set Strict-Transport-Security "max-age=31536000;includeSubdomains; preload"
4.重新載入設定
$sudo service apache2 reload
5.檢測https://www.example.com.tw指令:
$curl -s -D - https://www.example.com.tw -o /dev/null
沒有留言:
張貼留言