linux安装nginx
1、下载nginx gz压缩包格式(C语言源码安装压缩文件)
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/7a252de1b1e3c0217296a800fac3687a.png#pic_center)
2、用FileZilla 免费开源的FTP解决方案。将nginx压缩包上传到/mnt目录
3、安装
yum -y install zlib-devel pcre-devel openssl-devel
useradd -M -s /sbin/nologin nginx
id nginx
cat /etc/passwd
./configure --prefix=/usr/local/nginx --with-http_stub_status_module --with-http_ssl_module --with-http_random_index_module --with-http_sub_module
make && make install
cd /usr/local/nginx
tree nginx
4、在nginx配置文件改变进程守护用户为刚才创建的nginx用户
vi /usr/local/nginx/conf/nginx.conf
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/664b8d9bf33b03f4f83ed0114aac6355.png#pic_center)
5、启动nginx
/usr/local/nginx/sbin/nginx -t
/usr/local/nginx/sbin/nginx
pstree | grep nginx
pstree -u| grep nginx
pstree -up|grep nginx
netstat -tunpl |grep nginx
6、关闭nginx
pkill nginx
7、重载nginx
pkill -HUP nginx
8、开机启动
chmod a+x /etc/rc.local
vi /etc/rc.local
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/be80be02d90c5171ef0141eea91ca245.png#pic_center)
此刻访问linux的ip即可看到nginx的欢迎页
![在这里插入图片描述](https://i-blog.csdnimg.cn/blog_migrate/25c69aa9ca1925268830dd347a4d9b67.png#pic_center)