Samba Server 설치

RHEL5 Story. | 2009/10/09 17:52 | 조림

설치확인.
[root@sms src]# rpm -qa | grep samba
samba-common-3.0.33-3.7.el5
samba-client-3.0.33-3.7.el5


삭제
[root@sms src]# rpm -e samba-client-3.0.33-3.7.el5
[root@sms src]# rpm -e --nodeps samba-common-3.0.33-3.7.el5
[root@sms src]# rpm -qa | grep samba
[root@sms src]#



새 다운로드
[root@sms src]# wget http://us3.samba.org/samba/ftp/stable/samba-3.2.4.tar.gz
압축헤제

[root@sms samba]# tar zxf samba-3.2.4.tar.gz

[root@sms samba]# cd samba-3.2.4/source



configure 실행
[root@sms source]# ./configure --prefix=/usr/local/server/samba --enable-cups --with-smbmount --with-automount

...
...
... 에러

checking for wchar_t... yes

checking for cups-config... no

configure: error: Cups support required but cups-config not located.  Make sure cups-devel related files are installed.



[root@sms source]# yum install -y cups*

Transaction Summary

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

Install      3 Package(s)

Update       3 Package(s)

Remove       0 Package(s)


Total download size: 4.0 M

Downloading Packages:

(1/6): cups-lpd-1.3.7-11.el5.x86_64.rpm                                                                                  |  56 kB     00:00

(2/6): cups-devel-1.3.7-11.el5.x86_64.rpm                                                                                |  74 kB     00:00

(3/6): cups-devel-1.3.7-11.el5.i386.rpm                                                                                  |  74 kB     00:00

(4/6): cups-libs-1.3.7-11.el5.x86_64.rpm                                                                                 | 191 kB     00:01

(5/6): cups-libs-1.3.7-11.el5.i386.rpm                                                                                   | 195 kB     00:01

(6/6): cups-1.3.7-11.el5.x86_64.rpm                                                                                      | 3.4 MB     00:04

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

Total                                                                                                           322 kB/s | 4.0 MB     00:12

Running rpm_check_debug

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

  Updating       : cups-libs                                         [1/9]

  Updating       : cups-libs                                         [2/9]

  Updating       : cups                                              [3/9]

  Installing     : cups-devel                                        [4/9]

  Installing     : cups-devel                                        [5/9]

  Installing     : cups-lpd                                          [6/9]

  Cleanup        : cups-libs                                         [7/9]

  Cleanup        : cups-libs                                         [8/9]

  Cleanup        : cups                                              [9/9]


Installed: cups-devel.x86_64 1:1.3.7-11.el5 cups-devel.i386 1:1.3.7-11.el5 cups-lpd.x86_64 1:1.3.7-11.el5

Updated: cups.x86_64 1:1.3.7-11.el5 cups-libs.i386 1:1.3.7-11.el5 cups-libs.x86_64 1:1.3.7-11.el5

Complete!

[root@sms source]#

다시 실행.
[root@sms source]# ./configure --prefix=/usr/local/server/samba --enable-cups --with-smbmount --with-automount
...
...
...
config.status: creating pkgconfig/wbclient.pc
config.status: creating pkgconfig/netapi.pc
config.status: creating pkgconfig/smbsharemodes.pc
config.status: creating include/config.h
config.status: executing rm-stdint.h commands
config.status: executing rm-stdbool.h commands
[root@intranet source]#

컴파일
[root@sms source]# make && make install





samba 환경설정

[root@sms source]# cd ..
[root@sms samba-3.2.4]# cd examples/
[root@sms examples]# cp smb.conf.default /usr/local/server/samba/lib/smb.conf
[root@sms examples]# cd /usr/local/server/samba
[root@sms samba]# vi lib/smb.conf

---------------------------------------------------------------------------------
# workgroup = NT-Domain-Name or Workgroup-Name, eg: MIDEARTH
   workgroup = WORKGROUP

# server string is the equivalent of the NT Description field
   server string = Samba Server

# Security mode. Defines in which mode Samba will operate. Possible
# values are share, user, server, domain and ads. Most people will want
# user level security. See the Samba-HOWTO-Collection for details.
   security = share
---------------------------------------------------------------------------------
"lib/smb.conf" 271L, 9687C written


방화벽 설정
[root@sms samba]# vi /etc/sysconfig/iptables

