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

江苏宏澄建设有限公司网站网页设计期末作品源代码

江苏宏澄建设有限公司网站,网页设计期末作品源代码,中山大兴网站建设,百度搜索引擎排名文章目录 1. 静态文件配置2. nginx listen 命令解析3. nginx server_name 命令解析4. nginx server 端口重复5. nginx location 命令 1. 静态文件配置 在 /home 文件下配置一个静态的AdminLTE后台管理系统#xff1a; [rootnginx-dev conf.d]# cd /home [rootnginx-dev home… 文章目录 1. 静态文件配置2. nginx listen 命令解析3. nginx server_name 命令解析4. nginx server 端口重复5. nginx location 命令 1. 静态文件配置 在 /home 文件下配置一个静态的AdminLTE后台管理系统 [rootnginx-dev conf.d]# cd /home [rootnginx-dev home]# ls AdminLTE-3.2.0 apache-tomcat-8.5.81 apps sql [rootnginx-dev home]# cd AdminLTE-3.2.0/ [rootnginx-dev AdminLTE-3.2.0]# ll total 1412 drwxr-xr-x. 6 root root 53 Feb 8 2022 build -rwxr-xr-x. 1 root root 3173 Feb 8 2022 CODE_OF_CONDUCT.md -rwxr-xr-x. 1 root root 469 Feb 8 2022 composer.json drwxr-xr-x. 5 root root 38 Feb 8 2022 dist -rwxr-xr-x. 1 root root 169 Feb 8 2022 docker-compose.yml -rwxr-xr-x. 1 root root 171 Feb 8 2022 Dockerfile drwxr-xr-x. 7 root root 4096 Feb 8 2022 docs -rwxr-xr-x. 1 root root 31161 Feb 8 2022 iframe-dark.html -rwxr-xr-x. 1 root root 31521 Feb 8 2022 iframe.html -rwxr-xr-x. 1 root root 72974 Feb 8 2022 index2.html -rwxr-xr-x. 1 root root 43689 Feb 8 2022 index3.html -rwxr-xr-x. 1 root root 61756 Feb 8 2022 index.html -rwxr-xr-x. 1 root root 1082 Feb 8 2022 LICENSE -rwxr-xr-x. 1 root root 6778 Feb 8 2022 package.json -rwxr-xr-x. 1 root root 1134163 Feb 8 2022 package-lock.json drwxr-xr-x. 10 root root 196 Feb 8 2022 pages drwxr-xr-x. 62 root root 4096 Feb 8 2022 plugins -rwxr-xr-x. 1 root root 6716 Feb 8 2022 README.md -rwxr-xr-x. 1 root root 13336 Feb 8 2022 starter.html① 下面将其配置成一个web服务nginx 配置文件位于 /etc/nginx/nginx.conf 中其中 include 命令会引用 /etc/nginx/conf.d 目录下所有的 .conf 文件因次可以在conf.d文件下新建一个配置文件 8000.conf [rootnginx-dev home]# cd /etc/nginx/conf.d/ [rootnginx-dev conf.d]# ls admin-8000.conf default.conf [rootnginx-dev conf.d]# vi 8000.conf [rootnginx-dev conf.d]# nginx -s reload其中 8000.conf 配置文件的内容为 server{listen 8000;server_name localhost;location / {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} }它监听本地的 8000 端口并将所有请求都定向到 /home/AdminLTE-3.2.0 目录下的文件。如果请求的 URL 路径是 /则会尝试返回 index.html、index2.html 或 index3.html 中的一个作为响应。这个配置文件的作用是将本地的 AdminLTE-3.2.0 网页项目部署到 Nginx 服务器上以便通过浏览器访问。 ② 在浏览器访问8000端口http://192.168.1.9:8000/ 2. nginx listen 命令解析 nginx 是一款高性能的 Web 服务器和反向代理服务器listen 是 nginx 配置文件中用于指定监听地址和端口的指令。 listen 指令的语法如下 listen address[:port] [parameters];其中address 表示要监听的 IP 地址可以是一个具体的 IP 地址也可以是一个通配符如 * 表示监听所有可用的 IP 地址。port 表示要监听的端口号如果不指定则默认为 80。 listen 指令还可以带有一些可选的参数如下所示 ① default_server指定该监听地址和端口为默认服务器当客户端请求的域名在 nginx 中没有匹配的虚拟主机时会使用该默认服务器处理请求。 ② ssl指定该监听地址和端口使用 SSL/TLS 加密协议进行通信。 ③ http2指定该监听地址和端口使用 HTTP/2 协议进行通信。 ④ reuseport启用 SO_REUSEPORT 选项允许多个进程或线程同时监听同一个地址和端口提高并发处理能力。 例如以下配置指定 nginx 监听 192.168.1.100 的 80 端口并启用 default_server 参数 listen 192.168.1.100:80 default_server;监听可以配置成IP或端口或IP端口 : listen 127.0.0.1:8000; 指定Nginx监听127.0.0.1的8000端口。 listen 127.0.0.1; 指定Nginx监听127.0.0.1的80端口因为端口号未指定默认为80。 listen 8000; 指定Nginx监听所有可用IP地址的8000端口。 listen *:8000; 指定Nginx监听所有可用IP地址的8000端口。 listen localhost:8000; 指定Nginx监听本地主机名localhost的8000端口。3. nginx server_name 命令解析 server_name 是 Nginx 配置文件中用于指定虚拟主机的域名或 IP 地址的指令。它用于告诉 Nginx 哪些请求应该被转发到该虚拟主机主要用于区分可以随便起。也可以使用变量$hostname配置成主机名。 server_name 指令可以在 http、server 和 location 块中使用。在 http 块中使用 server_name 指令可以设置默认的虚拟主机而在 server 块中使用 server_name 指令可以设置特定的虚拟主机。 server_name 指令可以指定一个或多个域名或 IP 地址多个域名或 IP 地址之间用空格或逗号分隔。例如 server {listen 80;server_name example.com www.example.com;... }或者配置成域名example.org www.example.org *.example.org 上面的配置指定了两个域名 example.com 和 www.example.com当请求的主机名为这两个域名之一时Nginx 将会将请求转发到该虚拟主机。 4. nginx server 端口重复 如果多个server的端口重复那么根据域名或者主机名去匹配 server_name 进行选择。 ① 查看 /etc/nginx/conf.d 目录下的 default.conf 文件可以看到配置文件监听80端口服务器名为localhost [rootnginx-dev conf.d]# cat /etc/nginx/conf.d/default.conf server {listen 80;server_name localhost;location / {root /usr/share/nginx/html;index index.html index.htm;}error_page 500 502 503 504 /50x.html;location /50x.html {root /usr/share/nginx/html;} }② 修改 /etc/nginx/conf.d 目录下的 8000.conf 文件将监听端口页修改为80重启 nginx 会提醒 conflicting server name “localhost” on 0.0.0.0:80, ignored [rootnginx-dev conf.d]# vi /etc/nginx/conf.d/8000.conf server{listen 80;server_name localhost;location / {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} } [rootnginx-dev conf.d]# nginx -s reload nginx: [warn] conflicting server name localhost on 0.0.0.0:80, ignored③ 重新修改 /etc/nginx/conf.d 目录下的 8000.conf 文件将 server_name 修改为 nginx-dev [rootnginx-dev conf.d]# vi /etc/nginx/conf.d/8000.conf server{listen 80;server_name nginx-dev;location / {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} }④ 如果访问 curl http://localhost:80那么响应的是 /usr/share/nginx/html 目录下的首页文件 # [rootnginx-dev conf.d]# curl localhost:80 会访问这个 server {listen 80;server_name localhost;location / {root /usr/share/nginx/html;index index.html index.htm;} }⑤ 如果访问 curl http://nginx-dev:80那么响应的是 /home/AdminLTE-3.2.0 目录下的首页文件 # [rootnginx-dev html]# curl http://nginx-dev:80 会访问这个 server{listen 80;server_name nginx-dev;#主机名location / {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} }5. nginx location 命令 /请求指向 root 目录location 总是从/目录开始匹配如果有子目录例如/css他会指向/static/css location /css {root /static; }① 修改 /etc/nginx/conf.d 目录下的 8000.conf 文件 [rootnginx-dev html]# nginx -s reload [rootnginx-dev html]# cat /etc/nginx/conf.d/8000.conf server{listen 8000;server_name localhost;location /admin {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} }/请求总是指向 root 目录/admin 目录则指向的是root目录下的admin目录即为 /home/AdminLTE-3.2.0/admin。 在浏览器访问 http://192.168.1.9:8000/admin 报错404 查看nginx错误日志 [rootnginx-dev nginx]# tail -f /var/log/nginx/*.log/var/log/nginx/access.log 192.168.1.10 - - [06/Aug/2023:22:40:38 0800] GET /dist/img/user1-128x128.jpg HTTP/1.1 200 2750 http://192.168.1.9:8000/ Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:22:40:38 0800] GET /plugins/fontawesome-free/webfonts/fa-solid-900.woff2 HTTP/1.1 200 78268 http://192.168.1.9:8000/plugins/fontawesome-free/css/all.min.css Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:22:40:38 0800] GET /plugins/fontawesome-free/webfonts/fa-regular-400.woff2 HTTP/1.1 200 13224 http://192.168.1.9:8000/plugins/fontawesome-free/css/all.min.css Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 127.0.0.1 - - [06/Aug/2023:22:59:36 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 127.0.0.1 - - [06/Aug/2023:23:01:16 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:01:58 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:02:46 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:03:43 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 127.0.0.1 - - [06/Aug/2023:23:03:52 0800] GET / HTTP/1.1 200 615 - curl/7.29.0 - 192.168.1.10 - - [06/Aug/2023:23:15:09 0800] GET /admin HTTP/1.1 404 153 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - /var/log/nginx/error.log 2023/08/06 23:14:21 [notice] 3869#3869: exit 2023/08/06 23:14:21 [notice] 3870#3870: exiting 2023/08/06 23:14:21 [notice] 3870#3870: exit 2023/08/06 23:14:21 [notice] 2483#2483: signal 17 (SIGCHLD) received from 3869 2023/08/06 23:14:21 [notice] 2483#2483: worker process 3869 exited with code 0 2023/08/06 23:14:21 [notice] 2483#2483: signal 29 (SIGIO) received 2023/08/06 23:14:21 [notice] 2483#2483: signal 17 (SIGCHLD) received from 3870 2023/08/06 23:14:21 [notice] 2483#2483: worker process 3870 exited with code 0 2023/08/06 23:14:21 [notice] 2483#2483: signal 29 (SIGIO) received 2023/08/06 23:15:09 [error] 3897#3897: *26 open() /home/AdminLTE-3.2.0/admin failed (2: No such file or directory), client: 192.168.1.10, server: localhost, request: GET /admin HTTP/1.1, host: 192.168.1.9:8000可以看到报错信息为 /home/AdminLTE-3.2.0/admin 这个目录不存在。 ② 修改 /etc/nginx/conf.d 目录下的 8000.conf 文件 [rootnginx-dev nginx]# cat /etc/nginx/conf.d/8000.conf server{listen 8000;server_name localhost;location / {root /home/AdminLTE-3.2.0;index index.html index2.html index3.html;} }在浏览器访问 http://192.168.1.9:8000/a。同样报错404 查看nginx错误日志 [rootnginx-dev nginx]# tail -f /var/log/nginx/*.log/var/log/nginx/access.log 127.0.0.1 - - [06/Aug/2023:23:01:16 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:01:58 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:02:46 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 192.168.1.9 - - [06/Aug/2023:23:03:43 0800] GET / HTTP/1.1 200 61756 - curl/7.29.0 - 127.0.0.1 - - [06/Aug/2023:23:03:52 0800] GET / HTTP/1.1 200 615 - curl/7.29.0 - 192.168.1.10 - - [06/Aug/2023:23:15:09 0800] GET /admin HTTP/1.1 404 153 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:23:19:48 0800] GET /admin HTTP/1.1 404 153 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:23:19:51 0800] GET /admin HTTP/1.1 404 153 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:23:19:54 0800] GET / HTTP/1.1 200 61756 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - 192.168.1.10 - - [06/Aug/2023:23:20:05 0800] GET /a HTTP/1.1 404 153 - Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/115.0 - /var/log/nginx/error.log 2023/08/06 23:19:44 [notice] 3897#3897: exit 2023/08/06 23:19:44 [notice] 2483#2483: signal 17 (SIGCHLD) received from 3897 2023/08/06 23:19:44 [notice] 2483#2483: worker process 3897 exited with code 0 2023/08/06 23:19:44 [notice] 2483#2483: signal 29 (SIGIO) received 2023/08/06 23:19:44 [notice] 2483#2483: signal 17 (SIGCHLD) received from 3898 2023/08/06 23:19:44 [notice] 2483#2483: worker process 3898 exited with code 0 2023/08/06 23:19:44 [notice] 2483#2483: signal 29 (SIGIO) received 2023/08/06 23:20:05 [error] 3906#3906: *28 open() /home/AdminLTE-3.2.0/a failed (2: No such file or directory), client: 192.168.1.10, server: localhost, request: GET /a HTTP/1.1, host: 192.168.1.9:8000可以看到报错信息为 /home/AdminLTE-3.2.0/a 这个目录不存在。
http://www.hkea.cn/news/14272046/

