1、CentOS 6,先执行:
rpm -ivh http://nginx.org/packages/centos/6/noarch/RPMS/nginx-release-centos-6-0.el6.ngx.noarch.rpm
2,查看yum的nginx信息
[]# yum info nginx
Loaded plugins: fastestmirror
Determining fastest mirrors
* base: mirror.esocc.com
* extras: mirror.esocc.com
* updates: mirror.esocc.com
base | 3.7 kB 00:00
base/primary_db | 4.4 MB 00:28
extras | 3.5 kB 00:00
extras/primary_db | 19 kB 00:00
nginx | 2.9 kB 00:00
nginx/primary_db | 22 kB 00:00
updates | 3.5 kB 00:00
updates/primary_db | 2.1 MB 00:10
Installed Packages
Name : nginx
Arch : x86_64
Version : 1.4.0
Release : 1.el6.ngx
Size : 874 k
Repo : installed
From repo : nginx
Summary : nginx is a high performance web server
URL : http://nginx.org/
License : 2-clause BSD-like license
Description : nginx [engine x] is an HTTP and reverse proxy server, as well as
: a mail proxy server
3,安装并启动nignx
[root@server ~]# yum install nginx
[root@server ~]# service nginx start
Starting nginx: [ OK ]
4,然后进入浏览器,输入http://192.168.0.161/测试,如果看到
Welcome to nginx!
If you see this page, the nginx web server is successfully installed and working. Further configuration is required.
For online documentation and support please refer to nginx.org.
Commercial support is available at nginx.com.
Thank you for using nginx.
恭喜你,你成功了!
如果不能连接到nginx,原因很多,但是可以先检查 1,nginx服务是否真的起来了;2,linux服务器防火墙是否打开
在进行Nginx+Tomcat 负载均衡的时候遇到了这个权限问题,在error.log日志中,我们可以看到如下:
connect() to 127.0.0.1:8080 failed (13: Permission denied) while connecting to upstream,
经过一番检查以及google,应该是SeLinux的导致的。可以选择一些两种方式进行:
1、关闭SeLinux,可以查看以下文章:
CentOS下查看SeLinux状态及关闭SeLinux
查看SELinux状态:
1、/usr/sbin/sestatus -v ##如果SELinux status参数为enabled即为开启状态
SELinux status: enabled
2、getenforce ##也可以用这个命令检查
关闭SELinux:
1、临时关闭(不用重启机器):
setenforce 0 ##设置SELinux 成为permissive模式
##setenforce 1 设置SELinux 成为enforcing模式
2、修改配置文件需要重启机器:
修改/etc/selinux/config 文件
将SELINUX=enforcing改为SELINUX=disabled
重启机器即可
2、执行下面的命令
setsebool -P httpd_can_network_connect 1
相关推荐
centos nginx安装包
CentOS Nginx PHP JAVA多语言镜像使用手册
rpm -Uvh --force --nodeps *.rpm centos nginx-1.16.1离线安装包
centos nginx rpm包最新1.24版本
centos nginx+mysql5.7+redis+postgresql12+postgis 安装包
此手册主要用于记录个人进行nginx升级的步骤和心得,介绍了2种升级方式。 YUM upgrade升级:本方式适用于使用rpm安装nginx的方式,优点是升级操作简单便捷,缺点是无法升级到指定版本,默认升级至YUM安装支持的...
在完全无互联网连接的情况下,离线安装nginx。 nginx版本号:nginx-1.20.1-2.el7.x86_64 食用方法: 1.解压 2.进入解压目录 3.rpm安装全部 4.安装完成
centos安装Nginx配置 视频讲解: https://www.bilibili.com/video/BV1Zp4y1X71T?vd_source=7ba09b63e46a5f7eccd25c865fcd09b8#reply117266227680
将验证文件放置于您所配置域名(www.xxx.cn)的根目录下,折腾了好久,终于自己研究出来。现总结出来分享。centos nginx 多域名情况下,springboot jar部署。
Linux系统下安装nginx-1.14.1所需的所有包 以及rpm依赖包,安装文档 https://blog.csdn.net/weixin_41851100/article/details/89565198
非root下,离线安装nginx依赖加nginx安装包,需要先装gcc-c++
本文档详细说明了安装nginx所需要的依赖包的安装流程及可能遇到的问题,如:error while loading shared libraries: libpcre.so.0: cannot open shared object file: No such file or directory
这里记录一下自己在centos7操作系统下安装nginx的过程,以便之后学习时查阅。笔者这里的Linux服务器使用的是腾讯云服务器,本人是一名Java程序员也是Linux的初学者有什么不对的地方请多指教,以后还会有更多的关于...
centos版本7.6,nginx版本1.14.2,tomcat版本8.5.37,jdk版本1.8.0_201,实现nginx的代理,访问不同的tomcat
自己的经验总结,旨在centos下快速安装 nginx,避免走各种弯路。
如果服务器中nginx挂掉,我们如何第一时间启动它?人工重启?no。 该脚本定时检测nginx状态,挂机自动重启nginx。 如果服务器中nginx挂掉,我们如何第一时间启动它?人工重启?no。 该脚本定时检测nginx状态,...
Centos系统上 nginx 代理多个域名站点 nginx配置,多个域名解析到同一IP,服务器上启动多个服务
NULL 博文链接:https://ileson.iteye.com/blog/2160589
centos7版本离线安装nginx 压缩包内包含gcc、gcc-c++、pcre-8.00.tar.gz、openssl-fips-2.0.16.tar.gz、zlib-1.2.11.tar.gz、nginx-1.17.8.tar.gz,且有安装的说明文档,亲测可用
下载的软件版本完全相同的情况下,复制粘贴,一次完成。经过了为期一周的调试,排除掉了N多错误。终于大功告成。