Mudanças entre as edições de "Solr"

De MochilaWiki
Ir para navegaçãoIr para pesquisar
Linha 28: Linha 28:
 
acrescente antes de </web-app> no arquivo /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml
 
acrescente antes de </web-app> no arquivo /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml
  
 +
<source lang="xml">
 
<security-constraint>
 
<security-constraint>
 
   <web-resource-collection>
 
   <web-resource-collection>
Linha 47: Linha 48:
 
   <auth-method>BASIC</auth-method>
 
   <auth-method>BASIC</auth-method>
 
</login-config>
 
</login-config>
 
+
</source>
  
 
reinicie o tomcat
 
reinicie o tomcat
 
+
<source lang="bash">
 
service tomcat7 start
 
service tomcat7 start
 
+
</source>
  
  

Edição das 21h02min de 9 de janeiro de 2015

No debian wheezy é possível instalar assim

apt-get install solr-tomcat

mas a versão padrão é 3.6.0, bem antiga, pois atualmente está na versão 4.10.3

outra forma de instalação

apt-get install openjdk-7-jre-headless tomcat7 tomcat7-admin
curl http://archive.apache.org/dist/lucene/solr/4.10.3/solr-4.10.3.tgz | tar xz
cp ~/solr-4.10.3/example/lib/ext/* /usr/share/tomcat7/lib/
cp ~/solr-4.10.3/dist/solr-4.10.3.war /var/lib/tomcat7/webapps/solr.war
cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7
chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr

acrescente em antes de </tomcat-users> em /etc/tomcat7/tomcat-users.xml

<role rolename="manager-gui"/>
<role rolename="admin-gui"/>
<user username="your_username" password="your_password" roles="manager-gui,admin-gui,solr-gui"/>

altere your_username e your_password

acrescente antes de </web-app> no arquivo /var/lib/tomcat7/webapps/solr/WEB-INF/web.xml

<security-constraint>
  <web-resource-collection>
    <web-resource-name>Solr GUI Authentication</web-resource-name>
    <url-pattern>/*</url-pattern>
    <http-method>GET</http-method>
    <http-method>POST</http-method>
  </web-resource-collection>
  <auth-constraint>
    <role-name>solr-gui</role-name>
  </auth-constraint>

  <user-data-constraint>
    <transport-guarantee>NONE</transport-guarantee>
  </user-data-constraint>
</security-constraint>

<login-config>
  <auth-method>BASIC</auth-method>
</login-config>

reinicie o tomcat

service tomcat7 start