Configure HTTPS access host and bind access port number under CentOS

Source: Internet
Author: User
Tags install openssl openssl x509

System Environment:Linux:centos Release 6.5 (Final)

LAMP


Steps
1.lamp turn on SSL
# yum Install OpenSSL mod_ssl-y # installs OpenSSL and Apache SSL modules


2. Method of certificate Generation
# OpenSSL Genrsa-des3-out server.key 1024 # Generate server private key

# OpenSSL Req-new-key server.key-out SERVER.CSR # Generate a server certificate request and fill in the relevant certificate information as required

# OpenSSL x509-req-days 700-in server.csr-signkey server.key-out Server.cert # Visa

#/etc/init.d/mysqld Restart # restart Apache


3. Configure the virtual host file
# vim/etc/httpd/conf/httpd.conf

Add the following content:
Listen 5123<virtualhost *:5123>   ServerName  localhost.localdomain   documentroot/etc/httpd/conf/   Sslengine   on Sslcertificatefile "/etc/httpd/conf/server.cert"   sslcertificatekeyfile "/etc/httpd/conf/server.key" </ Virtualhost>


# semanage Port-a-T http_port_t-p TCP 5123 # Add new end for HTTP service 5123

# semanage Port-a-T http_port_t-p TCP 443 # Add new end for HTTP service 443

#/sbin/iptables-i input-p TCP--dport 5123-j ACCEPT # Adds a new end to the HTTP service 5123

#/sbin/iptables-i input-p TCP--dport 443-j ACCEPT # Adds a new end to the HTTP service 443

#/etc/init.d/mysqld Restart # restart Apache


installation steps for 4.semanage
# yum Provides/usr/sbin/semanage

# yum-y Install Policycoreutils-python

# Semanage Port-l | grep http # validation

Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced. http://blog.csdn.net/lemon_tree12138

Configure HTTPS access host and bind access port number under CentOS

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.