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

网站优化排名软件哪些最好新开传奇网站发布站

网站优化排名软件哪些最好,新开传奇网站发布站,线上推广的渠道有哪些,小学的门户网站建设Nginx之Centos7安装 文章目录 Nginx之Centos7安装1. 离线安装1. 下载2.安装依赖3. 编译并安装4. 启动5. 访问6. 访问出现403问题处理7. 80端口代理多个后端服务 2. Nginx常用命令 1. 离线安装 1. 下载 官网地址#xff1a;http://nginx.org/ 本文下载的是nginx-1.21.1.tar.…Nginx之Centos7安装 文章目录 Nginx之Centos7安装1. 离线安装1. 下载2.安装依赖3. 编译并安装4. 启动5. 访问6. 访问出现403问题处理7. 80端口代理多个后端服务 2. Nginx常用命令 1. 离线安装 1. 下载 官网地址http://nginx.org/ 本文下载的是nginx-1.21.1.tar.gz 解压 tar -zxvf nginx-1.21.1.tar.gz # 如解压到了/opt/software/nginx-1.21.12.安装依赖 进入到/opt/software/nginx-1.21.1目录中执行下面命令按照出差信息一依次安装所有依赖即可 ./configure安装gcc-c依赖 yum install gcc-c下面错误,执行yum -y install pcre-devel解决 ./configure: error: the HTTP rewrite module requires the PCRE library. You can either disable the module by using --without-http_rewrite_module option, or install the PCRE library into the system, or build the PCRE library statically from the source with nginx by using --with-pcrepath option.下面错误执行yum install -y zlib-devel解决 ./configure: error: the HTTP gzip module requires the zlib library. You can either disable the module by using --without-http_gzip_module option, or install the zlib library into the system, or build the zlib library statically from the source with nginx by using --with-zlibpath option.再执行 ./configure 看到下面信息说明成功 Configuration summary using system PCRE library OpenSSL library is not used using system zlib librarynginx path prefix: /usr/local/nginxnginx binary file: /usr/local/nginx/sbin/nginxnginx modules path: /usr/local/nginx/modulesnginx configuration prefix: /usr/local/nginx/confnginx configuration file: /usr/local/nginx/conf/nginx.confnginx pid file: /usr/local/nginx/logs/nginx.pidnginx error log file: /usr/local/nginx/logs/error.lognginx http access log file: /usr/local/nginx/logs/access.lognginx http client request body temporary files: client_body_tempnginx http proxy temporary files: proxy_tempnginx http fastcgi temporary files: fastcgi_tempnginx http uwsgi temporary files: uwsgi_tempnginx http scgi temporary files: scgi_temp3. 编译并安装 [rootmawei nginx-1.21.1]# make make install ...../usr/local/nginx/conf/scgi_params.default test -f /usr/local/nginx/conf/nginx.conf \|| cp conf/nginx.conf /usr/local/nginx/conf/nginx.conf cp conf/nginx.conf /usr/local/nginx/conf/nginx.conf.default test -d /usr/local/nginx/logs \|| mkdir -p /usr/local/nginx/logs test -d /usr/local/nginx/logs \|| mkdir -p /usr/local/nginx/logs test -d /usr/local/nginx/html \|| cp -R html /usr/local/nginx test -d /usr/local/nginx/logs \|| mkdir -p /usr/local/nginx/logs make[1]: 离开目录“/opt/software/nginx-1.21.1” 查看安装在哪儿了 [rootmawei nginx-1.21.1]# whereis nginx nginx: /usr/local/nginx4. 启动 进入到 cd /usr/local/nginx/sbin/输入./nginx 命令启动即可 [rootlocalhost server]# cd /usr/local/nginx/sbin/ [rootlocalhost sbin]# ll 总用量 4656 -rwx------ 1 root root 4766984 11月 18 10:02 nginx [rootlocalhost sbin]# pwd /usr/local/nginx/sbin [rootlocalhost sbin]# ./nginx 查看版本 [rootlocalhost sbin]# ./nginx -v nginx version: nginx/1.21.15. 访问 nginx默认为80端口,直接输入IP访问即可 http://192.168.2.243/ 6. 访问出现403问题处理 页面访问出现403问题查看日志如下 # 进入到日志目录 /usr/local/nginx/logs 下查看日志 [rootlocalhost logs]# cat error.log 2021/11/18 10:07:08 [error] 15743#0: *2 /usr/local/nginx/html/index.html is forbidden (13: Permission denied), client: 192.168.2.200, server: localhost, request: GET / HTTP/1.1, host: 192.168.2.243 2021/11/18 10:07:08 [error] 15743#0: *2 open() /usr/local/nginx/html/favicon.ico failed (13: Permission denied), client: 192.168.2.200, server: localhost, request: GET /favicon.ico HTTP/1.1, host: 192.168.2.243, referrer: http://192.168.2.243/ 2021/11/18 10:07:28 [error] 15743#0: *2 /usr/local/nginx/html/index.html is forbidden (13: Permission denied), client: 192.168.2.200, server: localhost, request: GET / HTTP/1.1, host: 192.168.2.243 2021/11/18 10:07:28 [error] 15743#0: *2 open() /usr/local/nginx/html/favicon.ico failed (13: Permission denied), client: 192.168.2.200, server: localhost, request: GET /favicon.ico HTTP/1.1, host: 192.168.2.243, referrer: http://192.168.2.243/查看nginx的启动用户发现是nobody而非root用户启动的 [rootlocalhost logs]# ps aux | grep nginx: worker process | awk{print $1}将nginx.config的user改为和启动用户一致 # 编辑 nginx.config文件 [rootlocalhost conf]# vim nginx.conf # 找到注释掉的 “#user nobody;” 这一行然后在此行后面新增一行,其实就是将nobody改为 root用户即可 user root 7. 80端口代理多个后端服务 配置一个80端口代理多后端个服务 以自开发公众号服务为例访问地址:http://192.168.31.102:7001/myWechat 当访问域名后面以myWechat开头时代理到上面的地址中如访问yuan.wechat.com/myWechat具体配置如下 server {listen 80;listen [::]:80;server_name _;root /usr/share/nginx/html;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location /404.html {}# 代理微信公众号服务,以myWechat开头代理到 http://http://192.168.31.102:7001location ~ /lims {proxy_pass http://http://192.168.31.102:7001;}error_page 500 502 503 504 /50x.html;location /50x.html {}location / {index index.html index.htm index.php;}}2. Nginx常用命令 #重启Nginx nginx -s reopen #重新加载Nginx配置文件然后以优雅的方式重启Nginx nginx -s reload #强制停止Nginx服务 nginx -s stop #优雅地停止Nginx服务即处理完所有请求后再停止服务 nginx -s quit #检测配置文件是否有语法错误然后退出 nginx -t #打开帮助信息 nginx -?,-h #显示版本信息并退出 nginx -v #显示版本和配置选项信息然后退出 nginx -V #检测配置文件是否有语法错误然后退出 nginx -t #检测配置文件是否有语法错误转储并退出 nginx -T #在检测配置文件期间屏蔽非错误信息 nginx -q#设置前缀路径(默认是:/usr/share/nginx/) nginx -p prefix#设置配置文件(默认是:/etc/nginx/nginx.conf) nginx -c filename#设置配置文件外的全局指令 nginx -g directives #杀死所有nginx进程 killall nginx
http://www.zqtcl.cn/news/624932/

