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

荣成住房和城乡建设部网站福田网

荣成住房和城乡建设部网站,福田网,百度开店怎么收费,人力资源公司属于什么行业类别使用Markdown格式安装和部署Nginx 本文将介绍如何使用Markdown格式安装和部署Nginx。 步骤 安装Nginx: 打开终端,并根据您的操作系统执行以下命令来安装Nginx: 对于Ubuntu或Debian系统: sudo apt-get update sudo apt-get insta…

使用Markdown格式安装和部署Nginx

本文将介绍如何使用Markdown格式安装和部署Nginx。

步骤

  1. 安装Nginx: 打开终端,并根据您的操作系统执行以下命令来安装Nginx:

    • 对于Ubuntu或Debian系统:

      sudo apt-get update
      sudo apt-get install nginx
      
    • 对于CentOS或RHEL系统:

      sudo yum update
      sudo yum install nginx
      
    • 对于其他操作系统,请参考官方文档或适合您的操作系统的包管理器来安装Nginx。

  2. 启动Nginx服务: 安装完成后,执行以下命令来启动Nginx服务:

    sudo systemctl start nginx
    或者,如果您的系统不使用systemd,请使用以下命令:
    
    sudo service nginx start
    这将启动Nginx服务。
    
  3. 验证Nginx安装: 打开您的Web浏览器,并访问 http://localhost 或服务器的IP地址。如果您看到Nginx的欢迎页面,则表示安装成功。

  4. 配置Nginx: 默认情况下,Nginx的主配置文件位于/etc/nginx/nginx.conf。您可以根据需要对其进行编辑。例如,您可以配置虚拟主机、反向代理、SSL/TLS等。

    在编辑配置文件之前,建议您备份原始配置文件,并在进行更改之前仔细阅读Nginx的官方文档以了解配置选项和语法。

  5. 重新加载配置: 在对Nginx配置文件进行更改后,使用以下命令重新加载配置,使更改生效:

    sudo systemctl reload nginx或者,对于非systemd系统:
    
    sudo service nginx reload
    这将重新加载Nginx的配置文件,使新的配置生效。
    

结论

通过按照上述步骤安装和部署Nginx,您可以成功启动Nginx服务器并进行基本的配置。根据您的需求和环境,可能还需要进行其他配置和调整。您可以参考Nginx的官方文档以获取更多详细信息和指南。

配置docsify 的目录

编辑配置文件

vim /etc/nginx/nginx.conf
# For more information on configuration, see:
#   * Official English Documentation: http://nginx.org/en/docs/
#   * Official Russian Documentation: http://nginx.org/ru/docs/user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
include /usr/share/nginx/modules/*.conf;events {worker_connections 1024;
}http {log_format  main  '$remote_addr - $remote_user [$time_local] "$request" ''$status $body_bytes_sent "$http_referer" ''"$http_user_agent" "$http_x_forwarded_for"';access_log  /var/log/nginx/access.log  main;sendfile            on;tcp_nopush          on;tcp_nodelay         on;keepalive_timeout   65;types_hash_max_size 4096;include             /etc/nginx/mime.types;default_type        application/octet-stream;# Load modular configuration files from the /etc/nginx/conf.d directory.# See http://nginx.org/en/docs/ngx_core_module.html#include# for more information.include /etc/nginx/conf.d/*.conf;server {listen       80;listen       [::]:80;server_name  _;#root         /root/notes/index.html;# 关键指定docsify目录root         /usr/share/nginx/notes/;# Load configuration files for the default server block.include /etc/nginx/default.d/*.conf;error_page 404 /404.html;location = /404.html {}error_page 500 502 503 504 /50x.html;location = /50x.html {}}# Settings for a TLS enabled server.
#
#    server {
#        listen       443 ssl http2;
#        listen       [::]:443 ssl http2;
#        server_name  _;
#        root         /usr/share/nginx/html;
#
#        ssl_certificate "/etc/pki/nginx/server.crt";
#        ssl_certificate_key "/etc/pki/nginx/private/server.key";
#        ssl_session_cache shared:SSL:1m;
#        ssl_session_timeout  10m;
#        ssl_ciphers HIGH:!aNULL:!MD5;
#        ssl_prefer_server_ciphers on;
#
#        # Load configuration files for the default server block.
#        include /etc/nginx/default.d/*.conf;
#
#        error_page 404 /404.html;
#            location = /40x.html {
#        }
#
#        error_page 500 502 503 504 /50x.html;
#            location = /50x.html {
#        }
#    }}
    # 关键指定docsify目录,注意不要放在root目录下root         /usr/share/nginx/notes/;

之后重新nginx就可以了

systemctl reload nginx
http://www.yayakq.cn/news/768295/

相关文章:

  • 重庆南川网站制作公司电话中国建设银行网站外汇
  • 企业网站要怎么做一嗨租车网站建设的功能特色
  • 移动网站开发教学大纲网站更换
  • php网站开发推荐书籍各大搜索引擎网站提交入口大全
  • 衡阳建网站策划公司网站设计
  • 阿里巴巴网站建设教程视频深南花园裙楼+网站建设
  • 阿里云免费建站wordpress 制作app
  • 西宁建设网站价格低网站主题怎么写
  • 云技术在网站建设中的应用钉钉crm客户管理系统
  • 做网站都能用什么做上海畔游网络科技有限公司
  • 二级区域网站名各种中药材初加工平台
  • 网站开发公司是外包公司吗苏州市住房和城乡建设局政务网站
  • 北京西站电话wordpress 判断是否页面
  • 网站回答问题app怎么做网络推广有什么好的方法
  • 物流网站免费源码网思科技股份有限公司
  • 广州网站设计教程外贸建站公司
  • 手机号交易网站源码著名优秀产品设计案例
  • 网站群系统建设 163com免费邮箱登
  • 佛山市建设官方网站4a广告公司都有哪些
  • 网站框架设计绍兴做网站
  • 广州微信网站建设如何dreamwear做网站步骤
  • 企业建网站需要什么网站建设技能考试试题三
  • 网站改版设计费进什么科目南京市建筑工程网站
  • 盘县做会计兼职的网站鹤壁商城网站建设
  • 网站服务器空间租用顺德手机网站设计权威
  • 台州seo网站推广费用网络技术培训班
  • 上海企业网站制作哪家好长春网站建设 吉网传媒
  • 怎么夸一个网站开发公司怎样做博客网站
  • 摄像头监控视频怎么做直播网站网络营销的基本职能
  • 哪个网站可以学做包子大连建设工业产品网站