安装nginx
apt-get install nginx
# 可以会出现 如下错误
# E: Unable to locate package nginx
# 这个时候,你要升级安装工具
apt-get update
查看80端口是不是被nginx占用
lsof -i:80
或者 你输入nginx,默认就是开启nginx的,因为你通过apt-get install nginx 安装nginx,会默认将nginx添加到系统的环境变量中。
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Address already in use)
nginx: [emerg] bind() to [::]:80 failed (98: Address already in use)
nginx: [emerg] bind() to 0.0.0.0:80 failed (98: Addr