Linux under Apache HTTPS virtual host Configuration

Source: Internet
Author: User

If you simply want to encrypt the transmission at the time of data transfer, the SSL certificate does not need authentication, but the browser opens with a warning message. If we're not doing a public product, then it's okay.

For example, here is a note on learning today, in fact I use the real environment.

Environment:CentOS 64. 32bit. Apache 2.2.15;

1. Check if Apache has the mod_ssl.so module installed.

The check method is to see if it exists under modules(/etc/httpd/modules/). Does not exist then install (yum-y install mod_ssl).

2. Generate Certificates and keys

1) Generate key

Command: OpenSSL genrsa 1024x768 > Server.key

Description: Generate the key using the 128-bit RSA algorithm and get the Server.key file.

2) Generate a certificate request file

Command: OpenSSL req-new-key server.key > SERVER.CSR

Description: Generate a certificate request file SERVER.CSR with the key generated by step 1. This step will have a lot of problems, according to their own needs to input.

3): Generate certificate

Command: OpenSSL req-x509-days 365-key server.key-in SERVER.CSR > Server.crt

Description: Generate certificate SERVER.CRT with step-up key and certificate request. The-days reference indicates the certificate validity period, in days.

3. Change Apache configuration file (httpd.conf)

1) Add monitoring port

Listen 443

2) Load Mod_ssl module

LoadModule Ssl_module modules/mod_ssl.so

3) Configuring the virtual host

Namevirtualhost 121.127.246.429:443<virtualhost 121.127.246.429:443>documentroot/data/www/ 1234567ServerName 1234567.mo.comsslengine onssloptions +strictrequiresslcertificatefile/data/conf/httpd/ Server.crtsslcertificatekeyfile/data/conf/httpd/server.keydirectoryindex index.html index.php<Directory "/data /www/1234567 "> #Options Indexes followsymlinksoptions followsymlinksallowoverride noneorder allow,denyallow from All</directory></virtualhost>
4. Interview

Https://1234567.mo.com


Linux under Apache HTTPS virtual host Configuration

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.