相关文章:

  • 企业手机网站建设行情做外贸哪个网站比较好2017
  • 专业网站制作电话软件推广
  • 免费建站系统博客海外网站搭建
  • 网站建设与制作视频教学站酷网图片
  • 网站开发还有哪些万维网申请网站域名
  • 做网站费用上海判断网站做的好坏
  • 有了域名和空间怎么建网站哪些公司需要网页电商设计师
  • 网站开站备案深圳创业补贴10万
  • 圆通我做网站拉上海建站系统
  • 对于做网站有什么要求新闻发布会视频
  • 网站建设专业就业前景成都房产信息网 官网
  • 西宁网站建设公司排行网站查询域名ip解析
  • 柳州企业网站开发公司如何做网站首页图
  • 刷赞网站空间免费深圳网站制作公司排名
  • 网站内部优化策略获取网站的路径
  • 网站群 优点今天西安最新通告
  • 惠济免费网站建设设计制作的广告公司
  • 做一个网站建设装潢设计属于什么专业
  • 水处理网站源码注册销售公司流程和费用
  • 诸城网站建设0536s整站优化seo排名点击
  • 企业建设网站需注意哪些内容苏州网站怎么做
  • 浏览器打开网站网站推广软件工具
  • 网站主题编辑工具WordPress公司网站策划方案
  • 做旅游网站选什么空间搜索引擎优化策略有哪些
  • 网站备案多少钱安全网站建设与服务的关系
  • 手机端网页设计尺寸规范优化seo排名
  • 做网站业务提成多少厦门十大装修公司排名榜
  • 为什么用开源建站wordpress rss 插件
  • 语文建设投稿网站南昌做网站的公司多不多
  • 石家庄网站建设的公司功能性质网站