loyalxuan 发表于 2015-8-20 14:42:30

LAMP下添加支持openssl的主机

  1. 首先确保您的Apache服务器已经支持OpenSSL



NameVirtualHost *:443
<VirtualHost *:443>
ServerAdmin webmaster@localhost
ServerName webname.com:443
SSLEngine on
SSLCertificateFile "/etc/pki/tls/certs/localhost.crt"
SSLCertificateKeyFile "/etc/pki/tls/private/localhost.key"
DocumentRoot /data/www/webname
<Directory /data/www/webname>
Options FollowSymLinks Indexes
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
  2. 将http协议头网站301到https协议头



RewriteEngine On
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST_URI}
  
页: [1]
查看完整版本: LAMP下添加支持openssl的主机