2025年6月19日 星期四

Ubuntu 24.04 的 Apache2 設定 HTTP Strict Transport Security(HSTS)與檢測方法

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

資料來源:



沒有留言:

張貼留言

只要點兩下兩次,就能依照設定拆分指定PDF頁數並合併成設定好的一個PDF

        最近遇到一個問題,想要對四個不同的PDF,分別擷取1~2頁、3~4頁、5~6頁、7~8頁,合併成一個總共8頁的PDF。那該怎麼寫程式來處理這件事呢?那如果是用線上拆分PDF網頁與線上合併PDF網頁,該怎麼做呢?則是需要將四個不同PDF分別上傳到拆分網頁後再 一頁一...