How do I use https (SSL) in XAMPP while using virtual hosts

后端 未结 4 1615
清酒与你
清酒与你 2020-12-02 05:45

I am writing a php app on my local machine and would like to test to see if SSL is working. Bear with me because this is the first time I\'ve ever used SSL.

So far t

4条回答
  •  爱一瞬间的悲伤
    2020-12-02 06:21

    This may be an old question, but i am putting my answer here anyway for future reference

    i'm Using XAMPP 3.2.1, Compiled May,7 2013

    to enable VirtualHost with SSL at the same time here is what i did. (I'm using windows 7)

    1. your windows HOST file must already be setup
    2. Go to httpd-ssl.conf located at xampp\apache\conf\extra

    I just copied the _default_ virtualhost and added my config. I removed all comments for shorter one and pasted this just below the default virtualHost just change the DocumentRoot and servername then Restart apache.

    
        DocumentRoot "***path/to/your/project}***"
        ServerName ***yourdomain***
        ServerAdmin admin@example.com
        ErrorLog "C:/xampp/apache/logs/error.log"
        TransferLog "C:/xampp/apache/logs/access.log"
        SSLEngine on
        SSLCertificateFile "conf/ssl.crt/server.crt"
        SSLCertificateKeyFile "conf/ssl.key/server.key"
    
        
            SSLOptions +StdEnvVars
        
        
            SSLOptions +StdEnvVars
        
    
        BrowserMatch "MSIE [2-5]" \
                 nokeepalive ssl-unclean-shutdown \
                 downgrade-1.0 force-response-1.0
    
        CustomLog "C:/xampp/apache/logs/ssl_request.log" \
                  "%t %h %{SSL_PROTOCOL}x %{SSL_CIPHER}x \"%r\" %b"
    
    

提交回复
热议问题