码迷,mamicode.com
首页 > Web开发 > 详细

[web][nginx] 初识nginx

时间:2017-05-12 13:28:14      阅读:162      评论:0      收藏:0      [点我收藏+]

标签:span   color   默认   dex   更改   访问   https   配置文件   ase   

 

 

环境 CentOS 7 X86

文档:

  https://nginx.org/en/docs/

安装:  

[root@dpdk ~]# cat /etc/yum.repos.d/nginx.repo 
[nginx]
name=nginx repo
baseurl=http://nginx.org/packages/centos/7/$basearch/
gpgcheck=0
enabled=1
[root@dpdk ~]# 
[root@dpdk ~]# yum install nginx

 

配置文件: 默认不需要更改

[root@dpdk ~]# vim /etc/nginx/nginx.conf 
[root@dpdk ~]# vim /etc/nginx/conf.d/default.conf

 

启动:

# nginx
或
# systemctl start nginx

浏览器直接访问即可。

 

自定义页:拷贝至配置文件指定的目录后,就可以在浏览器中访问了。

[root@dpdk html]# pwd
/usr/share/nginx/html
[root@dpdk html]# ll
total 40
-rw-r--r--. 1 root root   537 Apr 12 23:23 50x.html
-rw-r--r--. 1 root root  2595 May 12 11:37 index_a.html
-rw-r--r--. 1 root root   620 May 12 11:40 index.html
-rw-r--r--. 1 root root 25987 May 12 11:38 lonely.jpg
[root@dpdk html]# 

如: http://192.168.7.4/index_a.html

 

[web][nginx] 初识nginx

标签:span   color   默认   dex   更改   访问   https   配置文件   ase   

原文地址:http://www.cnblogs.com/hugetong/p/6844844.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!