wampserver2.2 ssl – 如何使http和https工作

我遵循这个教程安装SSL http://guides.jlbn.net/setssl/setssl1.html

我设置为localhost

configuration完成后,我可以访问HTTPS( https:// localhost/ ),但是当我想访问HTTP (http:// localhost/ )时,

它显示

错误的请求

您的浏览器发送了此服务器无法理解的请求。 原因:您正在向使用SSL的服务器端口说纯HTTP。 请使用HTTPSscheme访问此URL。 提示:https:// localhost /

我如何使HTTP和HTTPS工作?

我阅读SSL – 如何使http和https工作,我也将虚拟主机80和443添加到httpd.conf。 但没有运气。

请帮忙。 谢谢

-httpd.conf(相关) –

 LoadModule ssl_module modules/mod_ssl.so ServerName localhost:80 DocumentRoot "c:/wamp/www/" <Directory "c:/wamp/www/"> Options Indexes FollowSymLinks AllowOverride all Order Deny,Allow Allow from all </Directory> NameVirtualHost * <VirtualHost *:80> ServerName localhost DocumentRoot "c:/wamp/www" </VirtualHost> 

-httpd-ssl.conf(相关) –

 Listen 443 <VirtualHost _default_:443> DocumentRoot "C:/wamp/www/ssl" ServerName localhost ServerAdmin admin@localhost ErrorLog "C:/wamp/bin/Apache/apache2.2.21/conf/ssl/logs/ssl_error.log" TransferLog "C:/wamp/bin/Apache/apache2.2.21/conf/ssl/logs/ssl_access.log" SSLEngine on SSLCipherSuite ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP:+eNULL SSLCertificateFile "C:/wamp/bin/Apache/apache2.2.21/conf/ssl/localhost.crt" SSLCertificateKeyFile "C:/wamp/bin/Apache/apache2.2.21/conf/ssl/localhost.key" #SSLCertificateChainFile "c:/Apache2/conf/server-ca.crt" #SSLCACertificatePath "c:/Apache2/conf/ssl.crt" #SSLCACertificateFile "c:/Apache2/conf/ssl.crt/ca-bundle.crt" #SSLCARevocationPath "c:/Apache2/conf/ssl.crl" #SSLCARevocationFile "c:/Apache2/conf/ssl.crl/ca-bundle.crl" #SSLVerifyClient require #SSLVerifyDepth 10 #SSLOptions +FakeBasicAuth +ExportCertData +StrictRequire <FilesMatch "\.(cgi|shtml|phtml|php)$"> SSLOptions +StdEnvVars </FilesMatch> <Directory "C:/wamp/www/ssl"> SSLOptions +StdEnvVars Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> BrowserMatch ".*MSIE.*" \ nokeepalive ssl-unclean-shutdown \ downgrade-1.0 force-response-1.0 CustomLog "C:/wamp/logs/ssl_request.log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b" </VirtualHost> 

天哪…我发现问题了。

这发生在httpd.conf以前我只是运行端口80(HTTP)我的httpd.conf只需input

 NameVirtualHost * 

它必须像这样进入

 NameVirtualHost *:80 

该端口需要具体。

之后,我的WAMP服务器就像一个魅力!