Where can i find /usr/local/etc/

Started by ryan_dwight, February 02, 2013, 04:17:05 PM

Previous topic - Next topic

ryan_dwight

i dont know if this is the right board or allowed to ask this one here.

how can i add a file on this folder or even the location of this folder.

where can i access it?

thanks in advance

Arantor

Why would you want to?

/usr/local/etc/ and so on are parts of the operating system. You should generally not be touching them, just like you shouldn't be touching C:\Windows manually on a Windows computer.

MrPhil

If you were the root/administrator account on the system, you would have access to put stuff in that directory provided you knew what you were doing. As a common user, you can read but not write that directory.

Maybe you could enlighten us on what you're trying to do? Do you have some code that says to install it into that particular directory (on a Linux machine)? Where did it come from? Do you understand it? Do you trust its author? If you're not "root", you're probably out of luck. If you are root, you ought to know all this stuff already (starting with where to find /usr/local/etc/  :)).

ryan_dwight

its the sphinx installation on the big boards

[~]# indexer --config /usr/local/etc/sphinx.conf --all

i got
FATAL: config file '/usr/local/etc/sphinx.conf' does not exist or is not readable

when im running that one on the root access via putty


MrPhil

Not all Unixy operating systems have that particular file structure (/usr/local/...). If you are the system administrator for that box, you could create such a directory if its only purpose will be to hold that sphinx.conf file. Or, you could simply change that "indexer" command usage to look for sphinx.conf somewhere else (a place that you can write to). I take it you're not the sys admin, or you would have dealt with this in about 2 minutes. Did "indexer" install properly? If so, where did it stick the [sample] sphinx.conf? It might be as simple as changing that one line invoking "indexer" to look in a different place for sphinx.conf.

Are you on the Big Forum discussion board? I'm sure there are people there who are familiar with Sphinx.

If you're not the sys admin on your server, you probably won't be able to install Sphinx.

Arantor

* Arantor is familiar with Sphinx.

So, you've compiled the binaries, where exactly are *they*?

ryan_dwight

i have the admin password and im the one only working with this server, but i dont have so much experience in this field. im just searching here and doing their advice.

i just followed the steps in this thread

http://www.simplemachines.org/community/index.php?topic=127672.0

and im on the step that you need to run

[~]# indexer --config /usr/local/etc/sphinx.conf --all

i just only moved from a new host so i think everything is on default.

Arantor

Well, most people here can't see that topic. Which includes me.

So... how did you install Sphinx exactly? You need to be specific if you want any help...


But it sounds like you have installed it, but not created the config file from the tool provided and saved it in the right place. You can save the config file anywhere provided that you put the right path in --config. So wherever you did put it, that's the path to give to indexer.

/usr/local/etc certainly used to be the old install path several years ago but it's entirely possible it's changed - which is why I asked you where you had installed it.

ryan_dwight

ok i used the file attachment of sirwoogie which is on reply#376
and i followed his steps where to upload it via ftp.

then i tried accessing this
mysite/sphinx_config.php

QuoteSMF Sphinx Configuration Utility
Introduction
This configuration tool is designed to guide you through the installation of the Sphinx full-text search engine, specifically for Simple Machines Forum. Following the steps in this tool will tell how to install Sphinx, will configure SMF for using Sphinx, and will create a configuration file that will be needed for Sphinx based on SMF's settings. Make sure you have the latest version of this tool, so that the latest improvements have been implemented.

What is Sphinx?

Sphinx is an Open Source full-text search engine. It can index texts and find documents within fractions of seconds, a lot faster than MySQL. Sphinx consists of a few components:

There's the indexer that creates the full-text index from the existing tables in MySQL. The indexer is run as a cron job each time, allowing it to update the index once in a while. Based on the configuration file, the indexer knows how to connect to MySQL and which tables it needs to query.

Another important component is the search deamon (called searchd). This deamon runs as a process and awaits requests for information from the fulltext indexes. External processes, like the webserver, can send a query to it. The search deamon will then consult the index and return the result to the external process.

When should Sphinx be used for Simple Machines Forum?

