知识屋:更实用的电脑技术知识网站
所在位置:首页 > 操作系统 > linux

OEL6下艰难的samba3.6源码安装

发布时间:2014-09-05 16:45:56作者:知识屋

 

在OEL6 下安装samba3.6源码包,折腾了近两天才搞定,郁闷啊,写这篇blog的时候,samba3.6 install problem 在internet上非常少,只有这个URL

http://blog.csdn.net/xyp84/article/details/6830984 说了下安装一些步骤和问题,但我的环境不符合这位哥的情况,最后在国外论坛上看到一条信息才解决。

 

说下我的安装过程:

 

1、 下载samba3.6 并解压

 

[root@heliy /home/fukeyun/Desktop/download/temp]#ls ../samba-3.6.0.tar.gz

../samba-3.6.0.tar.gz

 

[root@heliy /home/fukeyun/Desktop/download/temp]#ls

 

 

 

samba-3.6.0

 

 

 

2 、安装

 

#cd ./samba-3.6.0

 

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0]#find . -name 'configure'

./lib/tdb/configure

./lib/replace/configure

./lib/talloc/configure

./lib/tevent/configure

./source4/lib/ldb/configure

./source3/configure

 

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0]#cd ./source3

 

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0/source3]#./autogen.sh

 

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0/source3]#./autogen.sh

./autogen.sh: running script/mkversion.sh

./script/mkversion.sh: 'include/version.h' created for Samba("3.6.0")

./autogen.sh: running autoheader -Im4 -I../m4 -I../lib/replace

./autogen.sh: running autoconf -Im4 -I../m4 -I../lib/replace

Now run ./configure (or ./configure.developer) and then make.

 

安装完后提示你./configure

#./configure    ##默认安装到/usr/local/samba ,如果想安装到其他path,加--prefix=/path.. 或--help查看详细信息

#make

#make install

需要几分钟时间。

 

3、配置

先cp配置文件,再启动服务,不然出现如下错误:

[root@heliy /usr/local/samba]#cat ./var/log.smbd

[2011/10/26 04:56:37,  0] smbd/server.c:1045(main)

  smbd version 3.6.0 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2011

[2011/10/26 04:56:37,  0] smbd/server.c:1060(main)

  error opening config file

 

拷贝smb.conf文件

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0/source3]#cp ../examples/smb.conf.default /usr/local/samba/lib/smb.conf

#vi /usr/local/samba/lib/smb.conf

 

简单配置下,详细配置见附件

 

启动服务

 

启动nmbd -D 能启动,但smbd无法启动

 

查看日志:

 

#cat ./var/log.smbd

错误如下:

 

smbd version 3.6.0 started.

  Copyright Andrew Tridgell and the Samba Team 1992-2011

/usr/local/samba/sbin/smbd: symbol lookup error: /usr/local/samba/sbin/smbd: undefined symbol: wbcSidsToUnixIds

[2011/10/26 05:31:27,  0] smbd/server.c:1045(main)

 

 

就这个错误折腾我近两天,郁闷,国外论坛有条信息如下:

 

==========================================

 

Guido Leenders 2011-09-13 18:05:57 UTC

 

I had the same problem when compiling Samba 3.6.0 from source.

In the log.smbd it said: undefined symbol wbcSidsToUnixIds for smbd.

 

Configure options:

 

./configure --prefix=/usr --exec-prefix=/usr --with-ldap --with-libtalloc=no

--enable-external-libtalloc=no --with-libtdb=no --enable-external-libtdb=no

--with-libnetapi --with-libsmbclient --with-libsmbsharemodes --with-libaddns

--with-ads --with-dnsupdate --with-pam --with-acl-support --with-aio-support

--with-winbind --with-lockdir=/var/lib/samba --with-configdir=/etc/samba

--with-logfilebase=/var/log/samba

 

The installation did install libwbclient:

Installing module pam_smbpass as ///usr/lib/security/pam_smbpass.so

Installing module pam_winbind as ///usr/lib/security/pam_winbind.so

/usr/bin/install -c bin/libwbclient.so.0 //usr/lib

if test -r bin/libwbclient.so.0 ; then /

                ln -f -s `basename bin/libwbclient.so.0` /

                        //usr/lib/`basename bin/libwbclient.so` ; /

        fi

: bin/libwbclient.a //usr/lib

/usr/bin/install -c -m 0644

/usr/local/src/samba-3.6.0/source3/../nsswitch/libwbclient/wbclient.h

