Changes

Jump to navigation Jump to search
225 bytes added ,  21:45, 30 September 2009
Line 1: Line 1:  +
This is my first attempt at a HowTo so please bear with me and help improve it ...
 +
 +
I needed a document search facility for my users, essentially to make them able to search through various notes, memos etc. available on the web server. I found a usable script at www.kscripts.com, and have adjusted it a bit to make it more feasible for the SME-server, so I have produced a new file package you can get here: http://ibsgaardenprivat.dk/ksearch1.5b.tgz
 +
 +
Here is a copy of my new README, part of the file package:
 +
 
This is my first attempt at a HowTo so please bear with me and help improve it ...
 
This is my first attempt at a HowTo so please bear with me and help improve it ...
   Line 32: Line 38:  
# Stop Terms: stop_terms.txt
 
# Stop Terms: stop_terms.txt
 
#* Add terms you want to IGNORE to the search engine stop terms list, on separate lines. =NOTE=: After indexing, you may discover terms you don't want to include in your search engine.  You may later come back and add terms to the file -- however, you'll need to re-index your website using indexer.cgi
 
#* Add terms you want to IGNORE to the search engine stop terms list, on separate lines. =NOTE=: After indexing, you may discover terms you don't want to include in your search engine.  You may later come back and add terms to the file -- however, you'll need to re-index your website using indexer.cgi
# Copy the contents of the directory "search" to /opt/ksearch:
+
# Copy the contents of the directory "search" to /opt/ksearch:<br /> $sudo mkdir /opt/ksearch<br /> $sudo cp -R search/* /opt/ksearch/<br />The 5 files not included in directory "search" (CHANGELOG.txt, GNU.txt, HISTORY.txt, README.txt, and FAQs.html) are for personal reference, troubleshooting, and future use, and need not be copied.
              $sudo mkdir /opt/ksearch
+
# Change the ownership of all copied files to www.www:<br />$sudo chown -R www.www /opt/ksearch
              $sudo cp -R search/* /opt/ksearch/
+
# Using the chmod command, set permissions for each copied file and directory as follows<br />$sudo chmod 755 /opt/ksearch/*.cgi /opt/ksearch/indexer.pl<br />$sudo chmod 744 /opt/ksearch/configuration/*<br />$sudo chmod 755 /opt/ksearch/ks_images<br />$sudo chmod 644 /opt/ksearch/ks_images/*<br />$sudo chmod 644 /opt/ksearch/*html<br /> $sudo chmod 644 /opt/ksearch/templates/*
The 5 files not included in directory "search" (CHANGELOG.txt, GNU.txt, HISTORY.txt, README.txt, and FAQs.html) are for personal reference, troubleshooting, and future use, and need not be copied.
+
# Make an addition to httpd.conf by creating the file<br />/etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98Ksearch<br />With the following contents:<br />Alias /ksearch /opt/ksearch<br /><Directory /opt/ksearch ><br />  Options +ExecCGI<br />  order deny,allow<br />  deny from all<br />  allow from { "$localAccess, $externalSSLAccess"; }<br /></Directory>
# Change the ownership of all copied files to www.www:
+
# Expand the template:<br />$sudo /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
              $sudo chown -R www.www /opt/ksearch
+
# Restart httpd:<br />$sudo /etc/init.d/httpd-e-smith restart
# Using the chmod command, set permissions for each copied file and directory as follows
+
# Run the INDEXER: Open your browser and run the indexer script, e.g.: http://www.MyWebsite.com/ksearch/indexer.cgi. The time required will depend on the size of your site and your server's CPU. =NOTE=: You need to use the same URL path as specified in configuration.pl line 28, @VALID_REFERERS.
              $sudo chmod 755 /opt/ksearch/*.cgi /opt/ksearch/indexer.pl
+
# Test it out:<br />Open the search_form.html (e.g. http://www.MyWebsite.com/ksearch/search_form.html). Run a search.  Questions or problems, FIRST read the enclosed FAQs.html file
              $sudo chmod 744 /opt/ksearch/configuration/*
  −
              $sudo chmod 755 /opt/ksearch/ks_images
  −
              $sudo chmod 644 /opt/ksearch/ks_images/*
  −
              $sudo chmod 644 /opt/ksearch/*html
  −
              $sudo chmod 644 /opt/ksearch/templates/*
  −
# Make an addition to httpd.conf by creating the file
  −
              /etc/e-smith/templates-custom/etc/httpd/conf/httpd.conf/98Ksearch
  −
With the following contents:
  −
              Alias /ksearch /opt/ksearch
  −
              <Directory /opt/ksearch >
  −
                        Options +ExecCGI
  −
                        order deny,allow
  −
                        deny from all
  −
                        allow from { "$localAccess $externalSSLAccess"; }
  −
                </Directory>
  −
# Expand the template:
  −
                $sudo /sbin/e-smith/expand-template /etc/httpd/conf/httpd.conf
  −
# Restart httpd:
  −
                $sudo /etc/init.d/httpd-e-smith restart
  −
# Run the INDEXER:
  −
                Open your browser and run the indexer script, e.g.: http://www.MyWebsite.com/ksearch/indexer.cgi  
  −
                The time required will depend on the size of your site and your server's CPU.
  −
                        =NOTE=: You need to use the same URL path as specified in configuration.pl line 28, @VALID_REFERERS.
  −
# Test it out:
  −
                Open the search_form.html (e.g. http://www.MyWebsite.com/ksearch/search_form.html)
  −
                Run a search.  Questions or problems, FIRST read the enclosed FAQs.html file
   
# As an alternative to doing indexing via a browser and the indexer.cgi script, you may do indexing from a command line with indexer.pl. For this to work, you will probably need to change the line in indexer.pl, starting with "my $configuration_file" to make sure it points to the correct configuration file.
 
# As an alternative to doing indexing via a browser and the indexer.cgi script, you may do indexing from a command line with indexer.pl. For this to work, you will probably need to change the line in indexer.pl, starting with "my $configuration_file" to make sure it points to the correct configuration file.
20

edits

Navigation menu