Chaos' Blog

ubuntu安装nginx

2019-04-17

一直想尝试下Nginx,看了下网上骚操作也是蛮多的,特地记下来

更新源

1
2
3
sudo apt-add-repository ppa:nginx/stable
sudo apt-add-repository ppa:ondrej/php
sudo apt update

如果提示apt-add-repository找不到可以

1
2
apt-get install python-software-properties
apt-get install software-properties-common

nginx

安装

1
sudo apt install nginx

启动

测试配置

1
nginx -t

重启

1
nginx -s reload

如果报错

1
nginx -c /etc/nginx/nginx.conf

php-fpm7.0

1
2
sudo apt install php7.0-fpm
service php7.0-fpm restart

参考链接

  1. https://www.cnblogs.com/ddling/p/5906109.html
Tags: nginx