Uploaded image for project: 'PUBLIC - Liferay Portal Community Edition'
  1. PUBLIC - Liferay Portal Community Edition
  2. LPS-43394

Configure Solr 4 web plugin for use with basic authentication fails

    Details

      Description

      1. Set 4.3.1 Solr server on tomcat server with basic authentication.

      Edit conf/tomcat-users.xml:

      <role rolename="role" />
      <user username="username" password="password" roles="role" />
      

      In solr/WEB-INF/web.xml:

      <security-constraint>
      <web-resource-collection>
      <web-resource-name>Protected Solr</web-resource-name>
      <url-pattern>/*</url-pattern>
      <http-method>GET</http-method>
      <http-method>POST</http-method>
      </web-resource-collection>
      <auth-constraint>
      <role-name>role</role-name>
      </auth-constraint>
      </security-constraint>
      <login-config>
      <auth-method>BASIC</auth-method>
      <realm-name>Basic Authentication</realm-name>
      </login-config>
      <security-role>
      <description>role</description>
      <role-name>role</role-name>
      </security-role>
      

      2. Tell Liferay Solr plugin that authentication is required. (Deploying solr4-web plugin is necessary)

      Edit Liferay_Home/webapps/solr4-web/WEB-INF/classes/META-INF/solr-spring.xml:

      	<bean id="com.liferay.portal.search.solr.server.BasicAuthSolrServer" class="com.liferay.portal.search.solr.server.BasicAuthSolrServer">
      	<constructor-arg type="java.lang.String" value="username" />
              <constructor-arg type="java.lang.String" value="password" />
      	<constructor-arg type="java.lang.String" value="http://Solr_Server_Ip/solr" />
      

      3. Restart Liferay server.
      4. Re-index.
      Result:

      107:26:38,991 WARN  [liferay/search_writer/SYSTEM_ENGINE-1][ProxyMessageListener:81] java.lang.Exception: java.lang.NoClassDefFoundError: org/apache/commons/codec/binary/Base64
      

      5. Copy commons-codec.jar to solr plugin lib folder, then re-index
      Result:

      103:00:44,678 WARN  [liferay/search_writer/SYSTEM_ENGINE-1][ProxyMessageListener:81] com.liferay.portal.kernel.search.SearchException: IOException occured when talking to server at: http://192.168.133.179:8080/solr
      

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              shitian.zhang Shitian "Shelton" Zhang (Inactive)
              Reporter:
              sunny.gao Sunny Gao
              Participants of an Issue:
              Recent user:
              Esther Sanz
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since last comment:
                7 years, 31 weeks ago

                  Packages

                  Version Package
                  6.2.X EE
                  7.0.0 M1