最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
linux/cenots中nginx的安装方法
时间:2016-04-21 编辑:简简单单 来源:一聚教程网
nginx 安装
yum -y install gcc gcc-c++ pcre pcre-devel zlib zlib-devel
cd /usr/local/src/
wget http://nginx.org/download/nginx-1.8.0.tar.gz
tar -zxvf nginx-1.8.0.tar.gz
cd nginx-1.8.0
./configure --prefix=/usr/local/nginx
make && make install
nginx 目录结构
conf 配置文件
logs 日志文件
html 网页
sbin 二进制程序
启动
为了方便使用,创建一个软链接
ln -s /usr/local/nginx/sbin/nginx /usr/bin/nginx
nginx
[root@localhost sbin]# nginx -h
nginx version: nginx/1.8.0
Usage: nginx [-?hvVtq] [-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
-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: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
一些常用命令
[root@localhost sbin]# nginx -V
nginx version: nginx/1.8.0
built by gcc 4.8.3 20140911 (Red Hat 4.8.3-9) (GCC)
configure arguments: --prefix=/usr/local/nginx
[root@localhost sbin]# nginx -t
nginx: the configuration file /usr/local/nginx/conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx/conf/nginx.conf test is successful
nginx
nginx -s reload
相关文章
- linux系统怎么安装Nginx Lua环境 linux系统安装Nginx Lua环境教程 12-05
- win11内核隔离和内存完整性介绍 10-31
- win10全屏缩放设置教程 10-31
- win10系统备份出错解决教程 10-31
- win10打开软件每次都要询问解决教程 10-31
- win10更新驱动后设备出现异常解决教程 10-31