美文网首页
apache 安装SSL证书相关

apache 安装SSL证书相关

作者: 无限期_1c3f | 来源:发表于2019-11-05 10:22 被阅读0次

1、在apache的配置文件httpd.conf里最后一行添加:

IncludeOptional /www/server/panel/vhost/apache/*.conf

2、添加/www/server/panel/vhost/apache/www.xxx.com.conf

<VirtualHost *:80>

    ServerAdmin webmaster@example.com

    DocumentRoot "/www/wwwroot/xiaochengxu"

    ServerName 81d06989. www.xxx.com

    ServerAlias xcx.nmpfit.com

    errorDocument 404 /404.html

    ErrorLog "/www/wwwlogs/ www.xxx.com -error_log"

    CustomLog "/www/wwwlogs/ www.xxx.com -access_log" combined

    #HTTP_TO_HTTPS_START

    <IfModule mod_rewrite.c>

        RewriteEngine on

        RewriteCond %{SERVER_PORT} !^443$

        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]

    </IfModule>

    #HTTP_TO_HTTPS_END

    #HTTP_TO_HTTPS_START

    <IfModule mod_rewrite.c>

        RewriteEngine on

        RewriteCond %{SERVER_PORT} !^443$

        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]

    </IfModule>

    #HTTP_TO_HTTPS_END

    #HTTP_TO_HTTPS_START

    <IfModule mod_rewrite.c>

        RewriteEngine on

        RewriteCond %{SERVER_PORT} !^443$

        RewriteRule (.*) https://%{SERVER_NAME}$1 [L,R=301]

    </IfModule>

    #HTTP_TO_HTTPS_END

    #DENY FILES

    <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>

      Order allow,deny

      Deny from all

    </Files>

    #PHP

    <FilesMatch \.php$>

            SetHandler "proxy:unix:/tmp/php-cgi-56.sock|fcgi://localhost"

    </FilesMatch>

    #PATH

    <Directory "/www/wwwroot/xiaochengxu">

        SetOutputFilter DEFLATE

        Options FollowSymLinks

        AllowOverride All

        Require all granted

        DirectoryIndex index.php index.html index.htm default.php default.html default.htm

    </Directory>

</VirtualHost>

<VirtualHost *:443>

    ServerAdmin webmasterexample.com

    DocumentRoot "/www/wwwroot/xiaochengxu/"

    ServerName SSL. www.xxx.com

    ServerAlias www.xxx.com

    errorDocument 404 /404.html

    ErrorLog "/www/wwwlogs/ www.xxx.com -error_log"

    CustomLog "/www/wwwlogs/ www.xxx.com -access_log" combined

    #SSL

    SSLEngine On

    #SSLCertificateFile /etc/letsencrypt/live/ www.xxx.com /fullchain.pem

    #SSLCertificateKeyFile /etc/letsencrypt/live/ www.xxx.com /privkey.pem

    SSLCertificateFile /etc/letsencrypt/live/ www.xxx.com /server_public.crt

    SSLCertificateKeyFile /etc/letsencrypt/live/ www.xxx.com /server.key

    SSLCertificateChainFile /etc/letsencrypt/live/ www.xxx.com /server_chain.crt

    SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH

    SSLProtocol All -SSLv2 -SSLv3

    SSLHonorCipherOrder On

    #PHP

    <FilesMatch \.php$>

            SetHandler "proxy:unix:/tmp/php-cgi-56.sock|fcgi://localhost"

    </FilesMatch>

    #DENY FILES

    <Files ~ (\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)$>

      Order allow,deny

      Deny from all

    </Files>

    #PATH

    <Directory "/www/wwwroot/xiaochengxu/">

        SetOutputFilter DEFLATE

        Options FollowSymLinks

        AllowOverride All

        Require all granted

        DirectoryIndex index.php index.html index.htm default.php default.html default.htm

    </Directory>

</VirtualHost>

3、把下载下来的证书文件放到 /etc/letsencrypt/live/www.xxx.com/里,然后重启apache就行了

相关文章

  • apache 安装SSL证书相关

    1、在apache的配置文件httpd.conf里最后一行添加: IncludeOptional /www/ser...

  • https 免费申请和安装

    centos 安装apache + ssl证书 免费证书申请和安装 申请证书 去阿里云平台找证书管理然后证书购买 ...

  • Httpd配置CA证书

    apache httpd配置ssl证书部分记录证书生成相关请参考此链接

  • Universal Links链接跳转APP

    需要域名配置ssl证书,apache配置ssl证书,ssl证书我用的阿里云免费的 apache配置文件(vim /...

  • Apache 配置https

    安装证书模块 查看apache已安装了哪些模块 编辑apache配置文件/etc/httpd/conf.d/ssl...

  • Apache SSL证书安装

    接收证书 证书私钥:一般在申请证书,需要事先生成私钥文件。一般命名为server.key 证书文件:一般扩展名为....

  • CentOS https配置

    1.向证书机构申请https证书,会得到证书和私钥 2.安装apache的mod_ssl.so模块 yum -y ...

  • certbot免费ssl证书

    一、安装certbot客户端 二、生成证书 三、查看生成的证书 四、apache配置文件 httpd-ssl.co...

  • Apache配置https

    Apache Apache命令 Apache开启https SSL生成证书:步骤1:生成密钥 步骤2: 生成证书请...

  • CentOS7下 apache配置SSL证书

    首先要已经安装了Apache,并且已经设置好网站的绑定配置。 接下来介绍一下配置SSL证书的方法。 安装SSL模块...

网友评论

      本文标题:apache 安装SSL证书相关

      本文链接:https://www.haomeiwen.com/subject/ovpdbctx.html