当前位置: 首页 > news >正文

web网站搭建

网站需求:

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两人可以访问,其他用户不能访问。

[root@localhost ~]# vim /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.30.131 www.openlab.com[root@localhost ~]# vim /etc/nginx/conf.d/host.conf
server {listen       443 ssl http2;listen       [::]:443 ssl http2;server_name  www.openlab.com;root         /ssl;ssl_certificate "/etc/pki/nginx/openlab.crt";   ssl_certificate_key "/etc/pki/nginx/openlab.key";  ssl_session_cache shared:SSL:1m;ssl_session_timeout  10m;ssl_ciphers PROFILE=SYSTEM;ssl_prefer_server_ciphers on;
}
server{listen       80;server_name  www.openlab.com;root /www/openlab;location /student{alias /stu;auth_basic "请登录用户";auth_basic_user_file /etc/nginx/userfile;index index.html;}location /data{alias /data;index index.html;}location /money{alias /money;index index.html;}
}
[root@localhost ~]# mkdir /www/openlab 
[root@localhost ~]# echo "welcome to openlab!" > /www/openlab/index.html
[root@localhost ~]# mkdir /{stu,data,money} 
[root@localhost ~]# echo hello student > /stu/index.html
[root@localhost ~]# echo this is data > /data/index.html
[root@localhost ~]# echo money money money > /money/index.html
[root@localhost ~]# systemctl restart nginx[root@localhost ~]# dnf install httpd-tools -y  
[root@localhost ~]# touch /etc/nginx/userfile
[root@localhost ~]# htpasswd -c /etc/nginx/userfile song 
[root@localhost ~]# htpasswd  /etc/nginx/userfile tian[root@localhost ~]#mkdir /etc/pki/nginx
[root@localhost ~]#openssl  genrsa 2048 > /etc/pki/nginx/openlab.key
[root@localhost ~]#openssl  req -utf8 -new -key /etc/pki/nginx/openlab.key  -x509  -days 365 -out /etc/pki/nginx/openlab.crt
[root@localhost ~]#mkdir mkdir /ssl 
[root@localhost ~]#echo this is https  > /ssl/index.html
[root@localhost ~]# systemctl restart nginx

http://www.dtcms.com/a/583179.html

相关文章:

  • wordpress打开速度优化大师下载安装免费
  • 物联网平台网站开发做网站大公司有哪些
  • 湘潭简单的网站建设公司纯文字排版设计网站
  • SSM--MyBatis框架之缓存
  • 网站建设及相关流程做网站哪家好
  • 淮海中路街道网站建设无线网络优化
  • 做自主外贸网站和后台费用多少做自我介绍的网站的图片素材
  • 做淘宝优惠券网站要多少钱桂林到阳朔怎么走最方便
  • 黄浦网站建设做兼职哪个网站比较好
  • 三维空间圆的方程
  • 福州制作网站企业单页营销网站怎么做
  • 网站建设网店名字为什么网站不见了
  • 苏州比较大的网站公司淘宝客手机网站搭建
  • 这个网站最近运转怎么样?安全性怎么样? 另外建设银行的网银能在这里存取款吗?济南网站定制制作
  • 大型网站建设的价格广州本地门户网站
  • HTML学习标签、属性统计
  • 保定做公司网站的保洁公司做网站有什么作用
  • 12.线程(二)
  • 时延估计算法ETDGE的解析
  • 推广 电子商务网站建设做公司官网要服务器吗
  • 北京人力资源网站如何做好一个外贸进网站的编辑
  • 基于PyQt5的AI文档处理工具
  • 如何优化wordpress网站站长工具查询域名
  • GRPO中的梯度裁剪原理细节
  • seo在线网站诊断推推蛙网站备案对网站负责人的要求
  • wordpress网站重定向循环网站建设怎么样工作室
  • STM32串口发送时使用奇偶校验学习感悟——Even(偶校验)
  • 畅想网络网站建设推广wordpress文章顺序
  • 网络营销 网站识图
  • 国外网站做淘宝客北京朝阳区建设工作办公网站