Apache solr search Configuration with Drupal 7 Complete Guide

I am using Windows machine so make sure you should download required java and apache tomcat version according to your setup.

To configure Solr Search on Drupal site we need:-

After download install java and Apache tomcat on local machine.

You need to set up java path in System Variable


After that you can install Apache Tomcat as it needed java home path.

Install Drupal 7 module for Apache solr and its dependent module:




Enable all these modules in drupal 7 site.

You can install Apache tomcat at any location like “D:/Apache Tomact”

Once you have done with this setup.You need to check whether Your server is running or not.

So for that go to D:/Apache Tomcat/bin and double click on startup.bat .It will start your apache server.

Type localhost:8080 in your browser and see apache server main screen.

Apache server settings:

Here you can see three options

  1. Server Status
  2. Manager App
  3. Host manager

Click on each and it will ask you for the UserName and Password.Cancel each time and copy the code which will

appear on the browser it will look like this:

<role rolename="manager-gui"/>
<user username="tomcat" password="s3cret" roles="manager-gui"/>

Copy all these lines to D:\Apache Tomcat\conf\tomcat-users.xml under tomcat-users section for each option.
Restart tomcat and then try to access above options with given username and password.
Now we need to setup solr server,Extract the downloaded solr server anywhere like i am extracting it on "D:/solr".
The folder will have solr folder inside it which is our solr server.Open the conf folder here you will find list of files.
Now from Apachesolr module(....\sites\all\modules\apachesolr\solr-conf\solr-3.x) which is installed on drupal site copy schema.xml,solrconfig.xml,protwords.txt to "D:\solr\conf\".
Deploy(Extract) solr.war file from D:\solr\webapps\solr.war to tomcat server.Let me tell you how to do it, open localhost:8080, goto 
Manager App it will ask you username and password generally it is 'tomcat' and 's3cret'
There you will find War file to deploy option,browse solr.war file from "D:\solr\webapps" and deploy it.
After that modify the file "D:\Apache Tomcat\webapps\solr\WEB-INF\web.xml" as






Restart tomcat and then check localhost:8080/solr you will see,


So now your solr server is running properly.

Now we need to Configure Apache Solr module in Drupal 7 site.



PHP mailing script

Hello dear friends.Here i am adding script for sending mail from php.


<title>PHP mail function</title>

$to = $_REQUEST[‘MyEmail’] ;
$subject = $_REQUEST[‘subject’] ;
$greeting = $_REQUEST[‘greeting’] ;
$realname = $_REQUEST[‘realname’] ;
$HisEmail = $_REQUEST[‘HisEmail’] ;
$message = $_REQUEST[‘message’] ;
$greeting.”\n”.”\n”.$realname.”\n”.”\n”.$HisEmail.”\n”.”\n”.$message, $headers);

$headers = ‘From: ‘.$to.”\r\n”.

‘Reply-To: ‘.$HisEmail.”\r\n” ;
@mail($HisEmail, $subject, $greetings, $headers);
<form name=”form1″ method=”post” action=”email.php”>
MyEmail:<input type=”text” name=”MyEmail” />
Subject:<input type=”text” name=”subject” />
Greeting:<input type=”text” name=”greeting” />
RealName:<input type=”text” name=”realname” />
HisEmail:<input type=”text” name=”HisEmail” />
Message:<input type=”text” name=”message” />
<input type=”submit” name=”submit” value=”submit” />

PHP Beginners Tutorial

Basic Introduction:

  • PHP stands for Hypertext Preprocessor/Personal Home Page
  • PHP is known as a server-sided language.
  • PHP programs doesn’t get executed on your computer, but on the computer you requested the page from.
  • The results are then handed over to you, and displayed in your browser.
  • Examples of other scripting languages are ASP,Perl,Python.


  • PHP was developed by RASMUS LERDORF in 1995.
  • Licencing under:PHP
  • current version:5.4


Php programs start with ‘<?php’ and end with ‘?>’ symbol.we can use short hand operator like ‘<?’ in place of ‘<?php’.