Search This Blog

Thursday, June 17, 2010

Configuring Solr with MySQL Database


Configuring with MySQL Database
1. Download jdbc driver for mysql (mysql-connector-java-5.1.12-bin.jar) put it in the “lib” folder , this is the one which is responsible for communication between MySQL db and apache Solr
2. Open data-config.xml in your conf folder under example directory (example->conf->data-config.xml) in any text editor
3.Add XML as below

4. Data source is the tag which holds the data about the connecter (which database ,user, password, url, driver etc.,), we can have many data source in a single file and use the name of data source to connect
5. Change the “Query” in the “entity” tag as you want to create index it can also use joins and db functions in it
6. There is another set of tags called “Field” which used to specify what are the column which are returned by the query is going to be used (take care in giving values to name attribute),”Column” attribute is used to map the column name to the name attribute
7. Open “schema.xml” in the same folder search for “fields” tag and remove the content of it and add your columns names as picture below

8. Tag “copyField” use to copy more than one column into a single string, In the above example we are using “text “ to hold all the values
9. Tag “uniqueKey” is used to identify the index unqiue


Apache Solr Installation and Configuration

Installation


1. Download Apache Solr Package (http://www.apache.org/dyn/closer.cgi/lucene/solr/)

2. In shell enter “tar –xvzf apache-solr-x.x.x.tgz” this step will create a folder apache-solr-x.x.x

3. Rename the folder for ease of use “mv apache-solr-x.x.x apache-solr”

4. Install JDK (requires > 1.6.0) can download from sun downloads(http://java.sun.com/javase/downloads/widget/jdk6.jsp)

5. “cd apache-solr/example/”

6. Start the servlet “Java –jar start.jar”, Long list of messages will appear at the end you can see message as follows : INFO: Started SocketConnector @ 0.0.0.0:8983

7. Check for errors in java if so please correct it and restart the server. To Stop the server use “CTRL+C”

8. If everything goes fine you should see a screen as below in your browser


Thursday, June 10, 2010

Configuring Mercury (Mail) server in windows

1.Start Mercury (using the XAMPP Control panel) and then open the admin panel.

2.first of all we disable the HTTP server of Mercury so that it doesn't conflict with the apache:
1.“Configuration” > “Protocol modules”
2.Make the settings as in picture below

3.Click “OK” and restart Mercury(Stop and start in Xampp)
4.now let's configure Mercury in general:
1.“Configuration” -> “Mercury core module”, tab “General”
2.click “OK” and leave the dialog after setting the settings as in the picture below


5.next we focus on the Mercury S SMTP Server for outgoing emails:
1.“Configuration” > “Mercury S SMTP Server”->“General”
2.“Announce myself as”: “Sundar SMTP” (this can be anything)
3.“Listen on TCP/IP port” :”25”, that's the SMTP port
4.“IP interface to use” : “127.0.0.1” and add the IP range from “127.0.0.1” till “127.0.0.1”
5.select “Allow connections”
6.“Connection Control” click on “Add restriction” then click on “OK”

6.now let's configure the Mercury P POP3 Server:
1.“Configuration”> “Mercury P POP3 Server”, select the tab “General”
2.“Listen on TCP port” > “110” and “IP interface to use” >; “127.0.0.1”
3.choose the tab “Connection control” and proceed as already written under 5.5 (see above)
4.that's it already, leave the dialog by clicking “OK”

7.“Mercury C SMTP Client”
1.“Configuration” > “Mercury C SMTP Client”
2.To send mail to external addresses we need to have an external SMTP server (I am using Google as if its available to all, we need a Google account to do so).
3.“Smart host name”, “smtp.gmail.com”
4.“Connection port/type”:
5.“Port”: 25
6.Select SSL Encryption via STARTTLS command in the select box near
7.“Login username” : Gmail user name (ex meenakshi.sun20@gmail.com)
8.“Password” :xxxxxxx







8.let's check the Mercury users that are normally pre-configured:
1.“Configuration”> “Manage local users”
2.There should be at least the users “Admin” and “postmaster”, both with administrative rights. If not you have to add them.

9.now we finished with Mercury, but we still need to configure PHP for sending mail with our scripts:
1.Open the php.ini, you find it under “xampp/php/php.ini”
2.Search for “[mail function]”...
3.and we add/adjust the following:
3.1.“SMTP = localhost”
3.2.“smtp_port = 25”
3.3.“sendmail_from = postmaster@localhost”
4.save the php.ini and restart the Apache

10.Now everything should work! But we'll test it first:
1.within Mercury choose “File” > “Send mail message” type and send a test mail
2.within the window “Mercury Core Process” we'll see our test mail at first:
2.1.“13:38:41 JOB XXXXXX: from postmaster@localhost (local) To:xxx20@gmail.com (non-local) (JOB XXXXXX) -OK”
3.the mail was received in Mercury and processed, after some seconds the window “Mercury SMTP client (relay version)” should show some actions:
3.1.“10 Jun 2010 13:39, Servicing job XXXXXX ...OK”
3.2.if you see this message, everything went fine and the mail was sent!