需要在httpd.conf中添加以及开启mod_ssl模块

1
2
Listen 443
LoadModule ssl_module modules/mod_ssl.so

修改vhost.conf文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<VirtualHost *:80 *:443>
DocumentRoot "/webapps/zabbix"
ServerName www.server.com
ServerAlias jp130.com

#域名重定向
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.server.com$
RewriteRule ^/(.*)$ https://jp130.com/$1 [R=301,L]
#RewriteEngine on
#RewriteCond %{SERVER_PORT} !^443$
#RewriteRule ^(.*)?$ https://%{SERVER_NAME}$1 [L,R]

#https
SSLEngine on
SSLCompression off
SSLProtocol all -SSLv2 -SSLv3
SSLCipherSuite ECDH:AESGCM:HIGH:!DH:!RC4:!aNULL:!eNULL
SSLCertificateFile /usr/local/ssl/jp130.com.crt
SSLCertificateKeyFile /usr/local/ssl/jp130.key
#SSLCertificateChainFile /usr/local/ssl/root_bundle.crt

#日志
CustomLog "logs/access.log" combined
ErrorLog "logs/error.log"
<Directory "/webapps/zabbix">
Options FollowSymLinks
Require all granted
DirectoryIndex index.php index.html
</Directory>

</VirtualHost>