如何在 Apache Web 服务器上实现 https

如何在 Apache Web 服务器上实现 https

谁能告诉我如何在 Apache 中配置 SSL。

我生成了一个虚拟证书用于测试,但我的虚拟主机文件配置不起作用。

谁能看出什么问题了吗?

我的虚拟主机文件:

   <IfDefine SSL>
   <VirtualHost mydomainname.com:443>
   ServerName www.mydmainnamw.com:8080
   DocumentRoot "C:/.../My Company/My Sites/johnbokma.com/site/web"
   #CustomLog logs/lc.johnbokma.com.access.log combined
   #ErrorLog logs/lc.johnbokma.com.error.log

   SSLEngine on
   SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
   SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key

   SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown
   CustomLog logs/ssl_request_log \
   "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"

   <Proxy balancer://Default>
        BalancerMember http://server1:8080/page-to-be-displayed retry=5
   </Proxy>
   ProxyPass /balancer-manager !
   ProxyPass / balancer://Default/
   </VirtualHost>
   <IfDefine SSL>

答案1

我目前将它用于我的 SVN 服务器,但这完全取决于您如何设置证书。

我按照Godaddy的指示这里

NameVirtualHost *:443
<virtualhost *:443>
ServerName svn.example.com
ServerAdmin webmaster@localhost
SSLEngine On
SSLCertificateFile /etc/apache2/certs/example.com.crt
SSLCertificateKeyFile /etc/apache2/certs/example.com.key
SSLCertificateChainFile /etc/apache2/certs/gd_bundle.crt

DocumentRoot /var/www/svn/
<Directory "/var/www/svn/">
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
</Directory>

ErrorLog /var/log/apache2/ssl-error.log
CustomLog /var/log/apache2/ssl-access.log combined
ServerSignature On
</virtualhost>

尝试在任何带有空格的内容周围添加双引号,我不擅长基于 Windows 的 vhost,但这似乎可能是一个问题。

SSLCertificateFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt 
SSLCertificateKeyFile C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key

尝试

SSLCertificateFile "C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.crt/server.crt" 
SSLCertificateKeyFile "C:/Program Files (x86)/ApacheSoftwareFoundation/conf/ssl.key/server.key"

相关内容