Apache Solr

    Solr is a popular open source enterprise search platform from the Apache Lucene project. Its major features include powerful full-text search, hit highlighting, faceted search, dynamic clustering, database integration, rich document (e.g., Word, PDF) handling, and geospatial search. Solr is highly scalable, providing distributed search and index replication, and it powers the search and navigation features of many of the world's largest internet sites.

    Quick reference card

      Cloud Servers Virtual Machines Native Installers
    Configuration file(s) /opt/bitnami/apache-solr/solr/* /opt/bitnami/apache-solr/solr/* install_dir/apache-solr/solr/*
    Default port 8983 8983 8983
    System user account solr solr solr
    Service control sudo /opt/bitnami/ctlscript.sh start|stop|restart solr sudo /opt/bitnami/ctlscript.sh start|stop|restart solr install_dir/ctlscript.sh start|stop|restart solr

    How to start/stop the Apache Solr server?

    You can use the "ctlscript.sh" utility which is in the installation directory.

    linux_platform.png On Linux:

    $ ./ctlscript.sh start solr

    mac_platform.png On OS X: There is a "control" graphical tool in the installation directory or you can use the "ctlscript.sh" utility from a Terminal.

    host:~ user$ cd /Applications/application-version
     host:~ user$ ./ctlscript.sh start solr

    The Solr server is running in the 8983 port by default. If you are trying to connect your remote application to the Solr server, check that you have not any firewall running in that port. If you are runing it in Amazon EC2, check that your security group has this port open. You get more info about how open a firewall port for Virtual Appliances.

    How to access to Sorl Admin page?

    You can access your Solr admin page by opening a browser and typing
    If you are trying to access to Solr Admin page in a Bitnami Cloud Hosting server or an Amazon Machine Image (AMI)  you can create an SSH tunnel sending your requests to your server from (localhost). Notice that this is not necessary if you have already opened port 8983 in your securitly group.
    You should follow these steps to create the tunnel:

    1. Get your SSH private key if you don't have it already. More info

    2. Create the tunnel.

    - If you are in Linux or Mac you can run the following in a console in your local machine (using your Public DNS instead of xyz.bitnamiapp.com):

    $ ssh -N -L 18983: -i bitnami-hosting.pem bitnami@xyz.bitnamiapp.com

    - If you are using Windows, you can use Putty:

    • Follow the steps described here
    • Before opening the connection. Go to Connection -> SSH -> Tunnels, enter the values below and click "Add" button:
      • Source port: "18983"
      • Destination: "localhost:8983" 
    • Click Open

    3. While the tunnel is active you can connect to the web application at in your browser.


    The default access port of Solr is closed by default for the Google Cloud Platform and the virtual machines and we only open the 80 and 443 ports so if you want to access to your server using that port you have to make some changes.

    How to disable authentication in Apache Solr server?

    In order to disable authentication in Apache Solr server, you have to edit the file installdir/apache-solr/conf/solr.conf by removing these lines:

    <LocationMatch "^/(solr)/.*?">
      AuthType Basic
      AuthName "Introduce your Apache Solr credentials. If you have problems visit: https://wiki.bitnami.com/Infrastructure_Stacks/Bitnami_Sol\
      AuthBasicProvider file
      AuthUserFile installdir/conf/password
      Require user user

    After that, restart apache using the following command:

    host:~ user$ ./ctlscript.sh restart apache

    How to enable the Apache Solr logs?

    Since 3.X version, Apache Solr log files are not enabled by default. If you want to enable the log files, you can uncomment the following section in the installdir/apache-solr/etc/jetty.xml


        <Ref id="RequestLog">
          <Set name="requestLog">
            <New id="RequestLogImpl" class="org.mortbay.jetty.NCSARequestLog">
              <Set name="filename"><SystemProperty name="jetty.logs" default="./logs"/>/yyyy_mm_dd.request.log</Set>
              <Set name="filenameDateFormat">yyyy_MM_dd</Set>
              <Set name="retainDays">90</Set>
              <Set name="append">true</Set>
              <Set name="extended">false</Set>
              <Set name="logCookies">false</Set>
              <Set name="LogTimeZone">GMT</Set>

    Getting started with Solr

    In order to execute solr commands, first you need to execute the following:

    $ sudo installdir/use_solr

    Solr contains scripts to start, stop or restart. You can execute:

    $ cd installdir/apache-solr
    $ bin/solr stop
    $ bin/solr status
    $ bin/solr start
    $ bin/solr restart 

    If you want to create a core:

    $ cd installdir/apache-solr
    $ sudo -u solr bin/solr create -c CORE_NAME -p PORT_NUMBER

    To add documents:

    $ cd installdir/apache-solr
    $ bin/post -c CORE_NAME FILES


    NOTE: Currently the bin/post tool does not have a comparable Windows script, but the underlying Java program invoked is available. See the Post Tool, Windows section for details.

    Tag page (Edit tags)
    • No tags
    Page statistics
    75151 view(s), 37 edit(s) and 9126 character(s)


    You must login to post a comment.

    Attach file