想起来暑假留的一个坑,今天来填上!
1.去官网下载最新的源码
root@raspberrypi:/usr/local/src# wget http://nginx.org/download/nginx-1.15.5.tar.gz
2.解压
root@raspberrypi:/usr/local/src# tar xzf nginx-1.15.5.tar.gz
3.cd到nginx目录
root@raspberrypi:/usr/local/src# cd nginx-1.15.5
4.配置检查
root@raspberrypi:/usr/local/src/nginx-1.15.5# ./configure
5.编译 && 安装
root@raspberrypi:/usr/local/src/nginx-1.15.5# make && make install
6.回到上级目录
root@raspberrypi:/usr/local/src/nginx-1.15.5# cd ..
7.继续回到上级目录
root@raspberrypi:/usr/local/src# cd ..
8.看一下 当前目录
root@raspberrypi:/usr/local# ls
bin etc games include lib man nginx sbin share src
#可以看到nginx文件了
9.cd到nginx然后 ls 一下
root@raspberrypi:/usr/local# cd nginx/ && ls
conf html logs sbin
#conf —-配置文件
#html —-网页文件
#logs —-日志文件
#sbin —-启动文件
10.启动nginx
root@raspberrypi:/usr/local/nginx# ./sbin/nginx
ps:Nginx常用命令参考第一话: NGINX第一话 [FOR WIN]
END