要在設定時,加上 --with-openssl,這樣才會使用 openssl 。
如下:
./configure --with-openssl
只需要在 lighttpd.conf 裡加上,以下兩行,
ssl.engine = "enable"
ssl.pemfile = "server.pem"
至於,server.pem 是要怎麼製作出來的,
就要靠 openssl 去產生,如下:
openssl req -new -nodes -x509 -keyout server.pem -out server.pem -days 365
當然,port number 最好是設在 443。
server.port = 443
不過,如果是要讓 80 port 和 443 port 同時使用,
可以改為以下:
server.port = 80
$SERVER["socket"]==":443" {
ssl.engine = "enable"
ssl.pemfile = "server.pem"
}
lighty的官方文件對SSL配置寫的已經比較詳細了,搞懂SSL簽名流程就可以了
SSL簽名流程如下
下載
apt-get install openssl*
配置原始碼時加上 ./configure --with-openssl --with-openssl-libs=/usr/lib
用 lighttpd -v ,可以看到(ssl)
lighttpd/1.4.28 (ssl) - a light and fast webserver
Build-Date: Dec 24 2010 17:19:54
生成包含私鑰和ca的檔案,自我認證。可以通過第三方鏈條驗證
openssl req -new -x509 -keyout server.pem -out server.pem -days 365 -nodes
在conf檔案中至少進行如下配置,SSL的預設埠為443
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/home/jli/network/lighttpd-1.4.28/conf/server.pem"
}
在conf檔案中至少進行如下配置,SSL的預設埠為443
$SERVER["socket"] == ":443" {
ssl.engine = "enable"
ssl.pemfile = "/home/jli/network/lighttpd-1.4.28/conf/server.pem"
}
ssl.engine enable/disable ssl engine
ssl.pemfile path to the PEM file for SSL support 包含私鑰和ca認證檔案
ssl.ca-file path to the CA file for support of chained certificates。
ssl.use-sslv2 enable/disable use of SSL version 2 (lighttpd < 1.4.21 only, newer version don't support SSLv2)
ssl.cipher-list Configure the allowed SSL ciphers
ssl.verifyclient.activate enable/disable client verification
ssl.verifyclient.enforce enable/disable enforcing client verification
ssl.verifyclient.depth certificate depth for client verification
ssl.verifyclient.exportcert enable/disable client certificate export to env:SSL_CLIENT_CERT
ssl.verifyclient.username client certificate entity to export as env:REMOTE_USER (eg. SSL_CLIENT_S_DN_emailAddress, SSL_CLIENT_S_DN_UID, etc.)
fastcgi.server = ( ".php" =>
( "localhost" =>
(
"socket" => "/tmp/php-fastcgi.socket",
"bin-path" => "/usr/bin/php-cgi"
)
)
)
server.modules = (
"mod_access",
"mod_fastcgi",
# "mod_alias",
# "mod_auth",
# "mod_evasive",
# "mod_redirect",
# "mod_rewrite",
# "mod_setenv",
# "mod_usertrack",
)
沒有留言:
張貼留言