转:https://www.cnblogs.com/fuhai0815/p/8522868.html

一、建立nginx源

vim /etc/yum.repos.d/nginx.repo

[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1

二、安装

yum -y install nginx

三、启动

systemctl start nginx

加入开机启动项:systemctl enable nginx

四、配防火墙

vi /etc/sysconfig/iptables   添加下面内容
-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT(允许80端口通过防火墙) 
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT(mysql端口  允许3306端口通过防火墙)
然后重启防火墙:service iptables restart

配置文件:/etc/nginx/nginx.conf
默认配置文件:/etc/nginx/conf.d/default.conf
默认网页目录:/usr/share/nginx/html

(转)Centos7 yum 源安装nginx的更多相关文章

  1. Centos7 yum 源安装nginx

    一.建立nginx源 vim /etc/yum.repos.d/nginx.repo [nginx]name=nginx repobaseurl=http://nginx.org/packages/c ...

  2. 阿里云 通过YUM源安装nginx

    阿里云centOS-6.3-64位通过YUM源安装nginx 第一步:在 /etc/yum.repos.d/ 目录下,建立名叫nginx.repo的软件源配置文件.   文件 nginx.repo 的 ...

  3. 【nginx】利用yum源安装nginx

    先安装nginx的yum源 http://nginx.org/en/linux_packages.html#stable 找到链接,安装: rpm -ivh http://nginx.org/pack ...

  4. yum源安装nginx

    nginx使用yum源安装 安装步骤 使用yum源安装依赖 yum install yum-utils 配置nginx.repo的yum文件 vim /etc/yum.repos.d/nginx.re ...

  5. Centos7 通过yum源安装nginx

    通过rpm 添加yum源 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ng ...

  6. centos7 下yum源安装nginx

    简单粗暴: .rpm -ivh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noar ...

  7. centos7 yum 方式安装nginx

    centos7系统库中默认是没有nginx的rpm包的,所以我们自己需要先更新下rpm依赖库 (1)使用yum安装nginx需要包括Nginx的库,安装Nginx的库 #rpm -Uvh http:/ ...

  8. 用yum源安装Nginx

    1.在/etc/yum.repos.d/目录下创建一个源配置文件nginx.repo: cd /etc/yum.repos.d/ vi nginx.repo 填写如下内容: [nginx] name= ...

  9. 用yum源安装nginx(转)

    新建一个nginx的源,/etc/yum.repos.d/nginx.repo 编辑此文件内容如下: [nginx]name=nginx repobaseurl=http://nginx.org/pa ...

随机推荐

  1. Far and away the best prize that life has given to us is the chance to work hard at work worth doing

    work at:侧重于某个工作场所,或者是工作领域内研究 work on:侧重于思想上的从事于某个工作. marvel:n.漫威.奇迹 means.n.方法 tailor.n.裁缝 brighten. ...

  2. VS2012发布Web应用程序

    一.右键项目-->发布 二.配置文件:新建-->配置文件名称,如MyProject 三.连接:1.发布方法:文件系统  2.目标位置:自己在本地建立一个文件夹 3.目标URL:可以不填 四 ...

  3. JS屏蔽鼠标右键

    //方法1: function stop() {    return false;}document.oncontextmenu = stop;//方法2: window.document.oncon ...

  4. vuer-cli 安装笔记

    电脑上装 的软件全卸载了.需要 重装 .整理了一下vue-cli脚手架搭建 1 先下载git 2 再下载node 3安装淘宝镜像 (https://npm.taobao.org/) 4 安装webpa ...

  5. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.lang.NumberFormatException: For input string: "W%" ### Cause: java.lang.NumberFormatException: For input s

    一个常见的myBatis xml文件中的引号错误: org.apache.ibatis.exceptions.PersistenceException: ### Error querying data ...

  6. ARM汇编1

    一. 指令和伪指令 1.1. 指令 a. (汇编)指令是CPU机器指令的助记符,经过编译后会得到一串10组成的机器码,可以由CPU读取执行. 1.2. 伪指令 b. (汇编)伪指令本质上不是指令(只是 ...

  7. Sublime text设置快捷键让编写的HTML文件在打指定浏览器预览

    作者:浪人链接:https://www.zhihu.com/question/27219231/answer/43608776来源:知乎著作权归作者所有.商业转载请联系作者获得授权,非商业转载请注明出 ...

  8. Webstorm上已有的本地项目上传到Github

    1.Webstorm左上角File —— Settings—— Github, Auth Type改成password,在Login和Password中输入自己的github账户和密码,点Test测试 ...

  9. HTML拖放元素

    实现来回拖放图片 <!DOCTYPE HTML> <html> <title>来回拖放元素</title> <meta charset=" ...

  10. nginx location配置讲解

    location语法:表示uri方式定位 基础语法有三种: location = pattern {} 精准匹配 location pattern {} 一般匹配 location ~ pattern ...