企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持私有化部署方案 广告
1.安装mod_ssl ~~~ yum install -y mod_ssl ~~~ 安装完成后我们可以看到mod_ssl的配置文件/etc/httpd/conf.d/ssl.conf 2.申请证书,打开压缩包里面有个for apache的压缩包(实际上里面有很多,for各种服务器的压缩包),for apache这个压缩包打开是要密码的(在申请的时候会要你设置),输入密码打开后会有3个文件,分别是“1_root_bundle.crt”、"2_域名.crt"、"3_域名.key" 3.然后我们把这三个文件拷到/etc/httpd/conf/ssl/文件夹下,如果没有的话自己创建 mkdir /etc/httpd/conf/ssl(随意) 4. vim ssl.conf 找到 #DocumentRoot "/var/www/html/" #ServerName apache.iternalsoft.com:443 把前面的#号去掉 然后根据实际情况配置下面这3条语句 SSLCertficateFile /etc/httpd/conf/ssl/2_域名.crt SSLCertficateKeyFile /etc/httpd/conf/ssl/3_域名.key SSLCertficateChainFile /etc/httpd/conf/ssl/1_root_bundle.crt ![](https://box.kancloud.cn/2872131ca1c699b57049fd3426f3cead_588x513.png) 5.修改apache配置文件 vim httpd.conf ~~~ 添加mod_ssl.so模块 LoadModule ssl_module modules/mod_ssl.so ~~~ ~~~ <VirtualHost *:443> DocumentRoot "/home/admin/yzdd/public" ServerName admin.nineopen.com SSLEngine on SSLCertificateFile /etc/httpd/conf/ssl/yzdd/admin.nineopen.com.crt SSLCertificateKeyFile /etc/httpd/conf/ssl/yzdd/admin.nineopen.com.key <Directory "/home/admin/yzdd"> Header set Access-Control-Allow-Origin http://nineopen.com Header set Access-Control-Allow-Origin http://www.nineopen.com Header set Access-Control-Allow-Origin http://localhost:8080 Options FollowSymLinks Indexes Require all granted AllowOverride All </Directory> </VirtualHost> ~~~ 然后重启apache就行了 注意apache 不能监听443端口,比如:Listen 443