Basically Sphinx starts to get interesting when MySQL is unable to do the job of indexing the messages properly. In most cases, a board needs to have at least 300,000 messages before that point has been reached. Also if you want to make sure the search queries don't affect the database performance, you can choose to put Sphinx on a different server than the database server.

Requirements for Sphinx

Root access to the server you're installing Sphinx
Linux 2.4.x+ / Windows 2000/XP / FreeBSD 4.x+ / NetBSD 1.6 (this tool will assume Linux as operating system)
A working C++ compiler
A good make program

i click proceed

QuoteInstalling Sphinx
This tool will assume you will be installing Sphinx version 0.9.9. A newer version might be available and, if so, would probably be better. Just understand that the steps below and the working of the search engine might be different in future versions of Sphinx. Please note that Sphinx versions prior to 0.9.9 will not work properly.

Retrieving and unpacking the package

Grab the file from the Sphinx website:
[~]# wget http://www.sphinxsearch.com/downloads/sphinx-0.9.9.tar.gz

Untar the package:
[~]# tar -xzvf sphinx-0.9.9.tar.gz

Go to the Sphinx directory:
[~]# cd sphinx-0.9.9
Compiling Sphinx

Configure Sphinx (generally no options are needed):
[~]# ./configure

If everything went well, run the make tool:
[~]# make

If that went well too, make the install:
[~]# make install

i did everything in putty and it went no errors

then i click proceed

QuoteConfigure SMF for Sphinx A few settings can be configured allowing to customize the search engine. Generally all options can be left untouched.

Index data path:   
This is the path that will be containing the search index files used by Sphinx.
Log path:   
Server path that will contain the log files created by Sphinx.
Stopword path:   
The server path to the stopword list (leave empty for no stopword list).
Memory limit indexer:    MB
The maximum amount of (RAM) memory the indexer is allowed to be using.
Sphinx server:   
Server the Sphinx search deamon resides on.
Sphinx port:   
Port on which the search deamon will listen.
SphinxQL port:   
Port on which the MySQL protocol search deamon will listen.
Maximum # matches:   
Maximum amount of matches the search deamon will return.

i did not change anything on this page so i click proceed

QuoteConfigure SMF for Sphinx
Your configuration has been saved successfully. The next time you run this tool, your configuration will automatically be loaded.
Generating a configuration file

Based on the settings you submitted in the previous screen, this tool can generate a configuration file for you that will be used by Sphinx. Press the button below to generate the configuration file, and upload it to /usr/local/etc/sphinx.conf (default configuration).



Some file actions

Create directories for storing the indexes:
[~]# mkdir /var/sphinx
[~]# mkdir /var/sphinx/data
[~]# mkdir /var/sphinx/log

Make the data and log directories writable:
[~]# chmod 666 /var/sphinx/data
[~]# chmod 666 /var/sphinx/log
Indexing time!

It's time to create the full-text index:
[~]# indexer --config /usr/local/etc/sphinx.conf --all

If that went successful, we can test run the search deamon. Start it by typing:
[~]# searchd --config /usr/local/etc/sphinx.conf

If everything worked so far, congratulations, Sphinx has been installed and works! Next step is modifying SMF's search to work with Sphinx.
Configuring SMF

Upload the SearchAPI-Sphinxql.php file to the 'Sources' directory.

Select 'Sphinx' as database index below and press 'Change Search Index'. Test your search function afterwards, it should work now!

 


Creating a cron job for the indexer

In order to keep the full-text index up to date, you need to add a cron job that will update the index from time to time. The configuration file defines two indexes: smf_delta_index, an index that only stores the recent changes and can be called frequently. smf_base_index, an index that stores the full database and should be called less frequently. Adding the following lines to /etc/crontab would let the index rebuild every day (at 3 am) and update the most recently changed messages each hour:
# search indexer
10 3 * * * /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --rotate smf_base_index
0 * * * * /usr/local/bin/indexer --config /usr/local/etc/sphinx.conf --rotate smf_delta_index

this is the part that has an error

i click the generate sphinx_conf

and it downloads a file to my computer

next is this

QuoteSome file actions

Create directories for storing the indexes:
[~]# mkdir /var/sphinx
[~]# mkdir /var/sphinx/data
[~]# mkdir /var/sphinx/log

