nginx官方站点:nginx.org

分为mainline和stable两个分支。我们选择stable。

对常见发行版,站点提供了pre-built package:

http://nginx.org/en/linux_packages.html#stable

比如我用的centos 7.x,按照其提供的例子写一个nginx.repo:

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

然后就可以sudo yum install nginx了。

使用systemctl [start|stop] nginx来启动/停止nginx server。

为了安全,我们最好修改网站的user和group。原则是网站的owner和nginx process的user不能相同,这样nginx运行时就不能向网站进行任意的写操作。

相关文章:

  • 2022-01-23
  • 2022-03-06
  • 2022-01-01
  • 2022-01-01
  • 2022-01-01
  • 2021-10-31
猜你喜欢
  • 2021-07-10
  • 2021-07-10
  • 2022-01-14
  • 2021-06-09
  • 2021-12-02
相关资源
相似解决方案