题目:
1.web服务器的主机ip:192.168.78.128
2.web服务器的默认访问目录为/var/www/html
默认发布内容为default‘s page
3.站点news.timinglee.org默认发布目录
为/var/www/virtual/timinglee.org/news
默认发布内容为 news.timinglee.org
4.站点login.timinglee.org在被访问时必须强制走加密协议,其默认
发布目录为/var/www/virtual/timinglee.org/login
默认发布内容为login.timinglee.org
1、安装Nginx
[root@ceph01 ~]# yum install nginx -y
2、修改配置文件的默认访问路径
[root@ceph01 nginx]# vim /etc/nginx/nginx.conf
3、创建目录,并写入内容
[root@ceph01 nginx]# mkdir -p /var/www/html # -p(逐级创建目录)
[root@ceph01 nginx]# echo "default‘s page" > /var/www/html/index.html
4、添加站点news.timinglee.org
[root@ceph01 nginx]# vim /etc/hosts
在原先(/etc/nginx/nginx.conf)http模块里面在添加一个server
[root@ceph01 nginx]# vim /etc/nginx/nginx.conf
创建目录,并写入内容
[root@ceph01 nginx]# mkdir -p /var/www/virtual/timinglee.org/news
5、语法检测,并重启nginx服务
[root@ceph01 nginx]# nginx -t
[root@ceph01 nginx]# systemctl restart nginx.service
6、生成密钥
[root@ceph01 ~]# openssl genrsa -des3 -out server.zq 2048 (密码1234)
7、生成证书
[root@ceph01 ~]# openssl req -new -key server.zq -out server.crt
Enter pass phrase for server.zq:
You are about to be asked to enter information that will be incorporated
into your certificate request.
What you are about to enter is what is called a Distinguished Name or a DN.
There are quite a few fields but you can leave some blank
For some fields there will be a default value,
If you enter '.', the field will be left blank.
-----
Country Name (2 letter code) [AU]:CN
State or Province Name (full name) [Some-State]:SN
Locality Name (eg, city) []:XI'AN
Organization Name (eg, company) [Internet Widgits Pty Ltd]:YOOZOO
Organizational Unit Name (eg, section) []:SRE
Common Name (e.g. server FQDN or YOUR name) []:SERVER
Email Address []:[email protected]
Please enter the following 'extra' attributes
to be sent with your certificate request
A challenge password []:1234
An optional company name []:zq
最后,和上面操作一样!!!