我正在尝试为运行Debian 8(Jessie)的lighttpd web服务器设置ssl(即https)。
lighttpd.conf中的相关行是:
server.modules = ( "mod_access", "mod_alias", "mod_compress", "mod_redirect", "mod_ssi", "mod_fastcgi", "mod_auth", "mod_rewrite", "mod_proxy", "mod_ssl", ) $SERVER["socket"] =~ "111.11.22.33:443" { server.document-root = "/var/www/html" ssl.engine = "enable" ssl.pemfile = "/etc/lighttpd/ssl/mydomain.com/mydomain.com.pem" }
文件mydomain.com.pem是自行发布的。
然后我开始服务,并检查是否一切正常:
# /etc/init.d/lighttpd restart [ ok ] Restarting lighttpd (via systemctl): lighttpd.service. # systemctl status lighttpd.service ● lighttpd.service - Lighttpd Daemon Loaded: loaded (/lib/systemd/system/lighttpd.service; enabled) Active: failed (Result: exit-code) since Mi 2015-09-02 19:55:57 CEST; 5s ago Process: 31750 ExecStart=/usr/sbin/lighttpd -D -f /etc/lighttpd/lighttpd.conf (code=exited, status=255) Process: 31742 ExecStartPre=/usr/sbin/lighttpd -t -f /etc/lighttpd/lighttpd.conf (code=exited, status=0/SUCCESS) Main PID: 31750 (code=exited, status=255) Sep 02 19:55:57 hostname.com lighttpd[31742]: Syntax OK Sep 02 19:55:57 hostname.com lighttpd[31750]: 2015-09-02 19:55:57: (plugin.c.169) dlopen() failed for: /usr/lib/lighttpd/mod_ssl.so /usr/lib/lighttpd/mod_ssl.so: cannot open shared object file: No such file or directory Sep 02 19:55:57 hostname.com lighttpd[31750]: 2015-09-02 19:55:57: (server.c.679) loading plugins finally failed Sep 02 19:55:57 hostname.com systemd[1]: lighttpd.service: main process exited, code=exited, status=255/n/a Sep 02 19:55:57 hostname.com systemd[1]: Unit lighttpd.service entered failed state.
显然,它没有工作: mod_ssl.so丢失。
有一个名称在apache目录中的库,这是行不通的(我试图设置一个符号链接):
... ... undefined symbol: ap_set_deprecated ...
我从哪里得到mod_ssl.so从?
编辑:
# openssl --version openssl:Error: '--version' is an invalid command .... # lighttpd -v lighttpd/1.4.35 (ssl) - a light and fast webserver Build-Date: Nov 2 2014 03:47:15
从模块列表中删除该行。
SSL支持被编译成lighttpd,而不是一个单独的模块。
如果你的版本在lighttpd -v的输出中编译了这个支持,将会包含(ssl) 。
[root@APPS /]# lighttpd -v lighttpd/1.4.36 (ssl) - a light and fast webserver Build-Date: Jul 27 2015 14:27:26 [root@APPS /]#
实际的工作是由OpenSSL库完成的,这个库也必须安装。