Note:
You may need to make some adjustments depending on the flavor of your unix system.
1 | Login as root |
2 | Download Sphinx. Sphinx is available through its official Web site at http://sphinxsearch.com/downloads (Our minimum required version is 2.1.1-beta) |
3 | unpack the package |
4 | cd sphinx-<version> |
5 | ./configure --enable-id64 --prefix=/usr/local/sphinx |
6 | make |
7 | Did you get Error 127 during step 5? Install gcc-c++ using the following command and then repeat step 5.
|
8 | make install |
9 | Did you get dependency errors with steps 5 or 7? Install mysql-devel using the following command and then repeat steps 5 and 7.
|
10 | Create the following directories in your sphinx install (/usr/local/sphinx/): log & data
|
1 | Upload the contents of the upload folder to the vbulletin root directory. |
2 | At the end of your vBulletin core/includes/config.php file, add the following:/* * Sphinx configuration parameters */ $config['Misc']['sphinx_host'] = '127.0.0.1'; $config['Misc']['sphinx_port'] = '9306'; $config['Misc']['sphinx_path'] = '/usr/local/sphinx'; //no trailing slash $config['Misc']['sphinx_config'] = $config['Misc']['sphinx_path'] . '/etc/vbulletin-sphinx.php'; |
3 | Upload vbulletin-sphinx.php to /usr/local/sphinx/etc/ . |
4 | Update the first line in vbulletin-sphinx.php to match your php installation path |
5 | Change $myforumroot in vbulletin-sphinx.php to the exact forum root (Example: /home/vbulletin/public_html). |
6 | Set vbulletin-sphinx.php file to executable using: chmod +x /usr/local/sphinx/etc/vbulletin-sphinx.php |
7 | Change directory to your sphinx folder using: cd /usr/local/sphinx |
8 | Start the daemon using: /usr/local/sphinx/bin/searchd --config /usr/local/sphinx/etc/vbulletin-sphinx.php |
9 | Ignore the worning about 'vbulletin_disk' index, it will be created once you ran the indexer. |
10 | To verify your Sphinx is working you can enter: ps ax | grep search[d] |
11 | If the above returned something such as: /usr/local/sphinx/bin/searchd --config... the daemon is running. |
12 | Go to your AdminCP->Options->Search Type. In the drop down, select Sphinx Search, then hit go. |
Note:
Note: Do not upload your vbulletin-sphinx.php to a web accessible URL. Doing so would give away your database details. If you follow these exact instructions, it will not be in a web accessible URL.
Warning:
If you adjust any of your config.php credentials you will need to restart your Sphinx daemon.
"Sphinx is a system-wide service, similar with MySQL database. It shouldn't be installed in the web-root. Also, from vBulletin guide what I see is missing it's adding it as service ( to start at boot in case server restarts)."
Let me know what VB says, if there's some quick code change, we can do it.
Also to know: their guide is a bit incomplete.
They say Sphinx should be started with:
/locationto/bin/searchd -c /localionto/etc/vbulletin-sphinx.php
However, the admin interface runs for full reindexing:
/locationto/bin/indexer -c /localionto/etc/vbulletin_sphinx.conf --rotate --all I think they do this because of compatibility with Windows, you can't run scripted configs (like on linux).
So if any change is done to vbulletin-sphinx.php , after that it should be ran:
php vbulletin-sphinx.php > vbulletin_sphinx.conf
The /locationto/ is /usr/local/sphinx
And another important thing: searchd needs to run under the 'www-data' user ( the web user). This is needed for full reindexing from the VB Admin, otherwise it will give a permission error (however partial reindexing works, because it inserts/replace data in the RealTime index).