On httpd2.4, you must specify permissions to documentroot the directory, whether it is on a central host or a virtual host.
On httpd2.2, you do not need to specify.
Configure the HTTPS service in the httpd2.4 series:
Note: If you configure the HTTPS service with httpd2.4, use <Directory></Directory> to specify permissions for the site document directory in the ssl.conf configuration file. You do not have to specify Virtualhostname in the/etc/httpd/conf/httpd.conf configuration file.
<directory "/web/vhosts/pma" > OPtions none allowoverride None Require all denied Require IP 172.16.0.0/255.255.0.0</directory>
First step: install mod_ssl the module first.
[email protected] ~]# Yum install mod_ssl
Step two: in/etc/httpd/conf.d/ Directory to create the vhosts.conf configuration file, all of the virtual host's configuration files are written to the file.
<VirtualHost 172.16.125.128:80> DocumentRoot "/WEB/VHOSTS/PMA" ServerName pma.lcs.com ErrorLog /var/log/httpd/pmalog.err CustomLog /var/log/httpd/pmalog.access common <Directory "/WEB/VHOSTS/PMA" > OPtions None Allowoverride None Require all denied Require ip 172.16.0.0/255.255.0.0 </ Directory></virtualhost>
Step three: Configuration file for SSL service ( /etc/httpd/conf.d/ssl.conf ) changes.
documentroot "/WEB/VHOSTS/PMA" <Directory "/web/ VHOSTS/PMA "> OPtions None Allowoverride None Require all denied require ip 172.16.0.0/255.255.0.0 </Directory> ServerName pma.lcs.com:443 #指定https服务的服务器名称SSLCertificateFile /etc/httpd/ssl/pma.lcs.com.crt # Specify the certificate issued by the CA sslcertificatekeyfile /etc/httpd/ssl/httpd.key #指定自己主机密钥的位置
Step three: Restart the httpd service.
[Email protected] httpd]# service httpd restart
To configure the HTTPS service on the httpd2.2 series:
Note: in the address and port of the Namevirtualhost must be specified in the/etc/httpd/conf/httpd.conf configuration file. You do not have to specify permissions for the site document directory.
Let's say here isweb2.LCS.com To configure HTTPS.
First step: first comment out the central host in the/etc/httpd/conf/httpd.conf configuration file, then add the following:
Namevirtualhost 172.16.125.125:80<virtualhost 172.16.125.125:80> ServerName web2.lcs.com Doc Umentroot "/WEB/VHOST/WEB2" Errorlog/var/log/httpd/www2.err customlog/var/log/httpd/www2.access Common</virtualhost>
Step Two: The SSL service configuration file ( /etc/httpd/conf.d/ssl.conf ) is modified.
DocumentRoot "/WEB/VHOST/WEB2" ServerName web2.lcs.comsslcertificatefile/etc/httpd/ssl/ Web2.lcs.com.crtsslcertificatekeyfile/etc/httpd/ssl/httpd.key
Step three: Restart the httpd service.
This article is from "angry, bird" blog, please make sure to keep this source http://angrybird.blog.51cto.com/10503706/1704376
httpd2.2 and http2.4 configuration HTTPS differences