Http Apache 服務相關
[
2007/06/26 11:47 | by bruce_wu ]
2007/06/26 11:47 | by bruce_wu ]
在測試使用 Flash + PHP 來做檔案上傳時,結果 瀏覽器回應
406 錯誤的 Page ,看了Apache Log 後有一段
mod_security: Access denied with code 406. Pattern match "^Shockwave Flash" at HEADER("USER-AGENT") [severity "EMERGENCY"] [hostname "www.xspace.idv.tw"] [uri "/fileupload.php?d=true"]
經過除錯後發現原來是 Apache 的 mod_security 模組所造成
解決方法:
406 錯誤的 Page ,看了Apache Log 後有一段
mod_security: Access denied with code 406. Pattern match "^Shockwave Flash" at HEADER("USER-AGENT") [severity "EMERGENCY"] [hostname "www.xspace.idv.tw"] [uri "/fileupload.php?d=true"]
經過除錯後發現原來是 Apache 的 mod_security 模組所造成
解決方法:
[
2007/06/08 11:13 | by bruce_wu ]
2007/06/08 11:13 | by bruce_wu ]
目前網路有現成的模組 您可以使用 mod_security 增加 Apache 的安全性
mod_security 是 Apache 的一個模組
可以提供入侵偵測及防禦,它就如同是web應用程式的防火牆
可以用來抵擋知名及不知名的攻擊如 SQL injection attacks 、cross-site scripting、path traversal attacks
以下說明安裝過程:
mod_security 是 Apache 的一個模組
可以提供入侵偵測及防禦,它就如同是web應用程式的防火牆
可以用來抵擋知名及不知名的攻擊如 SQL injection attacks 、cross-site scripting、path traversal attacks
以下說明安裝過程:
[
2007/06/08 10:11 | by bruce_wu ]
2007/06/08 10:11 | by bruce_wu ]
世界上還真多無聊人士,吃飽就想如何攻擊別人的網站, 一種常見的攻擊是貼廣告或是莫名其妙的留言,這些都是要廣告特定的 URL,這都是小問題,但另有一種刻意要癱瘓網站的攻擊,常見的作法就是發動很多很多的用戶端要求,持續讓網站窮於應付,用掉資源(CPU的資源,socket的資源,頻寬的資源…),而使得網站無法服務正常的使用者,這就是所謂的 DoS — Denial of Service 攻擊,稱為阻絕服務攻擊。
針對 DoS 攻擊,官方的 Apache 本身並沒有提供解決之道,現在找到的是一個 3rd party 的模組,mod_evasive,用以下原理防治: Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following:
針對 DoS 攻擊,官方的 Apache 本身並沒有提供解決之道,現在找到的是一個 3rd party 的模組,mod_evasive,用以下原理防治: Detection is performed by creating an internal dynamic hash table of IP Addresses and URIs, and denying any single IP address from any of the following:
- Requesting the same page more than a few times per second
- Making more than n concurrent requests on the same child per second
- Making any requests while temporarily blacklisted (on a blocking list)
它的 README 寫對付 DDoS — Distributed DoS 也有效
以下說明一下安裝及設定過程:
[
2007/06/06 15:43 | by bruce_wu ]
2007/06/06 15:43 | by bruce_wu ]
本篇的目的,是說明如何使用最簡單的方式在你的網頁伺服器 (Apache) 上新增一個虛擬主機 (Virtual Host),讓你只要建一個目錄,或新增一個本機用戶,就可以建立虛擬主機,並且可自動分割 Log 檔 (以下之設定牽涉到 Apache 及 DNS 的觀念,最好也有自行架設 DNS 服務)。
[
2007/06/06 15:36 | by bruce_wu ]
2007/06/06 15:36 | by bruce_wu ]
為了簡化網址或是為了安全理由, 會希望將副檔名隱藏. 也就是說原本
http://www.xxx.yyy/test.php
只需要
http://www.xxx.yyy/test
就可以連上, 這樣可以讓網站所有連結都不出現副檔名
這就像yahoo的新服務 知識+ 一樣裡頭的連結完全沒出現.php
但經過我測試不管連到
http://tw.knowledge.yahoo.com/index
http://tw.knowledge.yahoo.com/index.php
其實是一樣的, 也就是說這個系統其實是php開發的
只是為了不要暴露使用的程式語言而隱藏了
另外yahoo還有一招, 就是任何的錯誤訊息都是自訂的錯誤訊息, 則是可以隱藏使用的伺服器型態.
下面講一下我找到的設定方法
http://www.xxx.yyy/test.php
只需要
http://www.xxx.yyy/test
就可以連上, 這樣可以讓網站所有連結都不出現副檔名
這就像yahoo的新服務 知識+ 一樣裡頭的連結完全沒出現.php
但經過我測試不管連到
http://tw.knowledge.yahoo.com/index
http://tw.knowledge.yahoo.com/index.php
其實是一樣的, 也就是說這個系統其實是php開發的
只是為了不要暴露使用的程式語言而隱藏了
另外yahoo還有一招, 就是任何的錯誤訊息都是自訂的錯誤訊息, 則是可以隱藏使用的伺服器型態.
下面講一下我找到的設定方法
[
2007/06/06 15:01 | by bruce_wu ]
2007/06/06 15:01 | by bruce_wu ]
phpize 是屬於 php-devel 中的東西,主要是設定 php 外掛模組的一些設定
所以安裝 php-devel 相關套件就會有 phpize 可以使用 (檔案預設存放於 /usr/bin/phpize )
phpize 命令是用來準備 PHP 外掛模組的編譯環境的。下面例子中,外掛模組的源程序位於 extname 目錄中:
$ cd extname
$ phpize
$ ./configure (註一)
$ make
$ make install
成功的安裝將建立 extname.so 並放置於 PHP 的外掛模組目錄中 (預設存放於 /usr/lib/php/modules/ 內) 。
需要調整 php.ini,加入 extension=extname.so 這一行之後才能使用此外掛模組。
註一:
如在執行 ./configure 時出現 not find –with-php-config 時,
可重下以下指令,因 –with-php-config 預設在 /usr/bin/php-config 可找到
./configure –with-php-config=/usr/bin/php-config






