一、玩转物联网--Nginx服务器搭建

来源:互联网 发布:mac 无线网卡 编辑:程序博客网 时间:2024/06/10 14:37

平台:阿里云 centos 6.8 32位

搭建LNMP环境按照参考官方的文档。LNMP环境搭建

下面是实际操作中的一些记录,流程主要按照上面的文档参考。

1,关闭SELINUX,百度原因是SELINUX会出现冲突问题。

2,安全组设置。就是在阿里云管理平台上,对HTTP需要用到的80端口进行配置。

3,安装nginx。这部分,按照nginx官方的说明来,如下

To set up the yum repository for RHEL/CentOS, create the file named /etc/yum.repos.d/nginx.repo with the following contents:

[nginx]

name=nginx repo

baseurl=http://nginx.org/packages/OS/OSRELEASE/$basearch/

gpgcheck=0

enabled=1

Replace “OS” with “rhel” or “centos”, depending on the distribution used, and “OSRELEASE” with “6” or “7”, for 6.x or 7.x versions, respectively.操作。

4,安装成功后,service nginx start,启动Nginx服务。

5,直接在浏览器输入阿里云的公网IP进行访问。结果如下图

nginx访问测试