老男人百科 > 百科 > 正文

linux下nginx配置ssl证书(linux配置基于ip地址的虚拟主机)

2023-04-26 19:06:54 阅读( 1782)

1.下载httpd软件,编译Apache:。

1.下载httpd软件,编译Apache:/configure ——enable-ssl(使之支持SSL)

make

make install

2.httpd.conf中把#Include conf/exta……vhosts.conf前的#去掉

在vhosts.conf中配置:

DocumentRoot:usr/local/w1

Server name: www.shnu1.cn.

Order denied, allowed

allow from all

(添加对网页的访问)

3.添加:

10.10.134.26 www.w1.com

10.10.134.26 www.w2.com

4.分别在文件夹w1和w2下创建w1.htm和w2.htm。

5.重启Apache:usr/local/Apache 2/bin/Apache cl 1重新启动

6.进入w1.com和w2.com在6。IE地址栏测试w1.htm和w2.htm。

7.生成证书

cd /usr/local/apache2/conf

openssl req -new -x509 -nodes -out server.crt -keyout server.key

httpd.conf中打开httpd-ssl.conf配置即可。

专题页