由于OpenSSL + Apache,我正在失去理智。我已经检查了很多资源,咨询了同事们,并意识到目前最好的选择是咨询其他资源(也就是你们)。
我使用编写了软件,用于监听端口1240上的HTTP请求。但是,由于我需要屏蔽网络检查,所以我想用ssl封装它。我们决定用ProxyPass代替Python,因为它更快、更可靠,而且更具有全球知名度。
一切言行一致,安装了阿帕奇。为要运行的服务构建一个独立的用户等,因此当服务(cr/h)被加到(cr/h)时,它们将被关押在一个用户帐户中。所有的爵士乐。
现在,我编写了以下启用的站点:
ProxyRequests Off
<VirtualHost *:443>
ServerName SERVER_NAME
ProxyPass / http://127.0.0.1:1240/
ProxyPassReverse / http://127.0.0.1:1240/
<Directory proxy:*>
Order Deny,Allow
Allow from all
</Directory>
SSLEngine on
SSLCACertificateFile /etc/ssl/certs/MY_CERT.crt
SSLCertificateFile /etc/ssl/certs/MY_CERT.crt
SSLCertificateKeyFile /etc/ssl/certs/MY_CERT.pem
</VirtualHost>外观很好,不是吗?(请注意,由于Dataleakage,我已经将servername和证书的名称更改为大写字母等等。无论如何,即使很难,当我与firefox连接时也会出现以下错误。
(Error code: ssl_error_rx_record_too_long)和我想:“等等,这不太好”。
所以我开始谷歌,我发现mod可能没有加载。因此,我检查了如下:
root@SYSTEM:/etc/apache2# apachectl -t -D DUMP_MODULES
[Thu Jan 24 09:36:44 2013] [warn] NameVirtualHost *:8080 has no VirtualHosts
Loaded Modules:
core_module (static)
log_config_module (static)
logio_module (static)
mpm_prefork_module (static)
http_module (static)
so_module (static)
alias_module (shared)
auth_basic_module (shared)
authn_file_module (shared)
authz_default_module (shared)
authz_groupfile_module (shared)
authz_host_module (shared)
authz_user_module (shared)
autoindex_module (shared)
cgi_module (shared)
deflate_module (shared)
dir_module (shared)
env_module (shared)
mime_module (shared)
negotiation_module (shared)
php5_module (shared)
proxy_module (shared)
proxy_ajp_module (shared)
proxy_balancer_module (shared)
proxy_connect_module (shared)
proxy_ftp_module (shared)
proxy_http_module (shared)
proxy_scgi_module (shared)
reqtimeout_module (shared)
setenvif_module (shared)
ssl_module (shared)
status_module (shared)
Syntax OK看上去不错,继续前进。检查日志,我发现了与这里完全相同的错误:http://ubuntuforums.org/showthread.php?t=806884
试过了,但没起作用。我重新生成了密钥,但是我使用openssl检查了密钥的有效性( http://www.devco.net/archives/2006/02/13/public_-_私有_钥匙_加密_使用_openssl.php ):
root@SYSTEM:/etc/ssl/certs# openssl x509 -in MY_CERT.crt -noout -text
Certificate:
Data:
Version: 1 (0x0)
Serial Number: <---8<---snip---8<--->(0x<---8<---snip---8<--->)
Signature Algorithm: sha1WithRSAEncryption
Issuer: <---8<---snip---8<--->
Validity
Not Before: Jan 24 08:05:44 2013 GMT
Not After : Mar 25 08:05:44 2013 GMT
Subject: <---8<---snip---8<--->
Subject Public Key Info:
Public Key Algorithm: rsaEncryption
Public-Key: (1024 bit)
Modulus:
<---8<---snip---8<--->
Exponent: <---8<---snip---8<---> (0x<---8<---snip---8<--->)
Signature Algorithm: sha1WithRSAEncryption
<---8<---snip---8<--->看起来很有效,现在我开始脱发了。也是当我打443的时候。我GET /我得到了HTML返回。所以看起来SSL根本没有运行。有什么小窍门让我试试吗?要复习的文件什么的吗?
而且,我意识到自我签名等并不是最安全的事情。但这并不是现在的重点,因为它真的只是一个概念的证明在目前。因此,任何建议都是非常有用的,我会奖励你一个ServerFault +1的帖子;)
编辑:还有一个小提示,当我使用links https://localhost时,它可以工作。
STOLAS@SYSTEM:~$ sudo apachectl -S
[sudo] password for STOLAS:
[Thu Jan 24 10:47:42 2013] [warn] NameVirtualHost *:8080 has no VirtualHosts
VirtualHost configuration:
wildcard NameVirtualHosts and default servers:
*:443 SERVER.COM (/etc/apache2/sites-enabled/000-default:2)
Syntax OK 发布于 2013-01-25 07:58:26
当@al4上一次回复的时候,我开始思考。因为我不是唯一一个在这个问题上工作过的人,所以我决定做一只猫,$HISTFILE,有人包括了一条iptable规则。
所以,谢谢大家。抱歉浪费了你的时间。结果我把阿帕奇的事做得很好。但是有人用iptables把我的一天搞砸了(这花了我两天时间)
但是当我做iptables -L ; iptables -t nat -L (把我的iptables规则抛到标准时),我发现有一个从143到1240的抽签规则。其他命令让我意识到iptable,netstat -lanp用于检查Apache是否正在运行,tcpdump not tcp 22用于检查是否有发送到方框的连接。
谢谢你的帮助,我希望一个迷路的谷歌人会发现这个答案在未来有用!
https://serverfault.com/questions/471998
复制相似问题