nginx 安装配置和常用命令
2017-11-17 16:25
369 查看
基本环境:CentOS
1. 下载 nginx
[root@localhost ~]# cd Downloads/ [root@localhost Downloads]# wget http://nginx.org/download/nginx-1.13.6.tar.gz
2. 安装 nginx 依赖
yum -y install openssl openssl-devel yum -y install pcre-devel
3. 编译安装
将 nginx 安装在 /opt/nginx 目录下
[root@localhost Downloads]# tar -xvf nginx-1.13.6.tar.gz [root@localhost Downloads]# mkdir -p /opt/nginx [root@localhost Downloads]# cd nginx-1.13.6/ [root@localhost nginx-1.13.6]# ./configure --prefix=/opt/nginx [root@localhost nginx-1.13.6]# make && make install
4. nginx 基本命令
检查 nginx 配置语法是否正确
[root@localhost ~]# /opt/nginx/sbin/nginx -t nginx: the configuration file /opt/nginx/conf/nginx.conf syntax is ok nginx: configuration file /opt/nginx/conf/nginx.conf test is successful
启动 nginx
/opt/nginx/sbin/nginx
重新加载 nginx 配置
[root@localhost ~]# /opt/nginx/sbin/nginx -s reload
nginx 帮助
[root@localhost ~]# /opt/nginx/sbin/nginx -h nginx version: nginx/1.13.6 Usage: nginx [-?hvVtTq] [-s signal] [-c filename] [-p prefix] [-g directives] Options: -?,-h : this help -v : show version and exit -V : show version and configure options then exit -t : test configuration and exit -T : test configuration, dump it and exit -q : suppress non-error messages during configuration testing -s signal : send signal to a master process: stop, quit, reopen, reload -p prefix : set prefix path (default: /opt/nginx/) -c filename : set configuration file (default: conf/nginx.conf) -g directives : set global directives out of configuration file
相关文章推荐
- Nginx安装及配置以及常用命令
- ubuntu下nginx安装、基本配置及常用命令
- Nginx_安装配置及常用命令
- Java学习系列(一)Java的运行机制、JDK的安装配置及常用命令详解
- Ubuntu安装配置Mysql和ubuntu下mysql的常用命令
- ubuntu下SVN服务器安装配置 下的svn 常用命令
- 高性能Web服务器Nginx的配置与部署研究(4)Nginx常用命令
- 高性能Web服务器Nginx的配置与部署研究(4)Nginx常用命令
- CentOS 编译安装NGINX最新版及常用命令
- Java学习系列(一)Java的运行机制、JDK的安装配置及常用命令详解
- Linux上安装Nginx及常用命令
- 安装配置管理 之 在Fedora Core 中,有些常用命令怎么没有?解决办法设置PATH
- linux,Centos 6.3 yum安装Nginx+php+Mysql,配置防火墙,开启,关闭端口命令
- Nginx安装和常用配置文档
- 高性能Web服务器Nginx的配置与部署研究(4)Nginx常用命令
- Mysql数据库安装配置及常用命令(不断更新)
- Maven学习笔记———《Mac 上maven安装、配置及常用命令》
- oracle OEM的安装与配置(常用命令)
- Nginx的配置与部署4)Nginx常用命令
- 第1课 oracle安装,配置及常用命令