Welcome Guest | Login

Configuring Ultrasphinx on shared hosting plan

After working with the great support team here at HostingRails I wanted to share some tips for configuring Ultrasphinx to work on a shared hosting plan.

1) Sphinx may already be installed on your server. You can check this with the command "which searchd" that should return "usr/local/bin/searchd" or something close to it. If you get nothing back you should open a ticket.

2) You will need 50 MB of memory to run the Sphinx daemon. If you already have 50 MB for mongrel you will need an additional 50 MB.

3) After purchasing the additional 50 MB you will need a dedicated port for the daemon. Open a ticket to have the port set up.

4) When your port is ready you'll need to configure Ultrasphinx in yourapp/config/ultrasphinx/default.base.

5) The first line in default.base you'll want to change is the line: path = "/usr/bin/local"

You'll want to change this to a path in your Rails app.

path = "/home/username/apps/appname/current/public/system/us"

6) Next go to the section:

# Daemon options
searchd
{
 address = 0.0.0.0
 port = 3313

 (I'm omitting the rest for brevity)
 ...
}

set address = 127.0.0.1 and set the port = to the port assigned to you by HostingRails in step 3.

7) Next go to the section:

# Client options
client
{
 ...

 server_host = localhost
 server_port = 3313

 ...
}

set the server_host = 127.0.0.0 and set the port = to the port assigned by HostingRails.

8) Now it's time to start things up. Enter these commands:

rake ultrasphinx:confgure RAILS_ENV=production
rake ultrasphinx:index RAILS_ENV=production
rake ultrasphinx:daemon:start RAILS_ENV=production

If you don't get any errors with the above you can double check that the daemon is running with "ps | grep searchd".

You should be all set to go. If you get any errors when searching from your app the best place to start looking is the searchd.log.

Good luck!

2008-05-13 10:40 AM


Hello Guest! In order to post you must be an active client with us, please log in or sign up today!