Posts

Apache Solr Installation

Image
Hi Friends, In Last post we discuss about the Apache Solr and its features. Now in this post we will discuss about its Setup. Setup    As the very first step, you should follow the  official tutorial  which covers the basic aspects of any search use case: Indexing - Get the data of any form into Solr. Examples: JSON, XML, CSV and SQL-database. This step creates the inverted index - i.e. it links every term to its documents. Querying - Ask Solr to return the most relevant documents for the users' query To follow the  official tutorial  you'll have to download  Java  and the latest version of Solr  here . More information about installation is available at the  official description . Next you'll have to decide which web server you choose for Solr. In the official tutorial, Jetty is used, but you can also use Tomcat/Jboss.  Indexing If you've followed the   official tutorial   you have pushed some X...

Apache Solr - Open Source Search Engine

Apache Solr Solr   is an open source enterprise search platform from the  Apache Lucene  project. Its major features include full-text search, hit highlighting,faceted search, dynamic clustering, database integration, and rich document (e.g., Word, PDF) handling. Providing distributed search and index replication, Solr is highly scalable.Solr is the most popular enterprise search engine. Solr 4 adds NoSQL features.  Solr is written in Java and runs as a standalone full-text search server within a servlet container such as Apache Tomcat, Jboss or Jetty. Solr uses the Lucene Java search library at its core for full-text indexing and search, and has REST-like HTTP/XML and JSON APIs that make it usable from most popular programming languages. Solr's powerful external configuration allows it to be tailored to many types of application without Java coding, a...

How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog

How to Read MySQL Binary Log Files (BinLog) with mysqlbinlog? MySQL database server generates binary log files for every transaction to the databases, provided administrator does not disable or comment out the “log-bin” parameter in my.cny configuration file. The binary log files are written in binary format. Although the binary logs, or also known as logbin are mainly used for MySQL database replication purpose, sometimes you may need to examine or read the contents of binary logs in text format, where the mysqlbinlog utility will come in handy. Binary log file, which normally has name with the format host_name-bin.xxxxxx and will be store in your data directory,  could not be opened and read straight away as it’s in unreadable binary format. To read the binary logs in text format, we can make use of mysqlbinlog command, which also able to readrelay log files written by a slave server in a replication setup. Relay logs have the same format as binary log files. ...

Show Real IP in Apache Access Log (CDN)

Image
Recently we have got some DDoS attacks on our FIREWALL and we want to find out the Source IP from where we were getting these attacks.  Since we are using CDN(Content Delivery Network) and maximum of static contents are being served from CDN. So we will not be able get source IPs in our logs and  we need to see the real IP to make sure we can do some log processing accurately. The Level3 CDN basically working like example below: Level 3 Edge Server will work as the reverse-proxy to cache the website contents from requests they received on their edge servers anywhere around the world. This will speed up the website loading page and decrease the server load of the web server. The only problem of this implementation is that you can only seen Level3,s IP connecting to your web server. As the web server has no information about the source IP unless the edge server (CDN provider) gives it a header on the HTTP request to specify it. Then we have asked LEVEL3 t...

Some Curl Tips

cURL A command line tool for getting or sending files using URL syntax. Since cURL uses libcurl, it supports a range of common Internet protocols, currently including HTTP, HTTPS, FTP, FTPS, SCP, SFTP, TFTP, LDAP, LDAPS, DICT, TELNET, FILE, IMAP, POP3, SMTP and RTSP (the last four only in versions newer than 7.20.0 or 9 February 2010). The name of the project is a play on 'Client for URLs', originally with URL spelled in uppercase to make it obvious that it deals with URLs. The fact that it can also be pronounced 'see URL' also helped; it works as an abbreviation for "Client URL Request Library" or the recursive version: "Curl URL Request Library". Daniel Stenberg started writing cURL in 1997, as a way to transfer files via protocols such as HTTP, FTP, Gopher, and many more, via a command-line interface. Several other people made important and crucial contributions to the project. Distributed under the MIT License, cURL is free ...

Working with Manifest Files: The Basics

Working with Manifest Files: The Basics JAR files support a wide range of functionality, including electronic signing, version control, package sealing, and others. What gives a JAR file this versatility? The answer is the JAR file's  manifest . The manifest is a special file that can contain information about the files packaged in a JAR file. By tailoring this "meta" information that the manifest contains, you enable the JAR file to serve a variety of purposes. This lesson will explain the contents of the manifest file and show you how to work with it, with examples for the basic features: Understanding the Default Manifest When you create a JAR file, a default manifest is created automatically. This section describes the default manifest. Modifying a Manifest File This section shows you the basic method of modifying a manifest file. The later sections demonstrate specific modifications you may want to make. Setting Package Version Information...

Setting Package Version Information

Setting Package Version Information You may need to include package version information in a JAR file's manifest. You provide this information with the following headers in the manifest: Headers in a manifest Header Definition Name The name of the specification. Specification-Title The title of the specification. Specification-Version The version of the specification. Specification-Vendor The vendor of the specification. Implementation-Title The title of the implementation. Implementation-Version The build number of the implementation. Implementation-Vendor The vendor of the implementation. One set of such headers can be assigned to each package. The versioning headers should appear directly beneath the  Name  header for the package. This example shows all the versioning headers: Name: java/util/ Specification-Title: Java Utility Classes Specification-Version: 1.2 Specification-Vendor: Example Tech, Inc. Implementation-Title: java.util Implementation-V...

Understanding the Default Manifest

Understanding the Default Manifest When you create a JAR file, it automatically receives a default manifest file. There can be only one manifest file in an archive, and it always has the pathname META-INF/MANIFEST.MF When you create a JAR file, the default manifest file simply contains the following: Manifest-Version: 1.0 Created-By: 1.6.0 (Sun Microsystems Inc.) These lines show that a manifest's entries take the form of "header: value" pairs. The name of a header is separated from its value by a colon. The default manifest conforms to version 1.0 of the manifest specification and was created by the 1.6.0 version of the JDK. The manifest can also contain information about the other files that are packaged in the archive. Exactly what file information should be recorded in the manifest depends on how you intend to use the JAR file. The default manifest makes no assumptions about what information it should record about other files. Digest information ...

Modifying a Manifest File(JAR)

Modifying a Manifest File within JAR : You use the  m  command-line option to add custom information to the manifest during creation of a JAR file. This section describes the  m  option. The Jar tool automatically puts a default manifest with the pathname  META-INF/MANIFEST.MF  into any JAR file you create. You can enable special JAR file functionality, such as package sealing, by modifying the default manifest. Typically, modifying the default manifest involves adding special-purpose  headers  to the manifest that allow the JAR file to perform a particular desired function. To modify the manifest, you must first prepare a text file containing the information you wish to add to the manifest. You then use the Jar tool's  m  option to add the information in your file to the manifest. Warning:  The text file from which you are creating the manifest must end with a new line or carriage return. The last li...

JAR(Java Archive) Command in *nix

Image
JAR  ( J ava  AR chive) is an  archive file format  typically used to aggregate many  Java class files  and associated  metadata  and resources (text, images and so on) into one file to distribute  application software  or  libraries  on the  Java platform .                JAR files are built on the  ZIP file format  and have the  .jar   file extension . Computer users can create or extract JAR files using the  jar  command that comes with a  JDK . They can also use zip  tools to do so; however, the order of entries in the zip file headers is important when compressing, as the manifest often needs to be first. Creating a JAR File The basic format of the command for creating a JAR file is: jar cf jar-file input-file(s) The options and arguments used in this command are: The  c  option indicates that you want t...