Mnogosearch

  一。Mnogosearch是php的搜索引擎 同dateparksearch一样,并且是由dpsearch改良而来的,与php整合比较好用。
  下面是mnogosearch叙述的mnogosearch安装步骤
  Posted by Kostas Paganelis2007-09-07 13:37:17
  install mnogosearch-3.3.4 with php extension module
  if they arent already installed
  sudo apt-get install apache2-mpm-prefork
  and
  sudo apt-get install mysql-server
  1. sudo apt-get install zlib1g-dev
  2. sudo apt-get install libmysqlclient15-dev
  inside mnogosearch-3.x.x directory
  3. ./install.pl (build shared libraries - default settings)
  or
  ./configure --prefix=/usr/local/mnogosearch --bindir=/usr/local/mnogosearch/bin --sbindir=/usr/local/mnogosearch/sbin --sysconfdir=/usr/local/mnogosearch/etc --localstatedir=/usr/local/mnogosearch/var --libdir=/usr/local/mnogosearch/lib --includedir=/usr/local/mnogosearch/include --mandir=/usr/local/mnogosearch/man --enable-shared --enable-static --enable-syslog --without-docs --enable-pthreads --disable-dmalloc --enable-parser --enable-mp3 --enable-file --enable-http --enable-ftp --enable-htdb --enable-news --with-mysql
  4. make
  5. sudo make install
  Install PHP with mnogosearch support
  the packages below may be already installed.if not, install them
  x. sudo apt-get install build-essential flex
  x. sudo apt-get install libxml2-dev
  x. sudo apt-get install g++
  x. sudo apt-get install apache2-prefork-dev
  6. ./configure \
  --disable-debug \
  --disable-rpath \
  --enable-bcmath \
  --enable-calendar \
  --enable-maintainer-zts \
  --enable-embed=shared \
  --enable-force-cgi-redirect \
  --enable-ftp \
  --enable-inline-optimization \
  --enable-magic-quotes \
  --enable-memory-limit \
  --enable-pic \
  --enable-safe-mode \
  --enable-sockets \
  --enable-track-vars \
  --enable-trans-sid \
  --enable-wddx \
  --with-db \
  --with-regex=system \
  --with-pear \
  --with-xml \
  --with-xmlrpc \
  --with-zli \
  --with-mysql=/usr \
  --with-gd \
  --enable-mbstring \
  --with-apxs2=/usr/bin/apxs2 \
  --with-mnogosearch
  7. make
  the step below is necessary just in order ta have the httpd.conf with at least a line (the httpd.conf must not be empty)
  8. sudo gedit /etc/apache2/httpd.conf and write inside "LoadModule mod_xmlent /usr/lib/apache2/modules/mod_xmlent.so" after the installation you can remove the line
  9. sudo make install
  10. sudo cp php.ini-dist /usr/local/lib/php.ini
  11. sudo gedit /etc/apache2/mods-enabled/php5.load and write inside "LoadModule php5_module modules/libphp5.so"
  12. sudo gedit /etc/apache2/mods-enabled/php5.conf and write inside "
  AddType application/x-httpd-php .php
  AddType application/x-httpd-php-source .phps
  "
  13. sudo gedit /usr/local/lib/php.ini and the parameters you want
  create database and user for mnogosearch
  edit mnogosearch/etc/indexer.conf (define at least Server and DBAddr)
  copy mnogosearch/etc/stopwords.conf-dist mnogosearch/etc/stopwords.conf
  sudo cp mnogosearch/etc/langmap.conf-dist mnogosearch/etc/langmap.conf
  run mnogosearch/sbin/indexer -Ecreate in order to create the database structure
  run the indexer
  make the PHP extension module
  the step below may not be needed
  x. sudo apt-get install autoconf
  14. run phpize in extension module directory (1.96)
  the step below may not be needed
  x. sudo apt-get install re2c
  15. ./configure --with-mnogosearch
  16. make
  17. then you have mnogosearch.so and mnogosearch.la in the modules directory. move them to your php extension directory (look at the extension_dir value in your php.ini)
  sudo cp modules/mnogosearch.so /usr/local/lib/php/extensions/
  18. edit php.ini
  19. add the line: extension = mnogosearch.so in the extension section
  - restart apache
  after that you configure the file search.htm from the mnogosearch-php-3.2.11 in any way you want.
  At first it gave me no results but when i commented most of the search options i had results normally (e.g categories etc - i hadn't configured the indexer to index the pages by categories or tags).
  mnogosearch配置文档:
  注:mnogosearch配置相对比dpsearch简单些,只需要配置一个config就可以。
  首先平配置DBAddr ;
  然后是Document sections. 部分
  还需要注意db和congif的 charset要一致。
  这部分是配置数据库DB的 section
  ################################################## #########################
  # DBAddr
  # Options (type, host, database name, port, user and password)
  # to connect to SQL database.
  # Should be used before any other commands.
  # Has global effect for whole config file.
  # Format:
  #DBAddr :[//[DBUser[:DBPass]@]DBHost[:DBPort]]/DBNam e/[?dbmode=mode]
  #
  # ODBC notes:
  # Use DBName to specify ODBC data source name (DSN)
  # DBHost does not matter, use "localhost".
  #
  # Currently supported DBType values are
  # mysql, pgsql, mssql, oracle, ibase, db2, mimer, sqlite.
  #
  # MySQL users can specify path to Unix socket when connecting to localhost:
  # mysql://foo:bar@localhost/mnogosearch/?socket=/tmp /mysql.sock
  #
  # If you are using PostgreSQL and do not specify hostname,
  # e.g. pgsql://user:password@/dbname/
  # then PostgreSQL will not work via TCP, but will use Unix socket.
  #
  # You may also select database mode of word storage.
  # When "single" is specified, all words are stored in the same table.
  # If "multi" is selected, words will be located in different tables.
  # "multi" mode is usually faster but requires more tables.
  # Default mode is "single".
  # DBAddr mysql://root:123456@localhost/mnogosearch/?dbmode= blob
  RemoteCharset utf-8
  //目标数据库,你搜索的数据会存在这里
  DBAddr mysql://root:123456@localhost/test1/?dbmode=single &setnames=utf8
  //你要搜索那个数据库,只有在进行DBsearch的时候,才需要这句话配置
  HTDBAddr mysql://root:123456@localhost/test2/?dbmode=single &setnames=utf8
  // 当你使用DBsearch的时候,需要下面的设置
  HTDBList "SELECT ID FROM tablename WHERE status = 'y' AND (tag '' OR name '' OR description '')"
  HTDBDoc "SELECT name,tag,description FROM tablename WHERE status = 'y' AND ID = $2 AND (tag '' OR name '' OR description '')"
  Server htdb:/dbName/
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值