相关文章:

  • 做趣味图形的网站中文html网站模板下载
  • 上海网站公司设计怎么查找网站备案主体
  • 网站备案 核验单网站怎么设置支付
  • 塘沽网站优化海外网站建设推广最好的
  • 福建省文明建设办公室网站seo推广培训
  • 响应式的网站建设一个多少钱建设外贸型网站
  • 成品网站管理系统WordPress网络功能
  • 英文网站建设 淮安国外网站网站app
  • 网站建设基本步骤包括哪些flash怎么做网页
  • 建网页和网站的区别wordpress 快速安装
  • 谁做的四虎网站是多少钱邢台集团网站建设费用
  • 合肥做装修哪个网站好天津市津南区教育网站建设招标
  • 品牌网站建设收费情况深圳深圳建设网站
  • 派点网站建设重庆电力建设公司网站
  • 山西住房建设部网站西部数码网站管理助手 301
  • 做公司网站哪家 上海wordpress修改社交
  • 网站建设开票开什么内容小程序怎么开通
  • 怎么自己开发网站企业如何申请网站
  • 网站功能模块是什么百度广告管家
  • 购物网站建设与开发wordpress做淘宝的交流插件
  • 温州好的网站推广郑州出租车网
  • 做it的网站有哪些wordpress优酷插件
  • 忻州网站建设公司建设银行网站上预览电子回单
  • 建设应用型网站的意义网络维护电话
  • 做区位图的网站大理公司网站建设
  • 做网店好还是网站网站优化建设山东
  • 美团网站除佣金表格怎么做网上电影网站怎么做的
  • 钟楼区建设局网站做本地婚恋网站
  • 常州网站建设价格网站优化实习报告
  • 京东网站建设的要求电子商务营销写作实务