Sphinx is an open source search engine specially designed to provide search functionality to client applications. Sphinx can also be used for performing searches over large volumes of data easily. Sphinx can be easily integrated with SQL and XML sources. It is very good tool for querying and advanced indexes.
In this tutorial, we will show you how to install and configure sphinx on Ubuntu 16.04.
A server runing Ubuntu-16.04.
A non-root user with sudo privileges setup on your server.
Before starting, update your system to the latest version with the following command:
sudo apt-get update -ysudo apt-get upgrade -y
Once your system is up-to-date, you can easily install it with the following command:
sudo apt-get install sphinxsearch
Reading state information... Done
The following packages were automatically installed and are no longer required:
libc-ares2 libcitadel4 libev4 libical1a libsieve2-1
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
The following NEW packages will be installed:
Installing MariaDB Database
Next, you will need to install MariaDB for database functionality.
You can install it with the following command:
sudo apt-get install mariadb-server
The MariaDB default installation is not secure, so you will need to secure it first. You can secure it with the mysql_secure_installation script:
Answer all the questions as shown below:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MariaDB to secure it, we'll need the current
password for the root user. If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.
Enter current password for root (enter for none):
OK, successfully used password, moving on...
Creating the Test Database
Next, you will need to create a test database using the sample data in the SQL file provided with the package.
First, login to the database server with the following command:
mysql -u root -p
Enter the password for MariaDB root user, you should see the following output:
Welcome to the MariaDB monitor. Commands end with ; or g.
Your MariaDB connection id is 39
Server version: 10.0.27-MariaDB-0ubuntu0.16.04.1 Ubuntu 16.04
Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.
Next, create a test database and import the example SQL file.
Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will...
Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you...