当前位置: 首页 > news >正文

整站seo排名公司潍坊今日头条新闻

整站seo排名公司,潍坊今日头条新闻,div+css网页布局,宿迁网站设计目录 5.1.Ngnix配置基于用户访问控制的多虚拟主机 5.1.1.前提条件 5.1.2.Ngnix配置基于用户访问控制的多虚拟主机 5.2.Ngnix配置基于IP的虚拟主机 5.3.Ngnix配置基于IP的多虚拟主机 Nginx配置文件在/usr/local/nginx/conf下,文件名为nginx.conf 5.1.Ngnix配置…

目录

5.1.Ngnix配置基于用户访问控制的多虚拟主机

5.1.1.前提条件

5.1.2.Ngnix配置基于用户访问控制的多虚拟主机

5.2.Ngnix配置基于IP的虚拟主机

5.3.Ngnix配置基于IP的多虚拟主机


Nginx配置文件在/usr/local/nginx/conf下,文件名为nginx.conf

5.1.Ngnix配置基于用户访问控制的多虚拟主机

5.1.1.前提条件

Ngnix配置基于用户访问控制的多虚拟主机时,需要使用htpasswd命令,需要安装httpd-tools rpm

命令:

yum install -y httpd-tools

[root@cent79-2 ~]# yum install -y httpd-tools
Failed to set locale, defaulting to C
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile* base: mirrors.aliyun.com* centos-sclo-rh: mirrors.huaweicloud.com* centos-sclo-sclo: mirrors.huaweicloud.com* extras: mirrors.aliyun.com* updates: mirrors.aliyun.com
Resolving Dependencies
--> Running transaction check
---> Package httpd-tools.x86_64 0:2.4.6-99.el7.centos.1 will be installed
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-tools-2.4.6-99.el7.centos.1.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-tools-2.4.6-99.el7.centos.1.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.4.8-7.el7 will be installed
---> Package apr-util.x86_64 0:1.5.2-6.el7_9.1 will be installed
--> Finished Dependency ResolutionDependencies Resolved=============================================================================================================Package                  Arch                Version                             Repository            Size
=============================================================================================================
Installing:httpd-tools              x86_64              2.4.6-99.el7.centos.1               updates               94 k
Installing for dependencies:apr                      x86_64              1.4.8-7.el7                         CentOS7              104 kapr-util                 x86_64              1.5.2-6.el7_9.1                     updates               92 kTransaction Summary
=============================================================================================================
Install  1 Package (+2 Dependent packages)Total download size: 290 k
Installed size: 584 k
Downloading packages:
(1/2): apr-util-1.5.2-6.el7_9.1.x86_64.rpm                                            |  92 kB  00:00:00     
(2/2): httpd-tools-2.4.6-99.el7.centos.1.x86_64.rpm                                   |  94 kB  00:00:00     
-------------------------------------------------------------------------------------------------------------
Total                                                                        356 kB/s | 290 kB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transactionInstalling : apr-1.4.8-7.el7.x86_64                                                                    1/3 Installing : apr-util-1.5.2-6.el7_9.1.x86_64                                                           2/3 Installing : httpd-tools-2.4.6-99.el7.centos.1.x86_64                                                  3/3 Verifying  : apr-util-1.5.2-6.el7_9.1.x86_64                                                           1/3 Verifying  : apr-1.4.8-7.el7.x86_64                                                                    2/3 Verifying  : httpd-tools-2.4.6-99.el7.centos.1.x86_64                                                  3/3 Installed:httpd-tools.x86_64 0:2.4.6-99.el7.centos.1                                                                 Dependency Installed:apr.x86_64 0:1.4.8-7.el7                         apr-util.x86_64 0:1.5.2-6.el7_9.1                        Complete!
[root@cent79-2 ~]# 

5.1.2.Ngnix配置基于用户访问控制的多虚拟主机

-->进入/usr/local/nginx/conf目录

命令:

cd /usr/local/nginx/conf

pwd

[root@cent79-2 conf]# cd /usr/local/nginx/conf/
[root@cent79-2 conf]# pwd
/usr/local/nginx/conf
[root@cent79-2 conf]#

-->编辑nginx.conf,并保存

命令:

vi nginx.conf

--> 验证nginx.conf语法的正确性

命令:

nginx -t

[root@cent79-2 conf]# nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful
[root@cent79-2 conf]# 

-->创建用户访问控制文件

命令:

htpasswd -c /usr/local/nginx/conf/nginxpasswd ztj

[root@cent79-2 conf]# htpasswd -c /usr/local/nginx/conf/nginxpasswd ztj
New password: 
Re-type new password: 
Adding password for user ztj
[root@cent79-2 conf]# cat /usr/local/nginx/conf/nginxpasswd
ztj:$apr1$bKLsHgJ3$X8j4Buj2KCw4ojcm3HuTX1
[root@cent79-2 conf]# 

备注:

如果创建多个用户访问控制时,后续命令为:

htpasswd  /usr/local/nginx/conf/nginxpasswd USERNAME

-->重启nginx

命令:

nginx -s stop

