Ubuntu 16.04LTS安装Nginx
Nginx ("engine x") 是一个高性能的 HTTP 和 反向代理 服务器,也是一个 IMAP/POP3/SMTP 代理服务器。 Nginx 是由 Igor Sysoev 为俄罗斯访问量第二的 Rambler.ru 站点开发的,第一个公开版本0.1.0发布于2004年10月4日。其将源代码以类BSD许可证的形式发布,因它的稳定性、丰富的功能集、示例配置文件和低系统资源的消耗而闻名。
安装Nginx依赖库
安装gcc g++的依赖库
apt-get install build-essential
apt-get install libtool
安装 pcre依赖库
sudo apt-get update
sudo apt-get install libpcre3 libpcre3-dev
安装 zlib依赖库
apt-get install zlib1g-dev
安装 ssl依赖库
apt-get install openssl
安装Nginx
下载最新版本
wget http://nginx.org/download/nginx-1.11.3.tar.gz
解压,编译
tar -zxvf nginx-1.11.3.tar.gz
cd nginx-1.11.3
./configure --prefix=/usr/local/nginx
make
sudo make install
启动nginx
sudo /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
ps -ef|grep nginx
root 7797 3211 0 09:43 ? 00:00:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 7798 7797 0 09:43 ? 00:00:00 nginx: worker process
ysl 7804 4913 0 09:44 pts/1 00:00:00 grep --color=auto nginx
Nginx常用命令
启动 Nginx
/usr/local/nginx/sbin/nginx
停止 Nginx
./sbin/nginx -s stop
./sbin/nginx -s quit
Nginx重新加载配置
./sbin/nginx -s reload
指定配置文件
./sbin/nginx -c /usr/local/nginx/conf/nginx.conf
查看 Nginx 版本
./sbin/nginx -v
nginx version: nginx/1.11.3
sudo /usr/local/nginx/sbin/nginx -V
nginx version: nginx/1.11.3
built by gcc 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.5)
configure arguments: --prefix=/usr/local/nginx
检查配置文件是否正确
sudo /usr/local/nginx/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
显示帮助信息
sudo /usr/local/nginx/sbin/nginx -h
ginx version: nginx/1.11.3
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: /usr/local/nginx/)
-c filename : set configuration file (default: conf/nginx.conf)
-g directives : set global directives out of configuration file
Ubuntu 16.04LTS安装Nginx的更多相关文章
- Ubuntu 16.04LTS 安装 MATLAB 2014B
环境:Ubuntu 16.04LTS 软件:MATLAB 2014B MATLAB 2014B 下载地址(带Crack): 链接: https://pan.baidu.com/s/1nvGtmEd 密 ...
- Ubuntu 16.04LTS安装flashplayer
转载自http://www.linuxdiyf.com/linux/20084.html 在安装Ubuntu 16.04LTS后,播放有视频的网页时,总提示你要安装缺失的插件,在 ubuntu 系统下 ...
- Ubuntu 16.04LTS 安装和配置Bochs
环境:VMWare14+Ubuntu16.04 安装Bochs2.6.9 1.去官网下载 下载 bochs-2.6.9.tar.gz 2.安装一系列的包 因为Bochs 需要在 X11 环境下运行,因 ...
- Ubuntu 16.04安装Nginx
在Ubuntu下安装Nginx有以下方法,但是如果想要安装最新版本的就必须下载源码包编译安装. 一.基于APT源安装 sudo apt-get install nginx 安装好的文件位置: /usr ...
- 【Ubuntu 16】安装nginx
近年来,nginx服务器程序由于负载均衡.反向代理.适于高并发的特性,获得越来越多互联网企业的青睐.在此为大家奉上nginx的安装过程,以供参考. 一.安装nginx 1.安装gcc\g++库 sud ...
- Ubuntu 16.04LTS 安装 Node.js stable
更新ubuntu软件源 sudo apt-get update sudo apt-get install -y python-software-properties software-properti ...
- ubuntu 16.10安装nginx
1 : cd /usr/local 2 : sudo wget http://nginx.org/download/nginx-1.2.8.tar.gz 3 : sudo tar -zxvf ngin ...
- Ubuntu 16.04安装Matlab 2016b教程
由于代码需要依赖Linux环境,只好尝试着装MATLAB,然而各种问题接踵而至,开始了由MATLAB引发的三天Linux探寻之旅-- 下载Matlab 2016b for Linux https:// ...
- Ubuntu 16.04 安装 Kodi v17 “Krypton” Alpha 2
Ubuntu 16.04 安装 Kodi v17 “Krypton” Alpha 2:sudo add-apt-repository ppa:team-xbmc/xbmc-nightlysudo ap ...
随机推荐
- iis 应用程序预热
<applicationPools> <add name="appname" managedRuntimeVersion="v4.0" sta ...
- classification report 使用
别人写的,但是还是有些不清晰,我最后补上了 最后一行:第一个0.7=(0.5*1+0*1+1*3)/5 其他类似 support行:在真实数据中y_ture中class 0有一个 class 1有1 ...
- java Exception in thread "main" java.lang.NoClassDefFoundError: main (wrong name: pm/main)
javac main.java 编译后没有问题 java main 出现下面在问题: Exception in thread "main" java.lang.NoClassDef ...
- Spring+SpringMVC+mybatis+Quartz整合
Quartz与SpringMVC的整合 简介 Quartz是一个完全由java编写的开源作业调度框架,为在Java应用程序中进行作业调度提供了简单却强大的机制.Quartz允许开发人员根据时间间隔来调 ...
- Devexpress VCL Build v2013 vol 14.1.5 发布
What's New in 14.1.5 (VCL Product Line) New Major Features in 14.1 What's New in VCL Products 14.1 ...
- hdu-1058(动态规划)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1058 题意:求只由2,3,5,7的乘积组成的数,输出格式见output 思路:开始想打表,后来打表超时 ...
- cgo -rpath指定动态库路径
// #cgo CFLAGS: -Wall // #cgo LDFLAGS: -Wl,-rpath="/home/liuliang/ffmpeg-build/lib" // #cg ...
- iso搭建本地源
1.挂载iso mount -o loop /root/test.iso /mnt/iso 2.新建repo [local] name=local baseurl=file:///mnt/iso/ e ...
- org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defined
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'testService' is defi ...
- Linux Bash命令总结
Bash命令 一:man命令,是manual 手册的意思,如man ps表示查看ps命令的手册,man man查看man命令的手册:也可以通过man xx查看是否有xx命令. 二:cat命令,用来一次 ...