Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I just installed Tomcat6, and now I am trying to install Solr 3.6.1.

I copied the .war file and the example solr directory.

cd apache-solr-3.6.1/dist
cp apache-solr-3.6.1.war /usr/share/tomcat6/webapps/solr.war
cp -r /usr/local/src/apache-solr-3.6.1/example/solr /usr/local/solr

cd /usr/share/tomcat6/webapps/solr/WEB-INF
nano web.xml

Uncommented <env-entry>...</env-entry>

Replace <env-entry-value>...</env-entry-value> with <env-entry-value>/usr/local/solr</env-entry-value>

When I go to http://domain.com:8080/solr I get the error:

HTTP Status 500 - Severe errors in solr configuration. Check your log files for more detailed information on what may be wrong. If you want solr to continue after configuration errors, change: <abortOnConfigurationError>false</abortOnConfigurationError> in solr.xml ------------------------------------------------------------- java.lang.RuntimeException: java.io.IOException: Cannot create directory: /usr/local/solr/./data/index at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:403) at org.apache.solr.core.SolrCore.<init>(SolrCore.java:552) at org.apache.solr.core.CoreContainer.create(CoreContainer.java:480) at org.apache.solr.core.CoreContainer.load(CoreContainer.java:332) at org.apache.solr.core.CoreContainer.load(CoreContainer.java:216) at org.apache.solr.core.CoreContainer$Initializer.initialize(CoreContainer.java:161) at org.apache.solr.servlet.SolrDispatchFilter.init(SolrDispatchFilter.java:96) at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:295) at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422) at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115) at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:3838) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4488) at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1251) at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:613) at org.apache.catalina.manager.HTMLManagerServlet.doGet(HTMLManagerServlet.java:136) at javax.servlet.http.HttpServlet.service(HttpServlet.java:617) at javax.servlet.http.HttpServlet.service(HttpServlet.java:717) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489) at java.lang.Thread.run(Thread.java:679) Caused by: java.io.IOException: Cannot create directory: /usr/local/solr/./data/index at org.apache.lucene.store.NativeFSLock.obtain(NativeFSLockFactory.java:171) at org.apache.lucene.store.Lock.obtain(Lock.java:72) at org.apache.lucene.index.IndexWriter.<init>(IndexWriter.java:1098) at org.apache.solr.update.SolrIndexWriter.<init>(SolrIndexWriter.java:84) at org.apache.solr.core.SolrCore.initIndex(SolrCore.java:398) ... 29 more

What happened, and how can I solve this issue? Thanks!

share|improve this question

2 Answers 2

up vote 1 down vote accepted

Looks like you'll need to let the Tomcat user write to the /usr/local/solr directory.

Depending on your OS and how you installed Tomcat, the username and group that are in use will vary, but it'll be something like this:

chown -R tomcat:tomcat /usr/local/solr

Check what user owns /usr/share/tomcat6, that should point you in the right direction.

If it's still failing after that, then it's likely a problem with an alternate access control mechanism such as SELinux.

share|improve this answer
    
Works perfectly! :) –  Nyxynyx Aug 16 '12 at 6:05

I would check the permissions of folder /usr/local/solr because the log file basically tells you that it can't create a folder in that path.

The user that are running Tomcat should have permissions to read and write into /usr/local/solr and it's subfolders.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.