solr-web界面增加登录认证

目录

  • 配置tomcat-user.xml
  • 配置web.xml
  • 界面展示

回到顶部

配置tomcat-user.xml

找到 tomcat 下 conf 文件下增加 tomcat-user.xml

<?xml version=‘1.0‘ encoding=‘utf-8‘?>
<!--
  Licensed to the Apache Software Foundation (ASF) under one or more
  contributor license agreements.  See the NOTICE file distributed with
  this work for additional information regarding copyright ownership.
  The ASF licenses this file to You under the Apache License, Version 2.0
  (the "License"); you may not use this file except in compliance with
  the License.  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
-->
<tomcat-users>
<!--
  NOTE:  By default, no user is included in the "manager-gui" role required
  to operate the "/manager/html" web application.  If you wish to use this app,
  you must define such a user - the username and password are arbitrary.
-->
<!--
  NOTE:  The sample user and role entries below are wrapped in a comment
  and thus are ignored when reading this file. Do not forget to remove
  <!.. ..> that surrounds them.

  <role rolename="tomcat"/>
  <role rolename="role1"/>
  <user username="tomcat" password="tomcat" roles="tomcat"/>
  <user username="both" password="tomcat" roles="tomcat,role1"/>
  <user username="role1" password="tomcat" roles="role1"/>
-->
<user username="admin" password="wodemima" roles="admin,manager"/>
</tomcat-users>

username 你的用户名

password 你的密码

roles 你的用户界别

回到顶部

配置web.xml

配置 solr 下 WEB-INFO 下的web.xml,在最后增加下面代码

<security-constraint>
    <web-resource-collection>
        <web-resource-name>Restrict access to Solr admin</web-resource-name>
        <url-pattern>/admin/*</url-pattern>
        <http-method>DELETE</http-method>
        <http-method>GET</http-method>
        <http-method>POST</http-method>
        <http-method>PUT</http-method>
    </web-resource-collection>
    <auth-constraint>
        <role-name>manager</role-name>
    </auth-constraint>
    <user-data-constraint>
        <transport-guarantee>NONE</transport-guarantee>
    </user-data-constraint>
</security-constraint>
<login-config>
        <auth-method>BASIC</auth-method>
        <realm-name>default</realm-name>
</login-config>

回到顶部

界面展示

之后重启tomcat,访问界面,就会出现一下界面:

输入你自己设定的用户和密码即可进行登录。

除了这种方法还可以增加negix方向代理。个人觉得negix反向代理更安全。

时间: 2024-08-02 01:18:55

solr-web界面增加登录认证的相关文章

shiro实现APP、web统一登录认证和权限管理

先说下背景,项目包含一个管理系统(web)和门户网站(web),还有一个手机APP(包括Android和IOS),三个系统共用一个后端,在后端使用shiro进行登录认证和权限控制.好的,那么问题来了web和APP都可以用shiro认证吗?两者有什么区别?如果可以,解决方案是什么?看着大家焦急的小眼神,接下来挨个解决上面的问题. web和APP可以用shiro统一登录认证吗? 可以.假如web和APP都使用密码登录的话,那没的说肯定是可以的,因为对于shiro(在此不会介绍shiro详细知识,只介

SpringMVC拦截器实现登录认证

博客以Demo的形式讲诉拦截器的使用 项目结构如图: 需要的jar:有springMVC配置需要的jar和jstl需要的jar SpringMVC包的作用说明: aopalliance.jar:这个包是AOP联盟的API包,里面包含了针对面向切面的接口.通常spring等其它具备动态织入功能的框架依赖这个jar spring-core.jar:这个jar 文件包含Spring 框架基本的核心工具类.Spring 其它组件要都要使用到这个包里的类,是其它组件的基本核心 ,当然你也可以在自己的应用系

SpringMVC拦截器实现登录认证(转发)

感谢原作者,转发自:http://blog.csdn.net/u014427391/article/details/51419521 以Demo的形式讲诉拦截器的使用 项目结构如图: 需要的jar:有springMVC配置需要的jar和jstl需要的jar SpringMVC包的作用说明: aopalliance.jar:这个包是AOP联盟的API包,里面包含了针对面向切面的接口.通常spring等其它具备动态织入功能的框架依赖这个jar spring-core.jar:这个jar 文件包含Sp

关于ASP.Net Core Web及API身份认证的解决方案

6月15日,在端午节前的最后一个工作日,想起有段日子没有写过文章了,倒有些荒疏了.今借夏日蒸蒸之气,偷得浮生半日悠闲.闲话就说到这里吧,提前祝大家端午愉快(屈原听了该不高兴了:))!.NetCore自发布以来,颇受关注,现在.Net Core2.0已经正式发布,边迫不及待的将.Net跨平台移植的工作进行到底.想来,也费不了多少事儿.我经常和同事们说,要敢于尝试新鲜事物,不阴损守旧,方能使自己不断进步,站在队伍的前列.下面就关于Asp.Net Core在Web 及API项目上身份认证的问题做下简单

solr基于tomcat增加主界面登录权限

tomcat-user.xml增加下面标签(用户名,密码,角色)<user username="admin" password="new-password" roles="admin"/> 在D:\apache-tomcat-6.0.37-windows-x64\apache-tomcat-6.0.37\webapps\solr\WEB-INF\web.xml增加 <security-constraint> <web

利用hadoop1.x集群进行探索性实验(一)【对WEB监控界面增加安全机制】

这个实验我选择了简单的做法,并没有用到kerkeros.本人会努力,尽快学会用到kerkeros给hadoop增加安全机制,使我的小象不再“裸奔”. 首先是打开hdfs-site.xml,然后加入如下属性.最后设置登录用户名.就是在设置hadoop.http.authentication.signature.sercet.file属性时指定的目录文件,在文件中写入用于登录的用户名.我这里填的是leung.登录时在网址后面加上“?user.name=leung”即可访问. 接着启动集群,并且关闭开

WEB应用的安全的登录认证

前些日子看到一个关于安全登录认证的博文,不过该文提到的登录认证算法有点复杂,而且仍然存在一些安全缺陷.想到之前了解过的HMAC算法,我觉得完全可以使用基于HMAC算法来进行WEB应用的安全的登录认证.所谓安全,其实主要是解决一个问题:在基于明文传输的HTTP协议下隐藏用户输入的密码.当然,同时还需要考虑到用户密码在服务器端同样不能以明文保存. 也许有人会想到一个最简单的想法:在服务器端把密码用HASH算法(比如MD5.SHA1.SHA256等)加密之后保存,在客户端同样对用户密码进行HASH之后

Cobbler 登录web界面提示报错“Internal Server Error”

在访问cobbler web界面到时候出现以下提示 ssl的报错日志如下: [[email protected] ~]# tail -f /var/log/httpd/ssl_error_log [Mon Jan 07 16:24:53.363029 2019] [:error] [pid 3383] [remote 10.0.0.1:212] mod = importlib.import_module(self.SETTINGS_MODULE) [Mon Jan 07 16:24:53.363

iview-admin 2.1 + django 2.1 (一) 登录认证+修改请求头

登录认证+修改请求头 前端 登录 config/index.js dev: 后端地址 api/user.js const data = { username: userName.valueOf(), password } 请求头设置 libs/axios.js interceptors (instance, url) { // 请求拦截 instance.interceptors.request.use(config => { // 添加全局的loading... 增加下面的 if (url !