centos cs(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原创,转载请注明出处.
如何在CentOS系统利用命令行操作文件以及文件夹
下面总结一些linux,CentOS下面常用的命令:
cd pwd
NO1.显示当前路径
[root@rehat root]# pwd
NO2.返回用户主目录
[root@rehat root]# cd
NO3.改变到其它路径
[root@rehat root]# cd/etc
NO4.返回到上一级目录
[root@rehat root]# cd..
NO5.返回到根目录
[root@rehat root]# cd/
查询文件或文件夹的CentOS常用命令 find
NO1.查找当前用户主目录下的所有文件
[root@rehat root]# find~
NO2.让当前目录中文件属主具有读、写权限,并且文件所属组的用户和其他用户具有读权限的文件;
[root@rehat root]# find.-perm 644-exec ls-l{}\;
NO3.为了查找系统中所有文件长度为0的普通文件,并列出它们的完整路径;
[root@rehat root]# find/ size 0-type f-exec ls-l{}\;
NO4.查找/var/logs目录中更改时间在7日以前的普通文件,并在删除之前询问它们;
[root@rehat root]# find/var/logs-mtime+7-type f-ok rm-i{}\;
NO5.为/找系统中所有属于root组的文件;
[root@rehat root]# find/-group root-exec ls-l{}\;
NO6. find命令将删除当目录中访问时间在7日以来、含有数字后缀的admin.log文件
[root@rehat root]# find.-name"admin.log[0-9][0-9][0-9]"-atime-7-ok rm{}\;
NO7.为了查找当前文件系统中的所有目录并排序
[root@rehat root]# find.-type d| sort
NO8.为了查找系统中所有的rmt磁带设备
[root@rehat root]# find/dev/rmt
显示文件/文件夹清单的CentOS常用命令 ls/ dir
NO1.显示所有文件,包括以.开头的隐含文件
[root@rehat root]# ls-a
NO2.显示文件的详细信息
[root@rehat root]# ls-l
NO3.显示当前目录及所有子目录信息
[root@rehat root]# ls-Rl
NO4.以时间排序显示目录,这在找最新文件有用
[root@rehat root]# ls-tl
NO5.以文件大小排序
[root@rehat root]# ls-Sl
NO6.显示文件大小,并按大小排序
[root@rehat root]# ls-s-l-S
移动或更改文件/文件夹名称的CentOS常用命令 mv与 cp命令用法相似
NO1.若移动目标文件已存在,要在移动之前,先备份原来的目录文件
[root@rehat root]# mv-b test.txt test2/
这样在 test2下将有两个文件 test.txt及 text.txt~
其中 test.txt~是备份文件,test.txt是新的文件
NO2.若移动目标文件已存在,但不想弹出是否覆盖的提示,直接覆盖
[root@rehat root]# mv-f test.txt test2/
NO3.当源与目标都拥有同一个文件,若源文件比目标新则移动,否则不移动
[root@rehat root]# mv-u test.txt test2/
NO4.更改文件名称
[root@rehat root]# mv test.txt test2.txt
NO5.更改目录名称
[root@rehat root]# mv/test2/test2_2[/size]
创建/改变文件系统的CentOS常用命令
NO1.创建文件系统类型
[root@rehat root]# umount/dev/sdb1
[root@rehat root]# mkfs-t ext3/dev/db1
[root@rehat root]# mount/dev/sdb1/practice
改变文件或文件夹权限的CentOS常用命令chmod
NO1.将自己的笔记设为只有自己才能看
[root@rehat root]# chmod go-rwx test.txt
或者
[root@rehat root]# chmod 700 test.txt
NO2.同时修改多个文件的权限
[root@rehat root]# chmod 700 test1.txt test2.txt
NO3.修改一个目录的权限,包括其子目录及文件
[root@rehat root]# chmod 700-R test
改变文件或文件夹拥有者的CentOS常用命令
chown该命令只有 root才能使用
NO1.更改某个文件的拥有者
[root@rehat root]# chown jim:usergroup test.txt
NO2.更改某个目录的拥有者,并包含子目录
[root@rehat root]# chown jim:usergroup-R test
查看文本文件内容的CentOS常用命令cat
NO1.查看文件内容,并在每行前面加上行号
[root@rehat root]# cat-n test.txt
NO2.查看文件内容,在不是空行的前面加上行号
[root@rehat root]# cat-b test.txt
NO3.合并两个文件的内容
[root@rehat root]# cat test1.txt test2.txt> test_new.txt
NO4.全并两具文件的内容,并追回到一个文件
[root@rehat root]# cat test1.txt test2.txt>> test_total.txt
NO5.清空某个文件的内容
[root@rehat root]# cat/dev/null> test.txt
NO6.创建一个新的文件
[root@rehat root]# cat> new.txt按 CTRL+ C结束录入
编辑文件文件的CentOS常用命令vi
NO1.新建档案文件
[root@rehat root]# vi newfile.txt
NO2.修改档案文件
[root@rehat root]# vi test.txt test.txt已存在
NO3. vi的两种工作模式:命令模式,编辑模式
NO4.进入 vi后为命令模式,按 Insrt键进入编辑模式
按 ESC进入命令模式,在命令模式不能编辑,只能输入命令
NO5.命令模式常用命令
:w保存当前文档
:q直接退出 vi
:wq先保存后退出。
:q!强制不保存退出
创建目录的CentOS常用命令mkdir
NO1.在当前路径创建一级目录
[root@rehat root]# mkdir test
NO2.在当前路径创建多级目录
[root@rehat root]# mkdir-p mytest/test1/test1_1
NO3.在创建目录的同时给新建的目录赋权限
[root@rehat root]# mkdir-m 777 testmod
这样任何人对此目录都有任何权限
复制文件与文件夹的CentOS常用命令cp
NO1.复制指定目录的文件到当前目录,并重命名
[root@rehat root]# cp~/.bashrc bashrc_bak
NO2.强制复制指定目录的文件到当前目录,而不管当前目录是否含有该文件
[root@rehat root]# cp-f~/.bashrc bashrc
NO2.复制指定目录到当前目录
[root@rehat root]# cp-r/root/test.
[root@rehat root]# cp-r/root/test/.
两者效果一样,在复制目录时,会将源路径的最后一级目录全部复制过去,包括它本身。
NO3.复制指定目录的文件到指定目录
[root@rehat root]# cp~/.bashrc/bak/.bashrc
NO4.在复制时将源文件的全部属性也复制过来。若不指定参数,则目标文件与源文件属性可能不一致。
[root@rehat root]# cp-a~/.bashrc/bak/.bashrc
NO5.若两个文件夹要保证同步,一个文件的改了,另一个文件也跟着改,但是要保证两个文件的文件都是最新的。
[root@rehat root]# cp-u/src/.bashrc/bak_src/bashrc
建立链接文件,包括硬链接与软链接的CentOS常用命令ln
NO1.建立类似于 Windows的快捷方式
[root@rehat root]# ln-s test.txt test.txt_slnk
NO2.当想备份一个文件,但空间又不够,则可以为该文件建立一个硬连接。这样,就算原文件删除了,只要该链接文件没被删除,则在存储空间里还是没有被删除。
[root@rehat root]# ln-l test.txt test.txt_hlnk
使用CentOS常用命令查看cpu
more/proc/cpuinfo| grep"model name"
grep"model name"/proc/cpuinfo
[root@localhost/]# grep"CPU"/proc/cpuinfo
model name: Intel(R) Pentium(R) Dual CPU E2180@ 2.00GHz
model name: Intel(R) Pentium(R) Dual CPU E2180@ 2.00GHz
如果觉得需要看的更加舒服
grep"model name"/proc/cpuinfo| cut-f2-d:
使用CentOS常用命令查看内存
grep MemTotal/proc/meminfo grep MemTotal/proc/meminfo| cut-f2-d: free-m|grep"Mem"| awk'{print$2}'
使用CentOS常用命令查看cpu是32位还是64位查看CPU位数(32 or 64)
getconf LONG_BIT
使用CentOS常用命令查看当前linux的版本
more/etc/redhat-release
cat/etc/redhat-release
使用CentOS常用命令查看内核版本
uname-r
uname-a
使用CentOS常用命令查看当前时间
date上面已经介绍如何同步时间了
使用CentOS常用命令查看硬盘和分区
df-h
fdisk-l
也可以查看分区
du-sh
可以看到全部占用的空间
du/etc-sh
可以看到这个目录的大小
使用CentOS常用命令查看安装的软件包,查看系统安装的时候装的软件包
cat-n/root/install.log
more/root/install.log| wc-l
查看现在已经安装了那些软件包
rpm-qa
rpm-qa| wc-l
yum list installed| wc-l
不过很奇怪,我通过rpm,和yum这两种方式查询的安装软件包,数量并不一样。没有找到原因。
使用CentOS常用命令查看键盘布局
cat/etc/sysconfig/keyboard
cat/etc/sysconfig/keyboard| grep KEYTABLE| cut-f2-d=
使用CentOS常用命令查看selinux情况
sestatus
sestatus| cut-f2-d:
cat/etc/sysconfig/selinux
使用CentOS常用命令查看ip,mac地址
在ifcfg-eth0文件里你可以看到mac,网关等信息。
ifconfig cat/etc/sysconfig/network-scripts/ifcfg-eth0| grep IPADDR cat/etc/sysconfig/network-scripts/ifcfg-eth0| grep IPADDR| cut-f2-d= ifconfig eth0|grep"inet addr:"|awk'{print$2}'|cut-c 6- ifconfig| grep'inet addr:'| grep-v'127.0.0.1'| cut-d:-f2| awk'{ print$1}'
查看网关
cat/etc/sysconfig/network
查看dns
cat/etc/resolv.conf
使用CentOS常用命令查看默认语言
echo$LANG$LANGUAGE
cat/etc/sysconfig/i18n
使用CentOS常用命令查看所属时区和是否使用UTC时间
cat/etc/sysconfig/clock
使用CentOS常用命令查看主机名
hostname
cat/etc/sysconfig/network
修改主机名就是修改这个文件,同时最好也把host文件也修改。
使用CentOS常用命令查看开机运行时间
uptime
09:44:45 up 67 days, 23:32,...
看来刚才确实是网段的问题,我的机器还是67天前开机的。
系统资源使用情况
vmstat 1-S m procs-----------memory-------------swap-------io------system-------cpu------ r b swpd free buff cache si so bi bo in cs us sy id wa st 0 0 0 233 199 778 0 0 4 25 1 1 3 0 96 0 0 0 0 0 233 199 778 0 0 0 0 1029 856 13 1 86 0 0
删除文件的CentOS常用命令rm
NO1.删除当前目录的文件
[root@rehat root]# rm test.txt
NO2.强制删除当前目录的文件,不弹出提示
[root@rehat root]# rm-f test.txt
NO3.强制删除整个目录,包括目录与文件全部删除,需要管理员权限
[root@rehat root]# rm-r-f test
删除文件夹的CentOS常用命令rmdir
NO1.删除一个空目录
[root@rehat root]# rmdir emptydir
NO2.删除多级空目录
[root@rehat root]# rmdir-p emptydir/d1/d11
挂载文件系统与卸载文件系统的CentOS常用命令
mount/ umount
NO1.挂载光驱
[root@rehat root]# mount-t iso9660/dev/cdrom/mnt/cdrom
NO2.挂载光驱,支持中文
[root@rehat root]# mount-t iso9660-o codepage=936,iocharset=cp936/dev/cdrom/mnt/cdrom
NO3.挂载 Windows分区,FAT文件系统
[root@rehat root]# mount-t vfat/dev/hda3/mnt/cdrom
NO4.挂载 Windows分区,NTFS文件系统
[root@rehat root]# mount-t ntfs-o iocharset=cp936/dev/hda7/mnt/had7
No5.挂载 ISO文件
[root@rehat root]# mount-o loop/abc.iso/mnt/cdrom
NO6.挂载软驱
[root@rehat root]# mount/dev/fd0/mnt/floppy
NO7.挂载闪盘
[root@rehat root]# mount/dev/sda1/mnt/cdrom
NO8.挂载 Windows操作系统共享的文件夹
[root@rehat root]# mount-t smbfs-o username=guest,password=guest//machine/path/mnt/cdrom
NO9.显示挂载的文件系统
[root@rehat root]# mount
[root@rehat root]# cat/etc/fstab显示系统启动自动加载的文件系统
[root@rehat root]# cat/etc/mtab显示当前加载的文件系统
CentOS使用MPlayer有图像无声音的解决方法
CentOS在安装完MPlayer后,有些人出现了有图像无声音的情况,而网上大部分都是Linux系统的解决方法,那么CentOS系统要如何解决呢?下面小编就给大家介绍下Linux使用MPlayer播放器无声音的解决方法。
步骤:
1.安装alsa相关的包,因为rhel6和centos6以上的版本使用声卡配置都是alsa了,所以声音可能与缺这个相关的包有关。
yum install-y*alsa*
2.下在解码包 all-xxxxx.tar.bz2
3.解压all-xxxxx.tar.bz2
tar-xf all-xxxxx.tar.bz2
4.创建一个文件夹
mkdir/usr/local/lib/codecs
5.进入all-xxxx
cd all-xxxxxx
6.将里面的所有文件移到第4部创建出来的文件夹中
mv-f/all-xxx/*/usr/local/lib/codecs
7.重新。/configure.这次加上参数--codecsdir=/usr/local/lib/codecs
。/configure--codecsdir=/usr/local/lib/codecs
8.make
9.make install
上面就是CentOS使用MPlayer无声音的解决方法的介绍了,MPlayer无声音很可能是缺少alsa包所导致,下载解码包解压,按照本文介绍的方法进行相关处理。