nginx

[root@cent79-2 conf]# nginx -s stop
[root@cent79-2 conf]# ps -ef |grep nginx
root       1354   1245  0 15:39 pts/0    00:00:00 grep --color=auto nginx
[root@cent79-2 conf]# nginx
[root@cent79-2 conf]# ps -ef |grep nginx
root       1356      1  0 15:39 ?        00:00:00 nginx: master process nginx
nginx      1357   1356  0 15:39 ?        00:00:00 nginx: worker process
root       1359   1245  0 15:40 pts/0    00:00:00 grep --color=auto nginx
[root@cent79-2 conf]# 

-->验证

http://www.itztj.com

输入通过htpasswd命令创建的用户控制文件的用户名和密码

http://www.itxiaohei.com

 输入通过htpasswd命令创建的用户控制文件的用户名和密码

5.2.Ngnix配置基于IP的虚拟主机

 -->进入/usr/local/nginx/conf目录

命令:

cd /usr/local/nginx/conf

pwd

[root@cent79-2 conf]# cd /usr/local/nginx/conf/
[root@cent79-2 conf]# pwd
/usr/local/nginx/conf
[root@cent79-2 conf]#

-->编辑nginx.conf,并保存

命令:

vi nginx.conf

 --> 验证nginx.conf语法的正确性

命令:

nginx -t

[root@cent79-2 conf]# nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful
[root@cent79-2 conf]# 

-->重新加载nginx

命令:

nginx -s reload

[root@cent79-2 conf]# nginx -s reload
[root@cent79-2 conf]# ps -ef |grep nginx
root       1591      1  0 16:04 ?        00:00:00 nginx: master process nginx
nginx      1594   1591  0 16:04 ?        00:00:00 nginx: worker process
root       1596   1182  0 16:05 pts/0    00:00:00 grep --color=auto nginx
[root@cent79-2 conf]# 

-->验证

curl 192.168.10.156

[root@cent79-2 conf]# curl 192.168.10.156
I am itztj
[root@cent79-2 conf]# 

宿主机验证

5.3.Ngnix配置基于IP的多虚拟主机

 -->进入/usr/local/nginx/conf目录

命令:

cd /usr/local/nginx/conf

pwd

[root@cent79-2 conf]# cd /usr/local/nginx/conf/
[root@cent79-2 conf]# pwd
/usr/local/nginx/conf
[root@cent79-2 conf]#

-->编辑nginx.conf,并保存

命令:

vi nginx.conf

 --> 验证nginx.conf语法的正确性

命令:

nginx -t

[root@cent79-2 conf]# nginx -t
nginx: the configuration file /usr/local/nginx//conf/nginx.conf syntax is ok
nginx: configuration file /usr/local/nginx//conf/nginx.conf test is successful
[root@cent79-2 conf]# 

-->重新加载nginx

命令:

nginx -s reload

[root@cent79-2 conf]# nginx -s reload
[root@cent79-2 conf]# ps -ef |grep nginx
root       1591      1  0 16:04 ?        00:00:00 nginx: master process nginx
nginx      1594   1591  0 16:04 ?        00:00:00 nginx: worker process
root       1596   1182  0 16:05 pts/0    00:00:00 grep --color=auto nginx
[root@cent79-2 conf]# 

 -->验证

http://www.shuangfujiaoyu.com/news/50285.html

相关文章:

  • 网站上传到虚拟服务器啥是网络推广
  • 市委宣传部全称seo外包公司专家
  • 网上购物商城网站建设河北百度seo关键词
  • 怎么做网站安全运维有哪些免费推广网站
  • 网站h1标签怎么做推广app接单网
  • 微博推广会被别人看出来吗谷歌seo推广
  • 网站做跳转在后天那个文件里做今日国内新闻最新消息10条
  • 货源一件代发从哪里找整站优化包年
  • 怎么用记事本做钓鱼网站青岛网站设计公司哪家好
  • 手机做炫光图头像的网站乔拓云网微信小程序制作
  • 水果网站建设批量查询收录
  • 猪八戒设计网站如何做兼职怎样才能在百度上发布信息
  • 网站售后服务内容百度入口
  • 个人制作网站多少钱app推广拉新平台
  • 类似互推商盟的推广平台广州网站快速优化排名
  • 用jsp做网站一般会用到什么产品设计
  • 网站规划与建设广告公司注册
  • 微信小程序搭建平台有哪些seo课培训
  • 个人做盈利网站网站服务公司
  • 网站建设的成功经验百度提交工具
  • 传奇网页版游戏开服表做seo有什么好处
  • 个人备案做电影网站seo的工作流程
  • 网站的点击率怎么查网站排名推广
  • 企业网上商城推广排名seo
  • 手机网站搭建多少钱seo是什么技术
  • 有没有专业做二维码连接网站在站长工具是干嘛的
  • 创新驱动发展战略的内容seo网站关键词优化工具
  • dedecms制作网站地图优秀软文范例100字
  • 公安局网站建设的必要性自媒体论坛交流推荐
  • 国外设计网站pinterest下载seo对网店推广的作用