0

我已经为 ssl 设置了 apache。我可以浏览https://localhost

我想换成https://localhosz什么https://www.test.com

我的 httpd-ssl.conf:

SSLSessionCache "shmcb:C:/wamp/bin/apache/apache2.4.2/logsssl_scache(512000)"
SSLEngine on  
DocumentRoot "C:/wamp/www/TeamPass" 
ServerName localhos:443 
ErrorLog "C:/wamp/logs/mysecuresite_error_log" 
TransferLog "C:/wamp/logs/mysecuresite_access_log"
SSLCertificateFile "C:/wamp/OpenSSL/certs/webserver.cer" 
SSLCertificateKeyFile "C:/wamp/OpenSSL/certs/private.key"  

CustomLog "C:/wamp/logs/ssl_request_log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

我如何更改我的配置文件以便启动 apache,因为我尝试了一些使用 virtualhost 的配置,但是在进行更改后 wamp 不会启动。这是一个测试服务器,所以我没有 DNS 服务器,但编辑了我的主机文件。

我需要 C:/wamp/www/TeamPass 来收听 test.com:443,我可以将服务器名称更改为此 url,但我不确定这是否正确。我需要做什么才能使用 url https://pass.test.de,我需要使用 rewrite 模块吗

4

2 回答 2

1

对于 MS Windows,您可以修改位于 Apache 安装路径内的文件夹conf/extra/中的文件httpd-vhosts.conf,以包含下一个配置:

Listen 443
NameVirtualHost 127.0.0.1:443
<VirtualHost 127.0.0.1:443>
  ServerName www.test.com
  DocumentRoot "C:\wamp\www\TeamPass"
  <Directory "C:\wamp\www\TeamPass">
    AllowOverride All
    Allow from All
  </Directory>
  ErrorLog "C:\wamp\logs\mysecuresite_error_log"
  CustomLog "C:\wamp\logs\ssl_request_log" \ "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
  SSLEngine on
  SSLCertificateFile "C:\wamp\OpenSSL\certs\webserver.cer" 
  SSLCertificateKeyFile "C:\wamp\OpenSSL\certs\private.key" 
</VirtualHost>

然后,在文件C:\WINDOWS\system32\drivers\etc\hosts的末尾添加这一行:

127.0.0.1   www.test.com
于 2013-09-19T14:43:44.127 回答
0

将您的主机名更改为 www.test.com

edit or run the file hostname and the file hosts

sudo gksu gedit /etc/hostname  and add www.test.com

sudo gksu gedit /etc/hosts and add the line 127.0.0.1 www.test.com localhost 

in the virtualhoste use www.test.com instead of localhost.
于 2013-09-19T14:32:07.027 回答