# Firewall configuration written by system-config-securitylevel
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:RH-Firewall-1-INPUT - [0:0]
-A INPUT -j RH-Firewall-1-INPUT
-A FORWARD -j RH-Firewall-1-INPUT
-A RH-Firewall-1-INPUT -i lo -j ACCEPT
-A RH-Firewall-1-INPUT -p icmp --icmp-type any -j ACCEPT
-A RH-Firewall-1-INPUT -p 50 -j ACCEPT
-A RH-Firewall-1-INPUT -p 51 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp --dport 5353 -d 224.0.0.251 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m udp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 631 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 21 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 80 -j ACCEPT
-A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 25 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 137 -j ACCEPT
-A RH-Firewall-1-INPUT -p udp -m state --state NEW -m udp --dport 138 -j ACCEPT
-A RH-Firewall-1-INPUT -p tcp -m state --state NEW -m tcp --dport 139 -j ACCEPT

-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited
COMMIT
~                                                                                                                            
"/etc/sysconfig/iptables" 26L, 1347C written

방화벽 재시작
[root@intranet samba]# /etc/init.d/iptables restart
방화벽 규칙을 삭제하는 중:                                 [  OK  ]
chains를 ACCEPT 규칙으로 설정함: filter                    [  OK  ]
iptables 모듈을 제거하는 중:                               [  OK  ]
iptables 방화벽 규칙들을 적용하는 중:                      [  OK  ]
추가 iptables 모듈을 읽어오는 중: ip_conntrack_netbios_ns i[  OK  ]ack_ftp
[root@sms samba]#



삼바실행
[root@sms samba]# /usr/local/server/samba/sbin/smbd -D
/usr/local/server/samba/sbin/smbd: error while loading shared libraries: libtalloc.so.1: cannot open shared object file: No such file or directory

에러다!


[root@sms samba]# cd /usr/lib
[root@sms lib]# ln -s /usr/local/server/samba/lib/libtalloc.so.1 libtalloc.so.1
[root@sms lib]# ln -s /usr/local/server/samba/lib/libtdb.so.1 libtdb.so.1
[root@sms lib]# ln -s /usr/local/server/samba/lib/libwbclient.so.0 libwbclient.so.0

다시 실행
[root@sms lib]# /usr/local/server/samba/sbin/smbd -D
[root@sms lib]# /usr/local/server/samba/sbin/nmbd -D

일단 기본은 끝.



공유디렉토리 설정 (궂이 안해도됨) - 그래서 안함.

[root@
sms fnf]# cd /home/fnf
[root@
sms fnf]# mkdir public_files
[root@
sms fnf]# chmod 777 public_files/
[root@
sms fnf]#
[root@
sms fnf]# vi /usr/local/server/samba/lib/smb.conf

아래 내용 추가
[public_files]
   comment = test folder by youngJo
   path = /home/fnf/public_files
   public = yes
   writable = yes
   printable = no


~                                                                                                                                  
"/usr/local/server/samba/lib/smb.conf" 279L, 9825C written
[root@intranet fnf]#

재시작
[root@sms fnf]# killall smbd nmbd
[root@sms fnf]# /usr/local/server/samba/sbin/smbd -D
[root@sms fnf]# /usr/local/server/samba/sbin/nmbd -D





리눅스에서 윈도우즈서버로 접속하기

[root@intranet bin]# smbclient //172.0.0.200/wwwroot -U uid 윈도우즈에 셋팅한 아이디
Enter uid's password:
Domain=[DL380G5] OS=[Windows Server 2003 3790 Service Pack 2] Server=[Windows Server 2003 5.2]


삼바 마운트

[root@intranet mnt]# mount -t cifs -o username=administrator,password=******* //172.0.0.200/wwwroot /mnt/fileserver

기타..............................

Q. 삼바를 활용하여 자료 공유를 하고 있습니다. 그런데 속도가 느려서 자료를 주고받기가 불편한데 속도를 향상시킬 수 있는 방법은 없습니까
삼바의 속도향상을 원한다면 다음과 같이 하기 바랍니다.

# vi /etc/samba/smb.conf

smb.conf 파일을 연 후 아래 줄을 수정하거나 추가합니다.

socket options = TCP_NODELAY IPTOS_LOWDELAY SO_SNDBUF=4096 SO_RCVBUF=4096


상세설정
http://jetzt.tistory.com/328

이전 1 ... 2 3 4 5 6 7 8 9 10 ... 71 다음