尧图建网站 尧图建网站 YAOTU WEB BUILD 免费咨询
ARTICLE DETAIL

资讯详情

深耕网站建设与建站编程的一线实战洞察。

基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!

基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!! 网站需求1.基于域名www.openlab.com可以访问网站内容为 welcome to openlab!!!2.给该公司创建三个子界面分别显示学生信息教学资料和缴费网站基于www.openlab.com/student 网站访问学生信息www.openlab.com/data网站访问教学资料www.openlab.com/money网站访问缴费网站。3.要求 1访问该网站http请求都通过https响应。2学生信息网站只有song和tian两人可以访问其他用户不能访问。配置.conf文件vim /etc/nginx/nginx.confserver {listen 80;server_name www.openlab.com;root /www/openlab;}配置映射关系vim /etc/hosts192.168.155.131 www.openlab.com关闭防火墙创建子网站www.openlab.com www.openlab.com/data www.openlab.com/student www.openlab.com/money配置文件配置datavim /etc/nginx/nginx.conflocation /data {alias /www/openlab/data;index index.html index.htm;}配置studentvim /etc/nginx/nginx.conflocation /student {alias /www/openlab/student;index index.html index.htm;auth_basic Please input password;auth_basic_user_file /www/openlab/student/passwd;}学生信息网站只有song和tian两人可以访问useradd songpasswd songuseradd tianpasswd tianhtpasswd -c /www/openlab/student/passwd songhtpasswd /www/openlab/student/passwd tian配置moneyvim /etc/nginx/nginx.confserver {listen 443 ssl http2;server_name www.openlab.com;location /money { #子目录alias /www/openlab/money;index index.html index.htm;}ssl_certificate /www/openlab/money/money.crt;ssl_certificate_key /www/openlab/money/money.key.org;}私钥openssl genrsa -aes128 2048 /www/openlab/money/money.key证书openssl req -utf8 -new -key /www/openlab/money/money.key -x509 -days 365 -out /www/openlab/money/money.crt去除私钥cp /www/openlab/money/money.key /www/openlab/money/money.key.orgopenssl rsa -in /www/openlab/money/money.key -out /www/openlab/money/money.key.org测试
返回列表