'Apache Solr - Unable to access admin page

On mac snow leopard, I have installed Apache Solr 4.2.0 using brew and triggered the server using the below commands,

Usage: $ solr path/to/config/dir

When I try to access the admin page in browser using below link and the page with SolrCore Initialization failure occurs as below,

http://localhost:8983/solr/admin

collection1: org.apache.solr.common.SolrException:org.apache.solr.common.SolrException: Could not load config for solrconfig.xml 

The page also has message,

There are no SolrCores running.
Using the Solr Admin UI currently requires at least one SolrCore.

Any help regarding this is greatly appreciated.



Solution 1:[1]

In the root for the Solr config directory, there is a file called solr.xml. This file configures Solr cores. The file might contain:

  <cores adminPath="/admin/cores" host="${host:}" hostPort="${jetty.port:}" hostContext="${hostContext:}" zkClientTimeout="${zkClientTimeout:15000}">
    <core default="true" name="auction" instanceDir="auctionConfigDir" />
  </cores>

The important point is to match instanceDir="auctionConfigDir" with the actual path/to/config/dir. If Solr can't find the location of you configuration files, it wont be able to start a core.

Solution 2:[2]

sudo vim /opt/solr-4.8.1/example/etc/jetty.xml change

<!-- This connector is currently being used for Solr because it
      showed better performance than nio.SelectChannelConnector
      for typical Solr requests.  -->
<Call name="addConnector">
  <Arg>
      <New class="org.eclipse.jetty.server.bio.SocketConnector">
        <Set name="host">127.0.0.1</Set>
        <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
        <Set name="maxIdleTime">50000</Set>
        <Set name="lowResourceMaxIdleTime">1500</Set>
        <Set name="statsOn">false</Set>
      </New>
  </Arg>
</Call>

to

<!-- This connector is currently being used for Solr because it
      showed better performance than nio.SelectChannelConnector
      for typical Solr requests.  -->
<Call name="addConnector">
  <Arg>
      <New class="org.eclipse.jetty.server.bio.SocketConnector">
        <Set name="host">0.0.0.0</Set>
        <Set name="port"><SystemProperty name="jetty.port" default="8983"/></Set>
        <Set name="maxIdleTime">50000</Set>
        <Set name="lowResourceMaxIdleTime">1500</Set>
        <Set name="statsOn">false</Set>
      </New>
  </Arg>
</Call>

then sudo service solrd restart

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kevin
Solution 2 LF00