Friday, May 27, 2011

Configuration and Installation of apache-solr and tomcat on your Drupal site

The Following are the steps which you will follow for the successful configuration of apache-solr and tomcat on your drupal site.

  • Download the apachsolr module from http://drupal.org/project/apachesolr and place it in your modules folder. In my case I placed it in sites/all/modules/apachesolr.
  • Download the SolrPhpClient from http://code.google.com/p/solr-php-client/downloads/list and placed inside the apachesolr module. In my case I placed it in sites/all/modules/apachesolr/SolrPhpClient.
  • Enable the Apache Solr Framework and Apache Solr Search modules.
  • Download the apache-solr from http://mirror-cybernet.lums.edu.pk/pub/apache//lucene/solr/1.4.1/ and place it any where you want but outside from your drupal site. In my case I placed it in C:\apache-solr-1.4.1.
  • Download the apache tomcat from http://tomcat.apache.org/download-70.cgi and extract it to the folder of your liking. In my case I placed it in C:\apache-tomcat-7.0.14.
  • Download the jdk from http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u25-download-346242.html and install it.
  • Rename the schema.xml, solrconfig.xml and protwords.xml to schema.bak, solrconfig.bak and protwords.bak respectively in apache-solr\example\solr\conf folder. In my case C:\apache-solr-1.4.1\example\solr\conf.
  • Copy the schema.xml, solrconfig.xml and protwords.xml from the apachesolr module folder and paste it in the apache-solr\example\solr\conf folder. In my case I copied the files form sites\all\modules\apachesolr and pasted in C:\apache-solr-1.4.1\example\solr\conf.
  • Copy the apache-solr-1.4.1.war from apache-solr\dist and paste it in apache-tomcat\webapps folder and rename it to solr.war. In my case I copied the file from the C:\apache-solr-1.4.1\dist and pasted it inside the C:\apache-tomcat-7.0.14\webapps and renamed it to solr.war.
  • Set the JAVA_HOME environmental variable by running the command “set JAVA_HOME=path/to/your/jdk”. In my case I ran the command “set JAVA_HOME= C:\program files\java\jdk1.6.0”.
  • Open the command prompt and go to the folder of apache-tomcat/bin and type startup and press enter to start the tomcat.


    Then type the shutdown and press enter to stop the apache-tomcat.


  • This will unpack the war file resulting in the folder apache-tomcat/webapps/solr. In my case C:\apache-tomcat-7.0.14\webapps\solr.
  • Open the web.xml file from apache-tomcat\webapps\solr\WEB-INF and uncomment the section specifying the solr/home environment variable and set its value to the path of your apache-solr example application folder. In my case I opened the file from C:\apache-tomcat-7.0.14\webapps\solr\WEB-INF and did the following changes.


    solr/home
    C:/apache-solr-1.4.1/example/solr
    java.lang.String


  • Open the commands prompt and go to the folder apache-solr/example and type “java –jar start.jar” and press enter to run the jdk. In my case look at the following image.

  • Now start the apache-tomcat as defined above in this document.
  • You can access the solr administration interface now at http://localhost:8080/solr/admin/.
  • Go to the path admin/settings/apachesolr of your drupal site and enable the make apache solr search the default under the advance configuration.
  • The synonyms.txt file is in apache-solr/example/solr/conf folder. In my case C:\apache-solr-1.4.1\example\solr\conf. Open the file and enter some words just like Television and TV and save the file.
  • Then go to your drupal site and run the cron to send the contents form your drupal site to the apache-solr search.
  • Then restart the jdk so that changes to the synonyms.txt file take affects.
  • Then search for those specific terms you will see the results.

    Note: Remember to run the cron every time you add some contents to your drupal site so that it makes searchable for apache-solr search.
    Now your site is ready for apache-solr search. If you get some errors or your search does not work then follow these steps carefully may be you have missed a step.
  • Thursday, February 10, 2011

    Computer tricks


    Hidden programs of windows 1- Private Character Editor  This program is for designing icons and Characters(Alphapet ) Click :start Then :run type :EUDCEDIT ............ ......... ......... ......... ......... .........  2- iExpress  This Program is for converting your files to EXCUTABLE files  Click : start Then : run type : iexpress ............ ......... ......... ......... ......... ......... 3-Disk Cleanup  This program used for cleaning harddisk to offer space  Click : start Then : run type : cleanmgr ............ ......... ......... ......... ......... .........  4-Dr Watson  This program Is for repairing problems in Windows  Click : start Then : run type : drwtsn32 ............ ......... ......... ......... ......... .........  5-Windows Media Player 5.1  Opens the old media player  Click : start Then : run type : mplay32 ............ ......... ......... ......... ......... .........  Program ............ . CODE  Character Map = charmap  DirectX diagnosis = dxdiag  Object Packager = packager  System Monitor = perfmon  Program Manager = progman  Remote Access phone book = rasphone  Registry Editor = regedt32  File siganture verification tool = sigverif  Volume Control = sndvol32  System Configuration Editor = sysedit  Syskey = syskey  microsoft Telnet Client = telnet  Hidden movie in windows xp  There is a hidden ASCII movie of STARWARS in windows xp  Go to Start-Run-type" telnet towel.blinkenlights.nl" without the quotes n enjoy the hidden movie note that there is a space between telnet n towel.  Attractive Explorer Background  Change the boring white background of the folders into attractive background like any photo. It looks kool just like this. Isnt it look so kool ?  To do this thing there's a small trick to do in your computer and its so easy, then lets start.  Copy the following to your text editor and save it as desktop.ini in the folder whose background you want to change.  [{BE098140-A513-11D0-A3A4-00C04FD706EC}] iconarea_image="complete picture location"  iconarea_text=0x00000000 <------- File text color can be set to any value just now its black.  0x00ffffff for white.  Run the following command in the command prompt  attrib +s "path of the folder"  e.g. attrib +s "E:\old download" will change the background of the folder "old download"  It would be good to keep the file desktop.ini hidden.  So right click on it > go to properties and change its atribute to hidden.  Thats it. Just try it and show the kool looks of your computer to your friends.  Isnt it Amazing trick?