Use Apache to build HTTPS site details

Source: Internet
Author: User

Environment:

System: centos6.5

Kernel version: 2.6.32-431.el6.i686

Apache (replace with httpd) version: httpd-2.2.15-39.el6.centos.i686

Virtual machine: 10.0.4 build-2249910

http_server_ip=192.168.1.10

OpenSSL version: openssl-1.0.1e-15.el6.i686

Test Domain name: www.jingjun.com

Mod_ssl version: mod_ssl-2.2.15-39.el6.centos.i686


Building HTTPS requires a CA certificate, so build the CA certificate first:

First, provide the CA private key:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/1B/wKiom1U_u3bjP-LaAADbG0wfy-A343.jpg "title=" 1.jpg " alt= "Wkiom1u_u3bjp-laaadbg0wfy-a343.jpg"/>

Second, the generation of CA self-visa book:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/17/wKioL1U_vaDS_8_sAAJboQ3tQGk491.jpg "title=" 2.jpg " alt= "Wkiol1u_vads_8_saajboq3tqgk491.jpg"/>

Third, create the serial and Index.txt files in the CA directory, and Echo "01" to the serial file as the initial value

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/17/wKioL1U_vjnjDKbMAABI6wf0Mq0058.jpg "title=" 3.jpg " alt= "Wkiol1u_vjnjdkbmaabi6wf0mq0058.jpg"/>

Four, modify the httpd master configuration file.

Vim/etc/httpd/conf/httpd.conf

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/6C/1B/wKiom1U_vkTwWzhLAACREQOZ_2s580.jpg "title=" Note the home directory file. jpg "alt=" wkiom1u_vktwwzhlaacreqoz_2s580.jpg "/>

Comment out the home directory parameter


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/1B/wKiom1U_wWDj6oGSAABCRX9Tqvg516.jpg "title=" 22.jpg "alt=" Wkiom1u_wwdj6ogsaabcrx9tqvg516.jpg "/>

Turn on virtual host monitoring


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/17/wKioL1U_wtbxQnWEAABNQPyeQx0030.jpg "title=" 23.jpg "alt=" Wkiol1u_wtbxqnweaabnqpyeqx0030.jpg "/>

Add a new virtual host configuration.


Create the Virtual host directory and create the index.html file.

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/17/wKioL1U_wFmCDVvHAABj-Zzd0rg059.jpg "title=" 6.jpg " alt= "Wkiol1u_wfmcdvvhaabj-zzd0rg059.jpg"/>

Six, test:

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/17/wKioL1U_xIKQaVz-AAMR2kJ_scg954.jpg "title=" 9.jpg " alt= "Wkiol1u_xikqavz-aamr2kj_scg954.jpg"/>

Browser test: Please add parse entry in C:\windows\system32\drivers\etc\hosts file beforehand

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/1C/wKiom1U_xJDSpz1_AACJjplO5gA501.jpg "title=" 11.jpg "alt=" Wkiom1u_xjdspz1_aacjjplo5ga501.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/1C/wKiom1U_xCzy5zPgAABgiwEOsKI461.jpg "title=" 10.jpg "alt=" Wkiom1u_xczy5zpgaabgiweoski461.jpg "/>

The HTTP service is now enabled as expected.


Seven. Generate CA certificate for HTTPS server

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/1C/wKiom1U_xcGilr69AAL3-wa8TfY787.jpg "title=" 12.jpg "alt=" Wkiom1u_xcgilr69aal3-wa8tfy787.jpg "/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/1C/wKiom1U_ycCCPaysAAK6jynDNI8798.jpg "title=" 31.jpg "alt=" Wkiom1u_ycccpaysaak6jyndni8798.jpg "/>


Viii. Edit the SSL configuration file

Vim/etc/httpd/conf.d/ssl.conf

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6C/1C/wKiom1U_zgah3tKpAACyv-Z4nQw369.jpg "title=" 61.jpg "alt=" Wkiom1u_zgah3tkpaacyv-z4nqw369.jpg "/>


650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6C/1C/wKiom1U_ym3i-7pAAAFZO200Srk457.jpg "title=" 41.jpg "alt=" Wkiom1u_ym3i-7paaafzo200srk457.jpg "/>


Nine. Test the httpd configuration again for errors and see if TCP 443 ports are in listening state

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/1C/wKiom1U_y1WStUVHAAIre2wqejI559.jpg "title=" 51.jpg "alt=" Wkiom1u_y1wstuvhaaire2wqeji559.jpg "/>


Ten, the CA certificate is imported to the test host, this example is Xshell to Win7. Rename Cacert.pem to Cacert.crt

Install import to operating system, open Google Chrome test

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M00/6C/1C/wKiom1U_zyfTMifaAAF-cQSGnoo546.jpg "title=" 71.jpg "alt=" Wkiom1u_zyftmifaaaf-cqsgnoo546.jpg "/>





This article is from "The Blood of the Linux blog" blog, please be sure to keep this source http://xuezhonghua.blog.51cto.com/10167373/1640135

Use Apache to build HTTPS site details

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.