📜 ⬆️ ⬇️

Add Sphinx to Denver

Hello!

Made a small addon to Denver. Decided to share. Now, at the start, it starts Sphinx, and when it stops, it turns it off. Version: Denver 3 2008-01-13.

One could add to denwer / scripts / main / start / file.bat, where just write a couple of commands to start it. True, a little harder to stop. But I want everything to be beautiful. With the words "We are launching ... We are waiting for 2 seconds ... Done ..." Beauty!
')
So.

1. Download Sphinx. For technical reasons, I took version 0.9.7. (Sphinx 0.9.7 (Apr 02, 2007)) on sphinxsearch.com/downloads.html

2. Everything is unpacked into the sphinx folder on the same level as the denwer, home, tmp, usr folders.

3. From the console, we check the launch of searchd, search and indexer. I was asked to library libmySQL.dll. Link to which, cool uncle Andrew organized here: sphinxsearch.com/forum/view.html?id=911 Copy the library to the files of the sphinx. All OK. It starts.

4. We see that the sphinx and plans to hang a separate window. This is ugly. Find a solution at www.ntwind.com/software/utilities/hstart.html Download the application. I checked it on viruslist.ru. Does not complain. We put hstart.exe near our sphinx.

5. Since we need a sphinx on Denver only for test purposes, we make one .conf file for our indices. Now there are at least 6 files in the sphinx folder: sphinx.conf, libmySQL.dll, hstart.exe, indexer.exe, search.exe, searchd.exe.

6. Getting ready to add the whole thing to Denver.

7. Read the denwer / scripts / README.txt help. We understand the difference between the scripts / main / and scripts / reserve / folders.

8. Watch the contents of scripts / reserve / start /, scripts / reserve / stop /. We understand that it is better to add commands to the main configuration. Then everything will work with any configuration.

9. Add to the scripts / main / start / and scripts / main / stop / file 90_sphinx, in which, by analogy with the other files, it says: init.d / sphinx

10. Let's go to init.d / sphinx.pl. See examples of written scripts.

11. From sendmail.pl we take a simple startup procedure. From mysql.pl take the procedure to stop the sphinx. The only thing that you should pay attention to here, perhaps, is that this is a short pause before the launch of searchd. It is necessary for mysqld to start and start accepting requests.

12. They hurt a bit, got something like this file www.ewgenij.net/downloads/works/sphinx.pl For myself, I also added the launch of the indexer before launching searchd. So that the index is updated a little before launching this item.

All is ready :)

Ps. Recently I found where to fix a couple of lines so that hosts with www would not be created. If interested: www.ewgenij.net/denwer-no-www.html

Source: https://habr.com/ru/post/62014/


All Articles