zoukankan      html  css  js  c++  java
  • xgqfrms™, xgqfrms® : xgqfrms's offical website of GitHub!

    macOS & Nginx

    ngnix

    # 使用 brew 安装(如果没有 brew 命令,需要自行安装 brew)
    $ brew install nginx
    
    $ nginx -h
    
    # 查看 port 占用情况
    $ lsof -Pi | grep LISTEN
    
    
    # 重启 nginx
    $ nginx -s reload
    
    # 停止 nginx
    $ nginx -s stop
    

    修改 nginx.conf 文件,添加如下配置(

    修改后要重启 nginx

    $ cat /usr/local/etc/nginx/nginx.conf
    
    $ vim /usr/local/etc/nginx/nginx.conf
    

    demos


    macOS & hosts

    # vim
    $ vim /usr/local/etc/nginx/nginx.conf
    
    # OR
    $ cd /usr/local/etc/nginx
    # vscode
    $ code .
    
    
    

    Nginx

    # 使用 brew 安装(如果没有 brew 命令,需要自行安装 brew)
    $ brew install nginx
    
    $ nginx -h
    
    # 查看 port 占用情况
    $ lsof -Pi | grep LISTEN
    
    
    # 重启 nginx
    $ nginx -s reload
    

    修改 nginx.conf 文件,添加如下配置

    修改后要重启 nginx

    
    $ cat /usr/local/etc/nginx/nginx.conf
    
    $ vim /usr/local/etc/nginx/nginx.conf
    
    

    Linux 如何一次切换到 home 目录

    相对路径 & 绝对路径

    cd ./ 代表当前目录
    cd ../ 代表上级目录

    cd ~ 当前用户的根目录
    cd / 系统的根目录

    $ cd ~
    $ pwd
    # /Users/xgqfrms-mbp
    
    $ cd / 
    $ ls
    # Applications Users cores  home  sbin var  Library Volumes dev opt  tmp System bin  etc private usr
    
    #  etc, usr, home, Users
    
    # 切换到 etc 并打开 hosts 文件
    $ cd ../../etc
    $ cd /etc && cat hosts
    $ cd /etc && code hosts
    
    $ cd /etc && sudo vim hosts
    # :wq!
    
    # php, nginx (created: 2020.08.08)
    127.0.0.1 www.webfullstack.xyz 
    
    


    Flag Counter

    ©xgqfrms 2012-2020

    www.cnblogs.com 发布文章使用:只允许注册用户才可以访问!


  • 相关阅读:
    response.redirect on asp.net is a 302 jump action
    什么吃掉了我的硬盘?
    百度流量统计将会影响搜索的排名
    发邮件 python
    bottle template usage
    想提神,喝中药,咖啡可可没用的
    企业退信的常见问题?
    用UnixBench测试VPS性能 判别是否值得购买
    域名注册及免费空间and企业邮箱
    LNMP一键安装包是什么?
  • 原文地址:https://www.cnblogs.com/xgqfrms/p/12189745.html
Copyright © 2011-2022 走看看