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

JavaVariable

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

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

1.https://drupal.org/project/search_api

2.https://drupal.org/project/apachesolr

3.https://drupal.org/project/search_api_solr

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

<env-entry>

       <env-entry-name>solr/home</env-entry-name>

       <env-entry-value>d:\solr</env-entry-value>

       <env-entry-type>java.lang.String</env-entry-type>

    </env-entry>

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

SolrHome

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.

Code:

<html>
<head>
<title>PHP mail function</title>
</head>

<body>
<?php
if(isset($_REQUEST['submit']))
{
$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);
}
?>
</body>
<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” />
</form>
</html>

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.

History:

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

Syntax:

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