Make the data and log directories writable:
[~]# chmod 666 /var/sphinx/data
[~]# chmod 666 /var/sphinx/log

im not sure if it went well on this part but when i tried to repeat one of the command it says that its already exist so i assume it was successfully done.

next step is the indexing which is my problem now. i hope this makes sense.

thank you

Arantor

So you created sphinx.conf. Now you have to upload that to your server somewhere. This is the part you haven't done - the file has not been uploaded anywhere.

ryan_dwight

i tried to upload in the same location of sphinx_config.php but i think its not the right folder, so where should i upload this file?

did i chose the right steps and used the right file for smf 2.0.3?

Arantor

Quoteso where should i upload this file?

-sigh- As I have said multiple times, it doesn't really matter. I'd suggest not in the web root area.

Wherever you upload it, use that path in the indexer call.

ryan_dwight

but the problem is i cant find the /usr/local/etc/

where the indexer call

or you mean i will replace the indexer to point on where i uploaded?

Arantor

Um, yes, that's what I mean.

It really doesn't matter too much where it is uploaded provided indexer calls that.

On my own site where I deployed Sphinx, the file wasn't even called sphinx.conf, let alone being in /usr anywhere (it was in /home/site/resources/sphinx-sitename.conf)

Wherever you save it, make sure you pass the path to indexer and to the search daemon and it'll work fine. You might want to put it in /var/sphinx/sphinx.conf since that's where you already have your data and log folders.

ryan_dwight

i appreciate your quick reply Arantor

i uploaded the file on /public_html/ folder same as the sphinx_config.php

sos the indexer must be

Quoteindexer --config /public_html/sphinx.conf --all

is that right?

and what should be the permission of the file? or the folder?

Arantor

-sigh-

Funny, I suggested NOT to do that. I specifically suggested /var/sphinx/sphinx.conf.

Quotesos the indexer must be

I doubt it. /public_html/ is normally a real path, it is just the nonsense that FTP throws at you, it almost certainly really is /home/username/public_html/

Quoteis that right?

No.

Quoteand what should be the permission of the file? or the folder?

sphinx.conf should be a file, and it should be 644.

To be brutally honest, you don't sound like you really know what you're doing with Linux system administration in general and you should probably contact your host to install this for you.

ryan_dwight

yes your right i dont know what im doing on linux system. and i appreciate what this forum has.

it helps me from the migration up till now.

i figure it out without errors but search still not working

error
QuoteAn Error Has Occurred!
Unable to access the search daemon

Arantor

So, you've run the indexer now.

Did you start the searchd daemon, and pass the sphinx.conf file to it?

ryan_dwight

Quote from: Arantor on February 03, 2013, 04:30:32 PM
So, you've run the indexer now.

Did you start the searchd daemon, and pass the sphinx.conf file to it?

yes i able to run indexer

but on searchd
QuoteFATAL: failed to lock pid file '/var/sphinx/data.........

my guess is this one
QuoteCreate directories for storing the indexes:
[~]# mkdir /var/sphinx
[~]# mkdir /var/sphinx/data
[~]# mkdir /var/sphinx/log

Make the data and log directories writable:
[~]# chmod 666 /var/sphinx/data
[~]# chmod 666 /var/sphinx/log
Indexing time!

it doesnt match to the indexer
Quoteindexer --config /home/usr/public_html/sphinx.conf --all
searchd --config /home/usr/public_html/sphinx.conf

on your suggestion i cant find the sphinx folder thats why i choose another.

so how can i change the data and log directories.

thanks for your patience i know its hard to teach newbies like me.

Arantor

Wait a minute.

Quoteon your suggestion i cant find the sphinx folder thats why i choose another.

Um, /var/sphinx/ is the sphinx folder. Stop using ****ty FTP and start using a proper client that doesn't screw you around by hiding the paths. The only reason you can't see /var/sphinx is because of your client hiding it from you.

The searchd error... /var/sphinx/data is that exactly what it said? It shouldn't be trying to make a pid file called that.

Also... you did let indexer finish and it told you it was successful, right?

Advertisement: