个人工具
登录
查看“UbuntuHelp:Namazu”的源代码 - Ubuntu中文
UbuntuHelp
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“UbuntuHelp:Namazu”的源代码
来自Ubuntu中文
←
UbuntuHelp:Namazu
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{From|https://help.ubuntu.com/community/Namazu}} {{Languages|UbuntuHelp:Namazu}} == Introduction == [http://www.namazu.org/ Namazu] is a full-text search engine intended for easy use. Not only does it work as a small or medium scale Web search engine, but also as a personal search system for email or other files. Namazu is the perfect solution for building an intranet search engine. It's light and low in dependencies (compared to [http://lucene.apache.org/ Lucene] like/based solutions). Namazu can index a large number of file types including office documents, pdf's and code source files. === Installation === Namazu is available as a package and can be installed using any package management tool you prefer. <pre><nowiki> sudo apt-get install namazu2 namazu2-index-tools </nowiki></pre> Additional parsers are available if you install <code><nowiki>xpdf</nowiki></code>, <code><nowiki>wv</nowiki></code>, <code><nowiki>unzip</nowiki></code>... packages. <pre><nowiki> sudo apt-get install xpdf wv unzip unrtf </nowiki></pre> To tell namazu which files it is allowed to index, the <code><nowiki>/etc/namazu/mknmzrc</nowiki></code> has to be edited and the lines after <code><nowiki>$ALLOW_FILE</nowiki></code> should be uncommented. === Using Namazu === Namazu is composed of several tools like an indexer, a search tool and other. To create or update a namazu index the <code><nowiki>mknmz</nowiki></code> tool has to be used. To periodically synchronize the index, a line like below can be placed in [[UbuntuHelp:crontab|crontab]]: <pre><nowiki> 0,15,30,45 * * * * www-data mknmz --output-dir=/storage/archive/index /storage/archive/data/ > /tmp/namazu.log 2>&1 </nowiki></pre> The command will update the index from <code><nowiki>/storage/archive/index</nowiki></code> with the parsed data from <code><nowiki>/storage/archive/data/</nowiki></code>. In this example we'll skip the command line tools to search the index and will create a web page for this job. === Namazu web search === Namazu can be accessed through a web page by configuring a web form to pass queries to <code><nowiki>namazu.cgi</nowiki></code> — a cgi file which comes in official package and can be found at <code><nowiki>/usr/lib/cgi-bin/namazu.cgi</nowiki></code>. Configure your favorite web server to point to (for example) <code><nowiki>/storage/archive</nowiki></code>, where you can create a <code><nowiki>cgi-bin</nowiki></code> directory. Copy the <code><nowiki>namazu.cgi</nowiki></code> file in it, and create a new file in the same directory under the name of <code><nowiki>.namazurc</nowiki></code>. <pre><nowiki> mkdir /storage/archive/cgi-bin cp /usr/lib/cgi-bin/namazu.cgi /storage/archive/cgi-bin/ cat > /storage/archive/cgi-bin/.namazurc Lang en Index /storage/archive/index Template /storage/archive/index </nowiki></pre> The <code><nowiki>.namazurc</nowiki></code> will be loaded by <code><nowiki>namazu.cgi</nowiki></code> along with the settings from it. A more detailed file with <code><nowiki>.namazurc</nowiki></code> settings can be found in <code><nowiki>/etc/namazu/namazurc</nowiki></code>. Next just configure your vhost to allow <code><nowiki>.cgi</nowiki></code> scripts. On [[UbuntuHelp:Apache|Apache]] you should install <code><nowiki>libapache2-mod-fastcgi</nowiki></code> package. On [[UbuntuHelp:nGinx|nGinx]] there's an example available on [[UbuntuHelp:FcgiWrap|FcgiWrap]] page. [[category:UbuntuHelp]]
该页面使用的模板:
模板:From
(
查看源代码
)
模板:Languages
(
查看源代码
)(受保护)
模板:Languages/Lang
(
查看源代码
)(受保护)
返回至
UbuntuHelp:Namazu
。