centos 开源中国 centos镜像下载
各位老铁们,大家好,今天由我来为大家分享centos 开源中国,以及centos镜像下载的相关问题知识,希望对大家有所帮助。如果可以帮助到大家,还望关注收藏下本站,您的支持是我们最大的动力,谢谢大家了哈,下面我们开始吧!
centos下coreseek安装及使用方法
Coreseek中文全文检索引擎
Coreseek是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和信息处理领域,适用于行业/垂直搜索、论坛/站内搜索、数据库搜索、文档/文献检索、信息检索、数据挖掘等应用场景,用户可以免费下载使用
一,coreseek简介
官方
Coreseek是一款中文全文检索/搜索软件,以GPLv2许可协议开源发布,基于Sphinx研发并独立发布,专攻中文搜索和信息处理领域,适用于行业/垂直搜索、论坛/站内搜索、数据库搜索、文档/文献检索、信息检索、数据挖掘等应用场景。商业使用(例如,嵌入到其他程序中)需要获得商业授权。
Coreseek是一个支持中文的全文搜索引擎,意图为其他应用提供高速、低空间占用、高相关度结果的中文全文搜索能力。CoreSeek可以非常容易的与SQL数据库和脚本语言集成。
在Sphinx发行版本中提供的原生搜索API支持PHP、Python、Perl、Rudy和Java。搜索API非常轻量化,可以在几个小时之内移植到新的语言上。第三方API接口和插件提供了对Perl、C#、Haskell、Ruby-on-Rails支持,以及对其他可能的语言或者框架的支持。
版本介绍
Coreseek 3.2稳定版
Coreseek 4.1测式版
Coreseek 5最新版
二,安装Coreseek
注:本文是以centos+mysql做为数据源支持为基础的coreseek安装教程.mysql安装略过.
1,下载coreseek 3.2稳定版,下载其他版本请去官网自行下载
cd/usr/local/src/
wget
tar xzvf coreseek-3.2.14.tar.gz
cd coreseek-3.2.14
安装coreseek之前需要先安装需要预装的软件:yum install make gcc g++ gcc-c++ libtool autoconf automake imake mysql-devel libxml2-devel expat-devel(注:这是centos 64位
其他系统请参考
2,安装mmseg
$ cd mmseg-3.2.14
$./bootstrap#输出的warning信息可以忽略,如果出现error则需要解决
$./configure--prefix=/usr/local/mmseg3
$ make make install
$ cd..
##如果提示libtool: unrecognized option `--tag=CC',请查看libtool问题解决方案
##安装完成后,mmseg使用的词典和配置文件,将自动安装到/usr/local/mmseg3/etc中
##中文分词测试,如果显示不正常,请检查当前环境下的locale和UTF-8中文字符显示设置
$/usr/local/mmseg3/bin/mmseg-d/usr/local/mmseg3/etc src/t1.txt
中文/x分/x词/x测试/x
中国人/x上海市/x
Word Splite took: 1 ms.
3,安装coreseek
$ cd csft-3.2.14
##执行configure,进行编译配置:
$ sh buildconf.sh
$./configure--prefix=/usr/local/coreseek--without-unixodbc--with-mmseg--with-mmseg-includes=/usr/local/mmseg3/include/mmseg/--with-mmseg-libs=/usr/local/mmseg3/lib/--with-mysql
如查提示找不到mysql includes file则使用下面的编译命令
./configure--prefix=/usr/local/coreseek--without-unixodbc--with-mmseg--with-mmseg-includes=/usr/local/mmseg3/include/mmseg/--with-mmseg-libs=/usr/local/mmseg3/lib/--with-mysql-includes=/alidata/server/mysql/include/--with-mysql-libs=/alidata/server/mysql/bin/
make make install
4,测式coreseek
cd../testpack
$/usr/local/coreseek/bin/indexer-c etc/csft.conf
##以下为正常情况下的提示信息:
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
total 0 reads, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
total 0 writes, 0.000 sec, 0.0 kb/call avg, 0.0 msec/call avg
##
##csft-4.0版显示:ERROR: nothing to do.
##
$/usr/local/coreseek/bin/indexer-c etc/csft.conf--all
##以下为正常索引全部数据时的提示信息:(csft-4.0版类似)
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
indexing index'xml'...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 7585 bytes
total 0.075 sec, 101043 bytes/sec, 39.96 docs/sec
total 2 reads, 0.000 sec, 5.6 kb/call avg, 0.0 msec/call avg
total 7 writes, 0.000 sec, 3.9 kb/call avg, 0.0 msec/call avg
$/usr/local/coreseek/bin/indexer-c etc/csft.conf xml
##以下为正常索引指定数据时的提示信息:(csft-4.0版类似)
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
indexing index'xml'...
collected 3 docs, 0.0 MB
sorted 0.0 Mhits, 100.0% done
total 3 docs, 7585 bytes
total 0.069 sec, 109614 bytes/sec, 43.35 docs/sec
total 2 reads, 0.000 sec, 5.6 kb/call avg, 0.0 msec/call avg
total 7 writes, 0.000 sec, 3.9 kb/call avg, 0.0 msec/call avg
$/usr/local/coreseek/bin/search-c etc/csft.conf
##以下为正常测试搜索时的提示信息:(csft-4.0版类似)
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
index'xml': query'': returned 3 matches of 3 total in 0.093 sec
displaying matches:
1. document=1, weight=1, published=Thu Apr 1 22:20:07 2010, author_id=1
2. document=2, weight=1, published=Thu Apr 1 23:25:48 2010, author_id=1
3. document=3, weight=1, published=Thu Apr 1 12:01:00 2010, author_id=2
words:
$/usr/local/coreseek/bin/search-c etc/csft.conf-a Twittter和Opera都提供了搜索服务
##以下为正常测试搜索关键词时的提示信息:(csft-4.0版类似)
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
index'xml': query'Twittter和Opera都提供了搜索服务': returned 3 matches of 3 total in 0.038 sec
displaying matches:
1. document=3, weight=24, published=Thu Apr 1 12:01:00 2010, author_id=2
2. document=1, weight=4, published=Thu Apr 1 22:20:07 2010, author_id=1
3. document=2, weight=3, published=Thu Apr 1 23:25:48 2010, author_id=1
words:
1.'twittter': 1 documents, 3 hits
2.'和': 3 documents, 15 hits
3.'opera': 1 documents, 25 hits
4.'都': 2 documents, 4 hits
5.'提供': 0 documents, 0 hits
6.'了': 3 documents, 18 hits
7.'搜索': 2 documents, 5 hits
8.'服务': 1 documents, 1 hits
$/usr/local/coreseek/bin/searchd-c etc/csft.conf
##以下为正常开启搜索服务时的提示信息:(csft-4.0版类似)
Coreseek Fulltext 3.2 [ Sphinx 0.9.9-release(r2117)]
Copyright(c) 2007-2010,
Beijing Choice Software Technologies Inc()
using config file'etc/csft.conf'...
listening on all interfaces, port=9312
三,配置coreseek支持mysql数据源
1,配置csft_mysql.conf文件
复制mysql配置文件到coreseek安装目录etc/下(比如/usr/local/coreseek/etc/)
cp/usr/local/src/coreseek-3.2.14/testpack/etc/csft_mysql.conf/usr/local/coreseek/etc/
cd/usr/local/coreseek/etc/
vi csft_mysql.conf
下面加红部分是需要你自己配置的
官方参考文档:数据源配置:mysql数据源
其他数据源请参考官方
==============================================================
#源定义
sourcephperz
{
type= mysql
sql_host=localhost
sql_user=root
sql_pass=xxxx
sql_db=phperz
sql_port= 3306
sql_query_pre= SET NAMES utf8
sql_query=SELECT id,title,descs,status from article
#sql_query第一列id需为整数
#title、content作为字符串/文本字段,被全文索引
sql_attr_uint=status#从SQL读取到的值必须为整数
#sql_attr_timestamp= date_added#从SQL读取到的值必须为整数,作为时间属性
sql_query_info_pre= SET NAMES utf8#命令行查询时,设置正确的字符集
sql_query_info=SELECT* FROM article WHERE id=$id#命令行查询时,从数据库读取原始数据信息
}
#index定义
indexphperz
{
source=phperz#对应的source名称
path=/usr/local/coreseek/var/data/phperz#请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
docinfo= extern
mlock= 0
morphology= none
min_word_len= 1
html_strip= 0
#中文分词配置,详情请查看:
charset_dictpath=/usr/local/mmseg3/etc/#BSD、Linux环境下设置,/符号结尾
#charset_dictpath= etc/#Windows环境下设置,/符号结尾,最好给出绝对路径,例如:C:/usr/local/coreseek/etc/...
charset_type= zh_cn.utf-8
}
#全局index定义
indexer
{
mem_limit= 128M
}
#searchd服务定义
searchd
{
listen= 9312
read_timeout= 5
max_children= 30
max_matches= 1000
seamless_rotate= 0
preopen_indexes= 0
unlink_old= 1
pid_file=/usr/local/coreseek/var/log/searchd_mysql.pid#请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
log=/usr/local/coreseek/var/log/searchd_mysql.log#请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
query_log=/usr/local/coreseek/var/log/query_mysql.log#请修改为实际使用的绝对路径,例如:/usr/local/coreseek/var/...
}
==============================================================
2,建立索引
路经部分需要改成你自己的地址
/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft_mysql.conf--all
可能出现的错误
ERROR: index'phperz': sql_connect: Can't connect to local MySQL server through socket'/var/lib/mysql/mysql.sock'(2)(DSN=mysql://root:***@localhost:3306/phperz).
这是因为mysql的sock文件路经不正确导致的.
确认一下你的mysql.sock路经,建立一个软连接,比如
ln-s/tmp/mysql.sock/var/lib/mysql/mysql.sock
四,coreseek+php使用方式
复制安装止录下的/usr/local/src/coreseek-3.2.14/testpack/api/sphinxapi.php文件到你的项目里
你的程序里include sphinxapi.php
php使用方法见/usr/local/src/coreseek-3.2.14/testpack/api/test.php
另附我的使用方法:
===============================================================
$wd= trim($_GET['wd']);
include_once(JF_PATH./config/sph_cfg.php);
include_once(JF_PATH./include/sphinxapi.php);
$cl= new SphinxClient();
$cl-SetServer(SPH_SERVER_HOST, SPH_SERVER_POST);
$cl-SetConnectTimeout(3);
$cl-SetArrayResult(true);
$cl-SetMatchMode(1);
$cl-SetFilter(status, array(1));
$cl-SetLimits(0, 10);
$res=$cl-Query($wd, phperz_www);
if($res['matches']){
$rownum=$res['total'];
foreach($res['matches'] as$k=$v){
$re=$this-db-get_one(select* from article where id=.$v['id']);
if(!empty($re)){
$list[]=$re;
}
}
}
print_r($list);
===============================================================
五,coreseek日常维护
启动
/usr/local/coreseek/bin/searchd-c/usr/local/coreseek/etc/csft_mysql.conf
停止
/usr/local/coreseek/bin/searchd-c/usr/local/coreseek/etc/csft_mysql.conf--stop
建立索引
/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft_mysql.conf--all
重建索引
/usr/local/coreseek/bin/indexer-c/usr/local/coreseek/etc/csft_mysql.conf--all--rotate
你需要把启动命令加到开机自启动里
把重建索引命令加到计划任务里每天执行
本文为phperz原创,转载请注明出处.
redhat跟centOS的区别
首先因为Redhat是基于Linux内核的,Linux本身就是开源的,根据Linux内核遵循GPL v2协议的规定,Redhat系统必须开源它的源码,事实上Redhat的编译版本和源码都是可以免费下载的。所以有人就下载了Redhat的源码,把Redhat的logo之类的标志、版本信息去掉后,自己编译成一个系统,并上传到网上供大家下载使用,后来成立了一个组织专门做优化这个自己编译的操作系统,并把这个系统叫做:Community enterprise operating system,取第一个单词的首字母C和第二个单词的前三个字母ent,简称Cent操作系统,而我们知道操作系统一般都用OS做简称,故这个系统叫:CentOS,它的本意就是“社区版企业操作系统”,就是网上社区的成员拿红帽的代码编译的。
所以,CentOS其实就是Redhat,可以说它们没有区别,唯一的区别是CentOS去掉了Redhat的商标(logo)之类的版权信息,另外,编译的时候,因为社区是民间组织,我们常说高人在民间,所以CentOS社区的人在编译Redhat源码时可能发现了一些错误,他们会对这些错误进行修正。
有人可能会觉得奇怪,Redhat公司的人这么辛苦写出来的源码,却还必须遵守GPL协议免费公开发到网上供大家下载使用,那Redhat还怎么赚钱?答案是,Redhat系统本身也是免费的,它的系统根本就不要钱,要钱的是“服务”和“商业授权费”,当公司使用Redhat系统(也就Redhat for Enterprise Linux,即红帽企业操作系统)时,你必须给Redhat公司交“授权费”,个人使用没人管你,因为它的系统你随时可以免费下载,但是公司使用它时,如果被它发现了你没有给授权费,就会被起诉赔钱,另外就是你可以使用Redhat的“服务”,服务器出问题他们的专业人员可以帮你处理,这也是收费的。
又有人可能会觉得很奇怪,既然RHEL系统免费让你下,源码也免费让你下,但为什么你用RHEL系统就要授权费?因为RHEL系统是Redhat公司开发的,人家有版权,但你交了授权费之后,如果系统出现什么大的问题,Redhat公司应该也是要赔你公司钱的,你可以选择不用RHEL系统,而是用CentOS系统,因为根据前面所说,CentOS其实就是Redhat系统嘛,只不过去掉了Redhat版权信息,改成了CentOS,而CentOS是社区版,是免费的。但是由于CentOS是免费的,如果你使用CentOS有什么重大问题造成公司有重大损失,CentOS是不会赔你钱的,因为CentOS本身并不是公司,而是一个民间组织,它们的存在,实际上就是因为有很多人认为自己技术够牛,不需要Redhat公司来做技术支持,也不想花钱买RHEL系统的使用授权,所以他们自己使用Redhat的源码编译出来CentOS,并且由于代码不是他们自己写的,所以他们不能对CentOS收费,因为他们本身就是为了不使用收费的RHEL才自己编译的CentOS,所以他们自然也不会去收费(也无权收费),但因为他们不收费,所以也不需要对使用者负责,也就是说使用者因为CentOS出什么问题对公司造成损失,他们是不需要负责的,你既然想省钱就别怕出事。
然而CentOS实际上是比较稳定的,也不会出什么事,所以目前国内绝大部分互联网公司都使用CentOS系统,但也有使用Ubuntu的,国外用Ubuntu的更多,全世界用Ubuntu做服务器的比用CentOS的多,但在中国用Ubuntu的比用CentOS的少,原因可能是因为中国最早那批会Linux的人都学的红帽(Redhat)系统,他们教出来的人自然也都是用红帽的,而CentOS其实就是红帽,用法肯定也基本上一样,所以大家相互学的都是这个系统的相关知识,导致国内大部分互联网公司都用CentOS做服务器。
Linux开源镜像下载站点简单汇总
Rocky Linux由Gregory Kurtzer创立,旨在与Red Hat Enterprise Linux实现百分之百的bug-for-bug兼容,为延续CentOS而生。
访问CentOS官方站点:centos.org/download/获取官方版本。
各大开源网站镜像站提供下载服务:
搜狐开源镜像站提供下载:Index of/
网易开源镜像站提供下载:欢迎访问网易开源镜像站
开源中国提供下载:mirrors.oschina.net/
首都在线科技股份有限公司提供下载:mirrors.yun-idc.com/
阿里云开源镜像虽在升级中,但依旧提供部分资源。
LUPA镜像服务已无法访问。
常州贝特康姆软件技术有限公司(原cn99)提供下载:Index of/
多所大学校园镜像站供校园用户下载:
中山大学镜像站提供下载:mirror.sysu.edu.cn/
山东理工大学镜像站提供下载:mirrors.sdutlinux.org/
哈尔滨工业大学镜像站提供下载:run.hit.edu.cn/
中国地质大学镜像站提供下载:cugbteam.org/
大连理工大学镜像站提供下载:mirror.dlut.edu.cn/
西南林业大学提供下载:cs3.swfu.edu.cn/cs3guid...
北京化工大学提供下载:仅教育网可以访问,包含 CentOS镜像,ubuntu.buct.edu.cn/
天津大学镜像站提供下载:mirror.tju.edu.cn/
西南大学镜像站提供下载:linux.swu.edu.cn/swudow...
青岛大学镜像站提供下载:mirror.qdu.edu.cn/
南京师范大学镜像站提供下载:mirrors.njnu.edu.cn/
大连东软信息学院镜像站提供下载:mirrors.neusoft.edu.cn/
浙江大学镜像站提供下载:mirrors.zju.edu.cn/
兰州大学提供下载:兰州大学开源社区镜像站
厦门大学镜像站提供下载:mirrors.xmu.edu.cn/
北京理工大学提供下载:
mirror.bit.edu.cn(IPv4 only)
mirror.bit6.edu.cn(IPv6 only)
北京交通大学提供下载:
mirror.bjtu.edu.cn(IPv4 only)
mirror6.bjtu.edu.cn(IPv6 only)
debian.bjtu.edu.cn(IPv4+IPv6)
上海交通大学提供下载:
Index of/(IPv4 only)
ftp6.sjtu.edu.cn(IPv6 only)
清华大学提供下载:
Tsinghua Open Source Mirror(IPv4+IPv6)
mirrors.6.tuna.tsinghua.edu.cn...(IPv6 only)
Tsinghua Open Source Mirror(IPv4 only)
中国科学技术大学提供下载:
USTC Open Source Software Mirror(IPv4+IPv6)
mirrors4.ustc.edu.cn/
mirrors6.ustc.edu.cn/
东北大学提供下载:
mirror.neu.edu.cn/(IPv4 only)
mirror.neu6.edu.cn/(IPv6 only)
华中科技大学提供下载:mirrors.hust.edu.cn/
mirrors.hustunique.com/
电子科技大学提供下载:ubuntu.uestc.edu.cn/
电子科大凝聚工作室提供下载: raspbian.cnssuestc.org/
电子科大星辰工作室提供下载:mirrors.stuhome.net/
PyPi镜像服务:
豆瓣提供下载:pypi.douban.com/
山东理工大学提供下载:pypi.sdutlinux.org/
中山大学提供下载:mirror.sysu.edu.cn/pypi...
V2EX提供下载:pypi.v2ex.com/simple/
RubyGems镜像服务:
中山大学提供下载:mirror.sysu.edu.cn/ruby...
山东理工大学提供下载:ruby.sdutlinux.org/
淘宝网提供下载:ruby.taobao.org/
npm镜像服务:
cnpmjs提供下载:cnpmjs.org: Private npm registry and web for Company