sudo apt search nginx | grep ^nginx
查询仓库里面是否有nginx
之后详细见:nginx: Linux packages
跟着步骤安装
安装完后输入
sudo systemctl status nginx
如果是非激活状态
● nginx.service - nginx - high performance web server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled)
Active: inactive (dead)非激活
Docs: https://nginx.org/en/docs/
启动
sudo systemctl start nginx
查询nginx文件所在位置
whereis nginx
nginx: /usr/sbin/nginx /usr/lib/nginx /etc/nginx /usr/share/nginx /usr/share/man/man8/nginx.8.gz
usr:软件相关东西
etc:配置
nginx 主配置文件
cat