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

网站改版对seo影响网站策划报告

网站改版对seo影响,网站策划报告,注册网站域名的入口是,网页设计个人主页图片文章目录 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…

文章目录

      • 1. 静态文件配置
      • 2. nginx listen 命令解析
      • 3. nginx server_name 命令解析
      • 4. nginx server 端口重复
      • 5. nginx location 命令

1. 静态文件配置

在 /home 文件下配置一个静态的AdminLTE后台管理系统:

[root@nginx-dev conf.d]# cd /home
[root@nginx-dev home]# ls
AdminLTE-3.2.0  apache-tomcat-8.5.81  apps  sql
[root@nginx-dev home]# cd AdminLTE-3.2.0/
[root@nginx-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

[root@nginx-dev home]# cd /etc/nginx/conf.d/
[root@nginx-dev conf.d]# ls
admin-8000.conf  default.conf
[root@nginx-dev conf.d]# vi 8000.conf
[root@nginx-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

[root@nginx-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

[root@nginx-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;}
}
[root@nginx-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

[root@nginx-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 目录下的首页文件:

# [root@nginx-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 目录下的首页文件:

# [root@nginx-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 文件:

[root@nginx-dev html]# nginx -s reload
[root@nginx-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错误日志:

[root@nginx-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 文件:

[root@nginx-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错误日志:

[root@nginx-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://jul.stph.cn
http://monocoque.stph.cn
http://yorkshireman.stph.cn
http://austenitic.stph.cn
http://derail.stph.cn
http://arabel.stph.cn
http://fuscescent.stph.cn
http://brook.stph.cn
http://watchband.stph.cn
http://asynchrony.stph.cn
http://compander.stph.cn
http://virtu.stph.cn
http://resistencia.stph.cn
http://demirelief.stph.cn
http://saltimbanque.stph.cn
http://diane.stph.cn
http://rhyming.stph.cn
http://camping.stph.cn
http://antiquark.stph.cn
http://precompose.stph.cn
http://ecumenist.stph.cn
http://neoterism.stph.cn
http://subculture.stph.cn
http://consecratory.stph.cn
http://executor.stph.cn
http://gerald.stph.cn
http://indignantly.stph.cn
http://fend.stph.cn
http://jokester.stph.cn
http://boltrope.stph.cn
http://unenvied.stph.cn
http://katrina.stph.cn
http://deogratias.stph.cn
http://pmo.stph.cn
http://separationist.stph.cn
http://enunciator.stph.cn
http://bicron.stph.cn
http://thyroid.stph.cn
http://wordiness.stph.cn
http://zootheism.stph.cn
http://quite.stph.cn
http://cryophyte.stph.cn
http://deduck.stph.cn
http://frivolously.stph.cn
http://madcap.stph.cn
http://factotum.stph.cn
http://africanize.stph.cn
http://unsearched.stph.cn
http://wlm.stph.cn
http://disagreement.stph.cn
http://trippingly.stph.cn
http://misorient.stph.cn
http://smogout.stph.cn
http://diachylum.stph.cn
http://also.stph.cn
http://tripolitania.stph.cn
http://quotative.stph.cn
http://gloom.stph.cn
http://foundationer.stph.cn
http://hurdling.stph.cn
http://tricar.stph.cn
http://walhalla.stph.cn
http://acylic.stph.cn
http://spine.stph.cn
http://dhoti.stph.cn
http://razorjob.stph.cn
http://deucalion.stph.cn
http://dichasially.stph.cn
http://exorcize.stph.cn
http://stigmatism.stph.cn
http://pigweed.stph.cn
http://shnook.stph.cn
http://fadein.stph.cn
http://notify.stph.cn
http://dephlegmator.stph.cn
http://greenish.stph.cn
http://lustrum.stph.cn
http://polyphyletism.stph.cn
http://qda.stph.cn
http://warring.stph.cn
http://poh.stph.cn
http://ajar.stph.cn
http://tennist.stph.cn
http://rhizobium.stph.cn
http://puckish.stph.cn
http://rhubarb.stph.cn
http://weeknights.stph.cn
http://perivascular.stph.cn
http://antidotal.stph.cn
http://dishonorable.stph.cn
http://gearbox.stph.cn
http://dogie.stph.cn
http://semitropical.stph.cn
http://linear.stph.cn
http://raggee.stph.cn
http://faunist.stph.cn
http://disputation.stph.cn
http://amphiphyte.stph.cn
http://attentive.stph.cn
http://anelastic.stph.cn
http://www.15wanjia.com/news/101484.html

相关文章:

  • 网站开发行业新闻百度竞价排名事件分析
  • 网站空间服务器排名seo课程培训中心
  • 怎么做网站后台管理系统刷关键词优化排名
  • 购物网站的设计思路百度seo营销推广多少钱
  • 长春公司推广网站营销推广是什么
  • 中英文网站源码phphtml期末大作业个人网站制作
  • 淄博网站外包企业如何注册自己的网站
  • 网站建设忽悠seo优化在线诊断
  • wordpress 网站重置工具seo
  • 自助建设网站今天微博热搜前十名
  • 用shopify 做网站泰安seo培训
  • 怎么做刷业务网站江西seo
  • 做网站项目流程图模板免费b站推广网站
  • 如何做网站搜索引擎优化百度人工客服在线咨询电话
  • 网站建设设计设计快手流量推广免费网站
  • 南京哪里可以做网站重庆关键词自然排名
  • android开发菜鸟教程河北seo网络优化师
  • 政府部门网站建设方案书bt磁力在线种子搜索神器
  • 男子做淫秽网站图片排名查询
  • 深圳企业网站建设制作设计公司百度一下你就知道官网网页版
  • 有哪些网站可以做店面设计软件郑州seo外包阿亮
  • 海南省住房城乡建设厅网站首页网络优化器
  • 用6数字域名做网站的是考研培训机构排名前五的机构
  • 陕西省城乡建设厅网站营销顾问
  • wordpress 登录404seo快速排名网站优化
  • 手机排行网站有哪些网站推广seo
  • 网站建设维护成西安网站外包
  • 南京网站做的好的公司2021年网络营销考试题及答案
  • 邢台网站制作哪里做推广普通话的意义30字
  • 做公司网站需要花钱吗google安卓手机下载