Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've tried various tutorials and I get a 404 error when I finally navigate to host:port/solr on my CentOS machine.

Can anyone tell me why I would get a 404?

Once I find a solution I'll make this the official tutorial on how to install Apache Solr on a CentOS 6 / Tomcat6 configuration. In the meantime, there is very little documentation out there...

Tomcat6 Configuration (Source)

yum install tomcat6 tomcat6-webapps tomcat6-admin-webapps

vi /usr/share/tomcat6/conf/tomcat6.conf

Additionally, I've added an admin and manager role user in /etc/tomcat6/tomcat-users.xml


<Context docBase="/data/solr/solr.war" debug="0" privileged="true" allowLinking="true" crossContext="true">
<Environment name="solr/home" type="java.lang.String" value="/data/solr" override="true" />
share|improve this question
Can you outline the configuration that you've applied to Tomcat thus far? – Shane Madden Feb 23 '12 at 16:25
My Tomcat configuration appears to be minimal (see edit) – AlxVallejo Feb 23 '12 at 16:47
Also for the way the files are setup, see this page:… – AlxVallejo Feb 23 '12 at 17:11
up vote 0 down vote accepted

You must configure Tomcat to actually point to the Solr instance.

See Solr's example in their documentation:

<?xml version="1.0" encoding="utf-8"?>
<Context docBase="/opt/solr/example/solr/solr.war" debug="0" crossContext="true">
  <Environment name="solr/home" type="java.lang.String" value="/opt/solr/example/solr" override="true"/>

This should be placed in $CATALINA_HOME/conf/Catalina/localhost/solr.xml, and adjust the paths for your install locations.

share|improve this answer
This is awesome, and I'll def. accept this, but now I see that I'm getting a 500 error in my solr configuration. – AlxVallejo Feb 23 '12 at 17:38
It's trying to create the directory /usr/share/tomcat/solr/data/index and failing - what's your solr/home configured to be? – Shane Madden Feb 23 '12 at 17:41
@AlxVallejo, What user is running Tomcat? Make sure that user has permissions to the solr/home directory. – HTTP500 Feb 23 '12 at 17:49
@HTTP500, I simply created a new user in the tomcat-users.xml – AlxVallejo Feb 23 '12 at 18:05
@ShaneMadden, my solr/home is at /data/solr/ – AlxVallejo Feb 23 '12 at 18:06

Your Answer


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.