赞
踩
1、修改配置文件
]# vim /usr/local/nginx/conf/nginx.conf
-
- 35 server {
-
- 36 listen 80;
-
- 37 server_name localhost;
-
- 38 auth_basic "xxx"; #认证用户
-
- 39 auth_basic_user_file "/usr/local/nginx/pass"; #认证密码
- ]# yum -y install httpd-tools
-
-
-
- ]# htpasswd -c /usr/local/nginx/pass tom #创建tom用户 注:第二次创建不用加-c
-
- New password:
-
- Re-type new password:
-
- Adding password for user tom
]# /usr/local/nginx/sbin/nginx -s reload
验证登录网页验证
http://192.168.4.50/index.html
]# vim /usr/local/nginx/conf/nginx.conf
- 35 server {
-
- 36
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。