Linux安装Nginx

60 阅读1分钟

安装步骤

  1. 添加源默认情况Centos7中无Nginx的源
rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm
  1. 测试是否添加源
yum search nginx 

  1. 安装Nginx
yum install -y nginx

4.启动Nginx并设置开机自动运行

sudo systemctl start nginx
sudo systemctl enable nginx

5.查看是否安装成功

ps -ef|grep nginx

image.png

7.一些常用的搜索命令

 根据文件名搜索
 find / -name mysql
 find / -name 'mysql*'
 whereis nginx