linux安装nginx
1、下载nginx gz压缩包格式(C语言源码安装压缩文件)
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
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
此刻访问linux的ip即可看到nginx的欢迎页