//usr/include

 

 

Resolution for me was simply:

 

ldconfig

 

And restart smbd.

 

Rgds,

www.zhishiwu.com

Guido Leenders

========================================

 

很明显,是libwbclient.so库文件问题

 

[root@heliy /home/fukeyun/Desktop/download/temp/samba-3.6.0/source3]#/usr/bin/install -c  ./bin/libwbclient.so.0  /usr/lib

再启动服务

 

smbd -D 和nmbd -D

 

[root@heliy /usr/local/samba]#ps -ef |grep 'mbd'

root     31681     1  0 05:49 ?        00:00:00 ./sbin/smbd -D

root     31682 31681  0 05:49 ?        00:00:00 ./sbin/smbd -D

root     31720     1  0 05:51 ?        00:00:00 ./sbin/nmbd -D

root     32149  2828  0 06:16 pts/0    00:00:00 grep mbd

 

如果认为samba就此建好了,就大错了,由于默认安装gnome-desktop时安装了samba一些rpm包,会造成在全局环境下命令不是源码包的命令,比如smbpasswd

 

,你which smbpasswd 看明显不是/usr/local/samba/bin下的命令,testparm

 

用到的smb.conf文件是/etc/samba/smb.conf,所以我现在才明白samba的安装只有两种正确方式:1、用系统光盘的RPM包,或下载的RPM安装 。就不需要卸载已安装的samba rpm包  2、用源码包安装前最好卸载samba 的rpm包,我现在介绍第2种方式:

 

删掉rpm包

 

[root@heliy /usr/local/samba]#rpm -aq | grep -i 'samba'

samba-common-3.5.4-68.el6.i686

samba-winbind-clients-3.5.4-68.el6.i686

samba-client-3.5.4-68.el6.i686

[root@heliy /usr/local/samba]#rpm -e samba-client-3.5.4-68.el6.i686

[root@heliy /usr/local/samba]#rpm -e samba-common-3.5.4-68.el6.i686

 

再按前面写的安装samba,./configure make make install (题外话:由于我是按上面的方法安装初次,所以要删除前面的安装make uninstall  再删除一些目录[root@heliy /usr/local/samba]#rm -fR /etc/samba/

[root@heliy /usr/local/samba]#rm -fR /usr/local/samba/

[root@heliy /usr/local/samba]#rm -fR /var/log/samba/

[root@heliy /usr/local/samba]#rm -fR /var/lib/samba/    )

 

cp smb.conf 和配置,上面有

 

设置全局环境变量

 

[root@heliy /usr/local/samba]#vi /etc/profile.d/heliy.sh

 

export PATH=$PATH:/usr/local/samba/bin/

 

[root@heliy /usr/local/samba]#source /etc/profile.d/heliy.sh

root@heliy /usr/local/samba]#env | grep 'PATH'

PATH=/usr/lib/qt-3.3/bin:/usr/local/bin:............:/usr/local/samba/bin/

 

在这里有个小收获: 我打开了两个终端,我用source /etc/profile.d/heliy.sh后,本终端可以获取全局变量更改后的路径,另一个不行,比如输入smb再按TAB键,第一个终端就可以显示很多命令,第二个就不行,必须关闭打开新的才有。

 

设置用户

 

#smbpasswd -a fukeyun

 

#smbpasswd -e fukeyun

 

启动服务smbd -D  nmbd -D       就不会出现本blog前面的错误提示

 

最后登录如下:

 

[root@heliy /home/fukeyun]#smbclient -L //localhost/myshare -U fukeyun

Enter fukeyun's password:

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.0]

 

    Sharename       Type      Comment

    ---------       ----      -------

Error returning browse list: NT_STATUS_CONNECTION_INVALID

Domain=[WORKGROUP] OS=[Unix] Server=[Samba 3.6.0]

 

    Server               Comment

    ---------            -------

    HELIY                Samba Server

 

    Workgroup            Master

    ---------            -------

    WORKGROUP            HELIY

[root@heliy /home/fukeyun]#

 

我会不断补充samba的技术信息在本篇blog。

 

本文出自 “可韵之家-心梦无影” 博客

(免责声明:文章内容如涉及作品内容、版权和其它问题,请及时与我们联系,我们将在第一时间删除内容,文章内容仅供参考)
收藏
  • 人气文章
  • 最新文章
  • 下载排行榜
  • 热门排行榜