HTTPS----------How to configure Apache HTTPS access in a phpstudy environment and access HTTP to automatically jump to HTTPS

Source: Internet
Author: User

1, first in the httpd.conf inside modify several places

Find #LoadModule ssl_module modules/mod_ssl.so remove the front #

Include conf/vhosts.conf add a line below this line include conf/vhosts_ssl.conf and then go to conf folder inside Create vhosts_ssl.conf

2. Write in vhosts_ssl.conf

Listen 443
Sslstrictsnivhostcheck off
Sslciphersuite aesgcm:all:! Dh:! export:! rc4:+high:! medium:! Low:!anull:!enull
Sslprotocol All-sslv2-sslv3
<virtualhost *:443>
documentroot "D:\phpStudy\zhifu"
ServerName www.ceshi.com
Serveralias ceshi.com
<directory "D:\phpStudy\zhifu" >
Options followsymlinks execcgi
allowoverride All
Order Allow,deny
allow from all
Require All granted
</Directory>
Sslengine on
sslcertificatefile "D:\PHPSTUDY\APACHE\CONF\ZHENG\2_WWW.CESHI.COM.CRT"
sslcertificatekeyfile "D:\phpStudy\Apache\conf\zheng\3_www.ceshi.com.key"
sslcertificatechainfile "D:\PHPSTUDY\APACHE\CONF\ZHENG\1_ROOT_BUNDLE.CRT"
</VirtualHost>

3, the certificate is uploaded to the corresponding path of the configuration written above

4. Configure automatic jump in vhosts.conf

<virtualhost *:80>
documentroot "D:\phpStudy\zhifu"
ServerName www.ceshi.com
Serveralias ceshi.com
Rewriteengine on
rewriterule (. *) https://%{server_name}$1 [R]
<directory "D:\phpStudy\zhifu" >
Options followsymlinks execcgi
allowoverride All
Order Allow,deny
allow from all
Require All granted
</Directory>
</VirtualHost>

5, the above should pay attention, I write the Ceshi place, all must change to own

HTTPS----------How to configure Apache HTTPS access in a phpstudy environment and access HTTP to automatically jump to HTTPS

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.