1. # 让 vim 支持 nginx 语法高亮,如果 .vim 不存在就新建
    2. cp contrib/vim/* ~/.vim/
    3. # 执行源码包中的 configure 进行编译
    4. ./configure --help
    5. # 编译安装
    6. ./configure -prefix=<path>
    7. make
    8. make install
    9. # 查看帮助
    10. nginx -?
    11. # 检查配置是否存在语法错误,注意这里的路径要绝对路径
    12. nginx -t [-c <config file path>]
    13. # 启动并指定配置文件,不指定配置默认使用安装目录下 conf 文件夹中的 nginx.conf,所以可以用 grep Nginx 所在目录以及所使用的配置文件
    14. nginx [-c <config file path>]
    15. # 立即停止
    16. nginx -s stop
    17. # 优雅地停止
    18. nginx -s quit
    19. # 重新加载配置
    20. nginx -s reload
    1. # 备份原有日志
    2. cp access.log access.log.1
    3. # 让 Nginx 重新开始记录日志
    4. nginx -s reopen