首页 > 系统相关 >yum方式安装nginx

yum方式安装nginx

时间:2023-01-17 13:44:52浏览次数:36  
标签:rpm nginx yum root 安装 localhost

转载地址:

https://blog.csdn.net/qq_34200979/article/details/123016644

 

1、添加CentOS 7 Nginx yum资源库

[root@localhost ~]# rpm -Uvh  http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm

2、安装nginx

[root@localhost ~]# yum -y install nginx   //安装nginx

3、启动nginx

[root@localhost ~]# systemctl start nginx   //启动nginx

4、安装完成,可以在浏览器访问

  

5、yum方式安装的默认地址和配置的默认地址

/etc/nginx/nginx.conf  //yum方式安装后默认配置文件的路径

/usr/share/nginx/html  //nginx网站默认存放目录

/usr/share/nginx/html/index.html //网站默认主页路径

 

   

拓展:

nginx基本操作

[root@localhost ~]# yum -y instal nginx  //安装nginx

[root@localhost ~]# service nginx start  //启动nginx

[root@localhost ~]# service nginx stop  //停止nginx

[root@localhost ~]# service nginx reload  //重载nginx

[root@localhost ~]# ps -ef | grep nginx  //查看进程apache/httpd

[root@localhost ~]# netstat -anpl | grep 'nginx'  //查看服务端口

[root@localhost ~]# rpm -Uvh http://nginx.org/packages/centos/7/x86_64/RPMS/nginx-1.18.0-1.el7.ngx.x86_64.rpm  // rpm方式升级并安装某个版本的Nginx

标签:rpm,nginx,yum,root,安装,localhost
From: https://www.cnblogs.com/zhoading/p/17057619.html

相关文章

  • 如何在centos上安装nvidia docker
    当基于nvidiagpu开发的docker镜像在实际部署时,需要先安装nvidiadocker。那么如何安装nvidiadocker呢。下面将详细介绍下。安装原生dockeryum-yinstalldocker-io......
  • Prometheus笔记-安装
    官网https://prometheus.io/docs/introduction/overview/下载Prometheushttps://prometheus.io/download/安装Prometheus配置文件#myglobalconfigglobal:......
  • Nginx与LUA(4)
    您好,我是湘王,这是我的博客园,欢迎您来,欢迎您再来~   Nginx既然可以限制流量,那能不能「扩展」流量呢?当然可以,但可能不是你想象的那种「扩展」,更准确地来说是复制,或者......
  • Ubuntu显卡安装
    使用官方的NVIDIA驱动进行手动安装(稳定、靠谱)1.安装驱动前一定要更新软件列表和安装必要软件、依赖(必须)aptupdate#更新软件列表aptinstallg++gccmake-y2.......
  • Linux中安装Git 2.39.0
    1、依赖安装yuminstalldh-autoreconfcurl-develexpat-develgettext-developenssl-develperl-develzlib-develnss-y2、移除默认的gityumremovegit-y3......
  • MySQL安装-Linux版
    MySQL8.0.26-Linux版安装1.准备一台Linux服务器云服务器或者虚拟机都可以;Linux的版本为CentOS7;2.下载Linux版MySQL安装包https://downloads.mysql.com/archives/......
  • Nginx一网打尽
    引言早期的业务都是基于单体节点部署,由于前期访问流量不大,因此单体结构也可满足需求,但随着业务增长,流量也越来越大,那么最终单台服务器受到的访问压力也会逐步增高。时间一......
  • windows安装mysql压缩包
    1.解压压缩包2.在解压好的根目录下新建my.ini文件,内容可如下:[mysqld];设置3306端口port=3306;设置mysql的安装目录basedir=D:/wamp64/bin/mysql/mysql8.0.28;设置mysql......
  • nginx 配置文件解析
    #usernobody;#工作进程数,一般设置为cpu核心数worker_processes4;worker_rlimit_nofile65535;#error_loglogs/error.log;#error_loglogs/error.lognotice......
  • 在Ubuntu上安装OpenShift并使用
    服务器信息在阿里云买了个抢占式的服务器,地区为华南广州,系统为Ubuntu20.04,8核16GB。安装Docker命令如下:$apt-getupdate-y$apt-getupgrade-y$apt-getinstal......