2024年2月3日发(作者:)
1、安装过程
a.
# yum install -y pcrepcre-devel
# yum install -y opensslopenssl-devel
b.
# tar xzf
# cd nginx-1.7.3
c.
# ./configure
(默认安装路径为/usr/local/nginx)
d.
# make
# make install
f.
启动:nginx
# /usr/local/nginx/sbin/nginx
e.
添加到系统服务
将nginx文件直接复制到以下路径
/etc/init.d/nginx
h.
# chmoda+x /etc/init.d/nginx设置权限
设置开机启动配置文件
# vim /etc/
添加一行
/etc/init.d/nginx start
# /etc/init.d/nginx restart 重启测试
g.添加用户
# useraddnginx
I.新建文件夹
(对照文件中相关参数路径)
[root@localhost/]# cd /opt/
[root@localhost/]#mkdir local
[root@localhostopt]# cd local
[root@localhostlocal]#mkdirtmp
[root@localhostlocal]#mkdir cache
[root@localhostlocal]#mkdirvar
[root@localhostlocal]# cd var/
[root@localhostvar]#mkdir log
[root@localhostvar]# cd logs/
[root@localhostlogs]#mkdirnginx
[root@localhostvar]# cd ..
[root@localhostlocal]# cd tmp/
[root@localhosttmp]#mkdirnginx
[root@localhostnginx]# cd nginx
[root@localhostnginx]#mkdirproxy_temp
注:路径/opt/local/cache主要用来存放直播缓存,大约需要30-100G的存储大小(实时改变),因此建议把路径设置到/opt下
2、配置
a、替换正向代理配置文件
路径/usr/local/nginx/conf
b、重启nginx
# /usr/local/nginx/sbin/nginx -s reload
另外相关命令
1、查看状态
使用ps -ef|grepnginx查看nginx的进程
2、 停止nginx所有进程
[root@linuxidcsbin]#pkill -9 nginx
本文发布于:2024-02-03 10:22:07,感谢您对本站的认可!
本文链接:https://www.4u4v.net/it/170692692750105.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
留言与评论(共有 0 条评论) |