为什么https://和http //:443有效,但是http不支持SSLEngine?

时间:2015-07-07 20:41:16

标签: apache virtualhost ports

我试图在Ubuntu / Debian中的VirtualHost上允许HTTP和HTTPS。我正在使用默认的snakeoil证书,当SSLEngine打开时,我收到以下错误。我的服务器名称是linuxturnkeylamp,我不知道如何添加.Belkin但我正在使用Belkin路由器进行互联网访问。

[Tue Jul 07 20:13:21 2015] [warn] RSA server certificate CommonName (CN) `linuxturkeylamp.Belkin' does NOT match server name!?
[Tue Jul 07 20:13:21 2015] [error] python_init: Python version mismatch, expected '2.7.2+', found '2.7.3'.
[Tue Jul 07 20:13:21 2015] [error] python_init: Python executable found '/usr/bin/python'.
[Tue Jul 07 20:13:21 2015] [error] python_init: Python path being used '/usr/lib/python2.7/:/usr/lib/python2.7/plat-linux2:/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-old:/usr/lib/python2.7/lib-dynload'.
[Tue Jul 07 20:13:21 2015] [notice] mod_python: Creating 8 session mutexes based on 150 max processes and 0 max threads.
[Tue Jul 07 20:13:21 2015] [notice] mod_python: using mutex_directory /tmp 
[Tue Jul 07 20:13:21 2015] [warn] RSA server certificate is a CA certificate (BasicConstraints: CA == TRUE !?)

apache2.conf有ServerName linuxturnkeylamp,除了一个默认的虚拟主机和一个用于phpmyadmin,我唯一的另一个是......

<VirtualHost localdrupal.mydomain.com:*>
    DocumentRoot //home/myuser/mydomain/mydomain
    ServerName localdrupal.mydomain.com
    ServerAlias localdrupal.mydomain.com
    ServerAdmin myemail@gmail.com
    Alias /mobile "//home/myuser/mydomain/projectpath/www"
    Alias /mobile-app/plugins "//home/myuser/mydomain/cordova/cordova-mydomain/plugins"
    Alias /mobile-app "//home/myuser/mydomain/projectpath/www"
    <Directory />
        Options FollowSymLinks
        AllowOverride None
    </Directory>
    <Directory //home/myuser/mydomain/mydomain>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride None
        Order allow,deny
        allow from all
    </Directory>
    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
        AllowOverride None
        Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
        Order allow,deny
        Allow from all
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/ssl_access.log combined

    SSLEngine on
    SSLCertificateFile    /etc/ssl/certs/ssl-cert-snakeoil.pem
    SSLCertificateKeyFile /etc/ssl/private/ssl-cert-snakeoil.key

    <FilesMatch "\.(cgi|shtml|phtml|php)$">
        SSLOptions +StdEnvVars
    </FilesMatch>
    <Directory /usr/lib/cgi-bin>
        SSLOptions +StdEnvVars
    </Directory>
    BrowserMatch "MSIE [2-6]" \
        nokeepalive ssl-unclean-shutdown \
        downgrade-1.0 force-response-1.0
    BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown
</VirtualHost>

我的/ etc / hosts包含..

127.0.0.1 linuxturnkeylamp
192.168.56.100  localdrupal.tripchi.com

按原样,https:// ...显示静态图像以及使用http://localdrupal.mydomain.com:443/image.png进行请求时。但是,在请求http://localdrupal.mydomain.com/image.png时,我得到....

错误请求

  

您的浏览器发送了此服务器无法理解的请求。   原因:您正在向支持SSL的服务器端口说明HTTP。   请使用HTTPS方案访问此URL。

如果我更改为SSLEngine off,则HTTPS显示SSL connection error,HTTP会显示图片。

我做错了什么?我的默认虚拟主机是否必须包含有关SSL的任何内容?它目前没有。

1 个答案:

答案 0 :(得分:0)

在443虚拟主机的项目目录规范中,问题似乎是AllowOverride None需要AllowOverride All