顯示具有 iframe 標籤的文章。 顯示所有文章
顯示具有 iframe 標籤的文章。 顯示所有文章

2017年3月12日 星期日

[Apache] 防止別人嵌入您的網頁

為了加強網頁安全性,不讓別人iframe你的網頁

1. 打開apache headers mods
sudo a2enmod headers

2. 重啟apache
sudo /etc/init.d/apache2 restart

3. 編輯apach2.conf
sudo nano /etc/apache2/apache2.conf

4. Directory /var/www/html/ 裡面加入
Header always append X-Frame-Options SAMEORIGIN

5. 重啟apache
sudo /etc/init.d/apache2 restart

[CentOS] httpd port 9000 to 80

<VirtualHost *:80>     ServerName domain.name     ProxyRequests Off     ProxyVia Block     ProxyPreserveHost On     <Proxy *...