Mudanças entre as edições de "Solr"
De MochilaWiki
Ir para navegaçãoIr para pesquisarLinha 15: | Linha 15: | ||
cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7 | cp -R ~/solr-4.10.3/example/solr /var/lib/tomcat7 | ||
chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr | chown -R tomcat7:tomcat7 /var/lib/tomcat7/solr | ||
− | + | </source> | |
− | + | ||
+ | acrescente em antes de </tomcat-users> em /etc/tomcat7/tomcat-users.xml | ||
+ | <source lang="xml"> | ||
+ | <role rolename="manager-gui"/> | ||
+ | <role rolename="admin-gui"/> | ||
+ | <user username="your_username" password="your_password" roles="manager-gui,admin-gui,solr-gui"/> | ||
+ | </source> | ||
+ | |||
+ | 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 | service tomcat7 start | ||
− | + | ||
* [http://visaotecnologica.wordpress.com/2011/01/26/como-funciona-a-relevancia-no-solr/ Como funciona a relevância no Solr] | * [http://visaotecnologica.wordpress.com/2011/01/26/como-funciona-a-relevancia-no-solr/ Como funciona a relevância no Solr] | ||
+ | * [https://pacoup.com/2014/02/05/install-solr-4-6-with-tomcat-7-on-debian-7/ Install Solr 4.6 with Tomcat 7 on Debian 7] |
Edição das 21h01min 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