顯示具有 RedHat5 Linux 標籤的文章。 顯示所有文章
顯示具有 RedHat5 Linux 標籤的文章。 顯示所有文章

2013年10月23日 星期三

RedHat 5.5 64 Bit 安裝 iftop


以下這一個檔案不分32Bit or 64Bit
wget http://www.ex-parrot.com/pdw/iftop/download/iftop-0.17.tar.gz

tar zxvf iftop-0.17.tar.gz

cd iftop-0.17

./configure

checking build system type... i686-pc-linux-gnu
checking host system type... i686-pc-linux-gnu
checking target system type... i686-pc-linux-gnu
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... gawk
checking whether make sets ${MAKE}... yes
checking for gcc... gcc
checking for C compiler default output... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking sys/sockio.h usability... no
checking sys/sockio.h presence... no
checking for sys/sockio.h... no
checking for unistd.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking sys/dlpi.h usability... no
checking sys/dlpi.h presence... no
checking for sys/dlpi.h... no
checking for regcomp... yes
checking for select... yes
checking for strdup... yes
checking for strerror... yes
checking for strspn... yes
checking for library containing socket... none required
checking for library containing log... -lm
checking for gethostbyname... yes
checking for library containing inet_aton... none required
checking for library containing inet_pton... none required
checking for inet_aton... yes
checking for inet_pton... yes
checking size of u_int8_t... 1
checking size of u_int16_t... 2
checking size of u_int32_t... 4
checking for library containing getnameinfo... none required
checking for library containing gethostbyaddr_r... none required
checking how to call gethostbyaddr_r... 8 args, int return
checking gethostbyaddr_r usability... yes
checking where to find pcap.h... no idea
configure: error: can't find pcap.h
You're not going to get very far without libpcap.

你需要安裝 libpcap-devel


checking for a curses library containing mvchgat... none found
configure: error: Curses! Foiled again!
  (Can't find a curses library supporting mvchgat.)

  Consider installing ncurses.

你需要將 ncurses和ncurses-devel都装上


make && make install

make  all-recursive
make[1]: Entering directory `/root/iftop-0.17'
Making all in config
make[2]: Entering directory `/root/iftop-0.17/config'
make[2]: Nothing to be done for `all'.
make[2]: Leaving directory `/root/iftop-0.17/config'
make[2]: Entering directory `/root/iftop-0.17'
source='addr_hash.c' object='addr_hash.o' libtool=no \
       depfile='.deps/addr_hash.Po' tmpdepfile='.deps/addr_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addr_hash.c' || echo './'`addr_hash.c
source='edline.c' object='edline.o' libtool=no \
       depfile='.deps/edline.Po' tmpdepfile='.deps/edline.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'edline.c' || echo './'`edline.c
source='hash.c' object='hash.o' libtool=no \
       depfile='.deps/hash.Po' tmpdepfile='.deps/hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'hash.c' || echo './'`hash.c
source='iftop.c' object='iftop.o' libtool=no \
       depfile='.deps/iftop.Po' tmpdepfile='.deps/iftop.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'iftop.c' || echo './'`iftop.c
source='ns_hash.c' object='ns_hash.o' libtool=no \
       depfile='.deps/ns_hash.Po' tmpdepfile='.deps/ns_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'ns_hash.c' || echo './'`ns_hash.c
source='options.c' object='options.o' libtool=no \
       depfile='.deps/options.Po' tmpdepfile='.deps/options.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'options.c' || echo './'`options.c
source='resolver.c' object='resolver.o' libtool=no \
       depfile='.deps/resolver.Po' tmpdepfile='.deps/resolver.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'resolver.c' || echo './'`resolver.c
source='screenfilter.c' object='screenfilter.o' libtool=no \
       depfile='.deps/screenfilter.Po' tmpdepfile='.deps/screenfilter.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'screenfilter.c' || echo './'`screenfilter.c
source='serv_hash.c' object='serv_hash.o' libtool=no \
       depfile='.deps/serv_hash.Po' tmpdepfile='.deps/serv_hash.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'serv_hash.c' || echo './'`serv_hash.c
source='sorted_list.c' object='sorted_list.o' libtool=no \
       depfile='.deps/sorted_list.Po' tmpdepfile='.deps/sorted_list.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'sorted_list.c' || echo './'`sorted_list.c
source='threadprof.c' object='threadprof.o' libtool=no \
       depfile='.deps/threadprof.Po' tmpdepfile='.deps/threadprof.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'threadprof.c' || echo './'`threadprof.c
source='ui.c' object='ui.o' libtool=no \
       depfile='.deps/ui.Po' tmpdepfile='.deps/ui.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'ui.c' || echo './'`ui.c
source='util.c' object='util.o' libtool=no \
       depfile='.deps/util.Po' tmpdepfile='.deps/util.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'util.c' || echo './'`util.c
source='addrs_ioctl.c' object='addrs_ioctl.o' libtool=no \
       depfile='.deps/addrs_ioctl.Po' tmpdepfile='.deps/addrs_ioctl.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addrs_ioctl.c' || echo './'`addrs_ioctl.c
source='addrs_dlpi.c' object='addrs_dlpi.o' libtool=no \
       depfile='.deps/addrs_dlpi.Po' tmpdepfile='.deps/addrs_dlpi.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'addrs_dlpi.c' || echo './'`addrs_dlpi.c
source='dlcommon.c' object='dlcommon.o' libtool=no \
       depfile='.deps/dlcommon.Po' tmpdepfile='.deps/dlcommon.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'dlcommon.c' || echo './'`dlcommon.c
source='stringmap.c' object='stringmap.o' libtool=no \
       depfile='.deps/stringmap.Po' tmpdepfile='.deps/stringmap.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'stringmap.c' || echo './'`stringmap.c
source='cfgfile.c' object='cfgfile.o' libtool=no \
       depfile='.deps/cfgfile.Po' tmpdepfile='.deps/cfgfile.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'cfgfile.c' || echo './'`cfgfile.c
source='vector.c' object='vector.o' libtool=no \
       depfile='.deps/vector.Po' tmpdepfile='.deps/vector.TPo' \
       depmode=gcc3 /bin/sh ./config/depcomp \
       gcc -DHAVE_CONFIG_H -I. -I. -I.     -g -O2  -c `test -f 'vector.c' || echo './'`vector.c
gcc  -g -O2    -o iftop  addr_hash.o edline.o hash.o iftop.o ns_hash.o options.o resolver.o screenfilter.o serv_hash.o sorted_list.o threadprof.o ui.o util.o addrs_ioctl.o addrs_dlpi.o dlcommon.o stringmap.o cfgfile.o vector.o  -lpcap -lm  -lcurses -lpthread
make[2]: Leaving directory `/root/iftop-0.17'
make[1]: Leaving directory `/root/iftop-0.17'
Making install in config
make[1]: Entering directory `/root/iftop-0.17/config'
make[2]: Entering directory `/root/iftop-0.17/config'
make[2]: Nothing to be done for `install-exec-am'.
make[2]: Nothing to be done for `install-data-am'.
make[2]: Leaving directory `/root/iftop-0.17/config'
make[1]: Leaving directory `/root/iftop-0.17/config'
make[1]: Entering directory `/root/iftop-0.17'
make[2]: Entering directory `/root/iftop-0.17'
/bin/sh ./config/mkinstalldirs /usr/local/sbin
 /usr/bin/install -c iftop /usr/local/sbin/iftop
/bin/sh ./config/mkinstalldirs /usr/local/man/man8
mkdir -p -- /usr/local/man/man8
/usr/bin/install -c -m 644 ./iftop.8 /usr/local/man/man8/iftop.8
make[2]: Leaving directory `/root/iftop-0.17'
make[1]: Leaving directory `/root/iftop-0.17'
[root@aps24 iftop-0.17]# iftop
interface: eth0
Unable to get IP address for interface: eth0
ioctl(SIOCGIFADDR): Cannot assign requested address
MAC address is: 5c:f3:fc:4b:fa:76

以上這樣就可以使用,在任何位置輸入iftop 即可

2013年9月25日 星期三

Redhat 4,5 Bonding 雙網卡網路

RedHat 4 的作法
vim /etc/modprobe.conf
alias bond0 bonding

若有多張網卡,可定議如下
alias bondx bonding
x為數字
依此類推

新增/etc/sysconfig/network-script/ifcfg-bond0
若有多張網卡,可以定議如下
/etc/sysconfig/network-script/ifcfg-bondx
x為數字
/etc/sysconfig/network-script/ifcfg-bond0 設定如下
DEVICE=bond0
IPADDR=192.168.1.2
NETMASK=255.255.255.0
USERCTL=no
BOOTPROTO=none
ONBOOT=yes
BONDING_OPTS="mode=1 miimon=100"

/etc/sysconfig/network-script/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

/etc/sysconfig/network-script/ifcfg-eth1
DEVICE=eth1
BOOTPROTO=none
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

重啟網路
service network restart


RedHat 5 的作法
新增/etc/modprobe.d/aliases.conf ,這檔名可以自定,只要最後是帶.conf就可以被系統認出
alias bond0 bonding 若有多張網卡,設定與RH4相同

新增/etc/sysconfig/network-scripts/ifcfg-bond0
DEVICE=bond0
TYPE=bonding
BOOTPROTO=static
IPADDR=192.168.1.3
NETMASK=255.255.255.0
GATEWAY=192.168.1.1
ONBOOT=yes
USERCTL=no
NM_CONTROLLED=no
BONDING_OPTS="mode=6 miimon=100 updelay=200 downdelay=200"

vim /etc/sysconfig/network-scripts/ifcfg-eth0
# Broadcom Corporation NetXtreme II BCM5709 Gigabit Ethernet
DEVICE=eth0
HWADDR=5C:F3:FC:4B:FA:xx 這是你要綁定那一張網卡,可別照抄了
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no


/etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=5C:F3:FC:4B:FA:xx  這是你要綁定那一張網卡,可別照抄了
BOOTPROTO=none
NM_CONTROLLED=no
ONBOOT=yes
MASTER=bond0
SLAVE=yes
USERCTL=no

重啟網路
service network restart


模式有以下幾種,我各人比較偏好模式6
以下摘自http://marcustsai.blogspot.tw/2012/11/rhel5-6-nic-bonding.html
3.Bond Mode:

0balance-rr‧負載平衡模式, 需有 switch 設定 (trunk) 支援才能發揮實質效果
‧具容錯功能, 其中一張 Slave 網卡失效仍可持續運作
1active-backup‧同一時間只有單一 Slave 網卡運作
‧Active Slave 網卡失效時自動啟用次一順位 Slave 網卡
‧不需 switch 支援
2balance-xorTransmit based on [(source MAC address XOR'd with destination MAC address) modulo slave count]. This selects the same slave for each destination MAC address. This mode provides load balancing and fault tolerance.
3broadcast‧所有 Slave 網卡一齊收送網路封包
‧具容錯功能, 其中一張 Slave 網卡失效仍可持續運作
4802.3adIEEE 802.3ad Dynamic link aggregation. Creates aggregation groups that share the same speed and duplex settings. Utilizes all slaves in the active aggregator according to the 802.3ad specification.

*Pre-requisites:

1. Ethtool support in the base drivers for retrieving the speed and duplex of each slave.

2. A switch that supports IEEE 802.3ad Dynamic link aggregation. Most switches will require some type of configuration to enable 802.3ad mode
此模式可以參考 http://phorum.study-area.org/index.php?topic=43051.0
5balance-tlb‧傳出自動負載平衡
‧傳入由 Current Active Slave 負責
‧具容錯功能, 其中一張 Slave 網卡失效仍可持續運作
‧不需 switch 支援及設定
6balance-alb‧傳出及傳入皆自動負載平衡
‧具容錯功能, 其中一張 Slave 網卡失效仍可持續運作
‧Slave 網卡 driver 需支援 setting hardware address 功能
‧不需 switch 支援及設定

2013年2月6日 星期三

Redhat 下svn服务器搭建--CentOS 5.5下搭建部署独立SVN服务器全程详解


CentOS 5.5下搭建部署独立SVN服务器全程详解
SVN服务器有2种运行方式:
1、独立服务器(例如:svn://xxx.com/xxx);
2、借助apache   (例如:http://svn.xxx.com/xxx);
为了不依赖apache,我选择第一种方式:独立的svn服务器。
SVN存储版本数据也有2种方式:
1、bdb;
2、fsfs。
由于bdb方式在服务器中断时,有可能锁住数据,所以还是fsfs方式更安全一点,我也选择这种方式。
具体部署:
1.下载subversion安装包[root@server ~]# cd /usr/local/src
[root@server src]# ls
[root@server src]# wget http://subversion.tigris.org/downloads/subversion-1.6.6.tar.gz
[root@server src]# wget http://subversion.tigris.org/downloads/subversion-deps-1.6.6.tar.gz
[root@server src]# tar xfvz subversion-1.6.6.tar.gz
[root@server src]# tar xfvz subversion-deps-1.6.6.tar.gz
[root@server src]# cd subversion-1.6.6
[root@server subversion-1.6.6]#
 
2.编译SVN
首先检测系统有没有安装SSL:[root@server subversion-1.6.6]# find / -name opensslv.h
[root@server subversion-1.6.6]#
找不到,就执行如下命令进行安装:[root@server subversion-1.6.6]# yum install openssl
[root@server subversion-1.6.6]# yum install openssl-devel 
安装之后用find / -name opensslv.h命令找到opensslv.h所在的目录,即下列--with-openssl=后面的路径,编译:
[root@server subversion-1.6.6]# find / -name opensslv.h
/usr/include/openssl/opensslv.h
[root@server subversion-1.6.6]# ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db
注:以svnserve方式运行,不加apache编译参数。以fsfs格式存储版本库,不编译berkeley-db。
此时编译报如下错误:
configure: WARNING: unrecognized options: --with-openssl
configure: Configuring Subversion 1.6.6
configure: creating config.nice
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/usr/local/src/subversion-1.6.6':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details.
说明没有安装gcc相关库,使用如下命令安装gcc后再编译:
[root@server subversion-1.6.6]# yum -y install gcc
[root@server subversion-1.6.6]# ./configure --prefix=/usr/local/svn --with-openssl=/usr/include/openssl --without-berkeley-db 
最后出现下面WARNING,直接忽略即可,因为不使用BDB存储。configure: WARNING: we have configured without BDB filesystem support
You don't seem to have Berkeley DB version 4.0.14 or newer
installed and linked to APR-UTIL. We have created Makefiles which
will build without the Berkeley DB back-end; your repositories will
use FSFS as the default back-end. You can find the latest version of
Berkeley DB here:
http://www.sleepycat.com/download/index.shtml 
3.安装SVN
为避免出现以下错误
error while loading shared libraries: libiconv.so.2: cannot open shared object file: No such file or directory
先执行以下操作:
1)、编辑/etc/ld.so.conf文件,添加下面一行:
/usr/local/lib
2)、保存后运行ldconfig:
/sbin/ldconfig
 
 
注:ld.so.conf和ldconfig用于维护系统动态链接库。
安装
[root@server subversion-1.6.6]# make && make install
 
 
安装完成,执行以下命令测试:
[root@server subversion-1.6.6]# /usr/local/svn/bin/svnserve --version
 
svnserve,版本1.6.6 (r40053)
   编译于Feb 15 2012,22:15:26
 
版权所有(C) 2000-2009 CollabNet。
Subversion 是开放源代码软件,请参阅http://subversion.tigris.org/ 站点。
此产品包含由CollabNet(http://www.Collab.Net/) 开发的软件。
 
下列版本库后端(FS) 模块可用:
 
* fs_fs : 模块与文本文件(FSFS)版本库一起工作。
 
 
 
为了方便下操作,下面将SVN的BIN添加到PATH,编辑/etc/profile,添加:
PATH=/usr/local/svn/bin:$PATH
保存后,使其立即生效:
source /etc/profile
4.配置SVN
建立版本库目录,可建多个:
[root@server ~]# mkdir -p /home/svndata/repos

#建立版本库
[root@server ~]# /usr/local/svn/bin/svnadmin create /home/svndata/repos

#修改版本库配置文件 
编辑/home/svndata/repos/conf/svnserve.conf,内容修改为:
[general]
anon-access = none
auth-access = write
password-db = /usr/local/svn/conf/passwd (亦可不寫完整路徑)
authz-db = /usr/local/svn/conf/authz (亦可不寫完整路徑)
realm = repos (這邊就是你程式庫名稱 svn://xxx.xxx.xxx/repos)
注意:对用户配置文件的修改立即生效,不必重启svn。
在/usr/local/svn/下面新建conf目录,并在/usr/local/svn/conf内新建passwd.conf和authz.conf文件:

(若沒有寫完整路徑,其設定檔會在/home/svndata/repos/conf/目錄下)
mkdir conf
cd conf/
touch passwd.conf
touch authz.conf
 
添加用户及密码:

[root@server ~]# useradd wll (系統必需建立帳號,否則SVN Client不能正確登入)
[root@server ~]# passwd wll (其實這密碼跟登入SVN Client沒有關係,所以不設也可以)
 
编辑/usr/local/svn/conf/passwd.conf,添加如下代码并保存:
[users]
wll = 123456
配置svn用户访问权限,编辑usr/local/svn/conf/authz.conf,添加如下代码并保存:
[groups]
admin = wll
[/]
@admin = rw
# [repos:/abc/aaa]
# king = rw
# [repos:/pass]
# king =svn
 
 
注意:
* 权限配置文件中出现的用户名必须已在用户配置文件中定义。
* 对权限配置文件的修改立即生效,不必重启svn。
用户组格式:
[groups]
= ,
其中,1个用户组可以包含1个或多个用户,用户间以逗号分隔。
版本库目录格式:
[<版本库>:/项目/目录]
@<用户组名> = <权限>
<用户名> = <权限>
其中,方框号内部分可以有多种写法:
[/],表示根目录及以下,根目录是svnserve启动时指定的,我们指定为/home/svndata,[/]就是表示对全部版本库设置权限。
[repos:/] 表示对版本库repos设置权限;
[repos:/abc] 表示对版本库repos中的abc项目设置权限;
[repos:/abc/aaa] 表示对版本库repos中的abc项目的aaa目录设置权限;
权限主体可以是用户组、用户或*,用户组在前面加@,*表示全部用户。
权限可以是w、r、wr和空,空表示没有任何权限。
 
建立启动svn的用户:   

[root@server ~]# useradd svn
[root@server ~]# passwd svn
允许用户svn访问版本库:

[root@server ~]# chown -R svn:svn /home/svndata 
启动svn:

[root@server ~]# su - svn -c "svnserve -d --listen-port 9999 -r /home/svndata"
 
其中:
su - svn :表示以用户svn的身份启动svn;
-d :表示以daemon方式(后台运行)运行;
--listen-port 9999 :表示使用9999端口,可以换成你需要的端口。但注意,使用1024以下的端口需要root权限;
-r /home/svndata :指定根目录是/home/svndata。
 
5.将svn加入到开机启动
编辑/etc/rc.d/rc.local文件,加入如下启动命令:/usr/local/svn/bin/svnserve -d --listen-port 9999 -r /home/svndata
如果想停止svn,则使用如下命令:
killall svnserve
如果想将svn作为服务,在/etc/rc.d/init.d/目录下新建名为svn的文件并设置权限为755,并添加如下代码:#!/bin/bash
# build this file in /etc/rc.d/init.d/svn
# chmod 755 /etc/rc.d/init.d/svn
# centos下可以用如下命令管理svn: service svn start(restart/stop)
SVN_HOME=/home/svndata
if [ ! -f "/usr/local/svn/bin/svnserve" ]
then
    echo "svnserver startup: cannot start"
    exit
fi
case "$1" in
    start)
        echo "Starting svnserve..."
        /usr/local/svn/bin/svnserve -d --listen-port 9999 -r $SVN_HOME
        echo "Finished!"
        ;;
    stop)
        echo "Stoping svnserve..."
        killall svnserve
        echo "Finished!"
        ;;
    restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: svn { start | stop | restart } "
        exit 1
esac 
6.连接SVN
安装TortoiseSVN,重启系统。启动TortoiseSVN并在地址栏中输入svn://192.168.1.87:9999/repos
 
根据提示输入用户名与密码后就可以
 
 

RHEL 5.1 的yum


當我們在做RHEL的練習時,沒有YUM可以用實在很不方便,要常常去找光碟片上的RPM來安裝,偏偏上RHCE課程時送的光碟又只有CD的分成好幾片,實在非常不方便(這實在很詭異,難道RedHat認為花的起上課費用的學員,家裡電腦會沒有DVD嗎).
RHEL因為是付費版,所以如果沒有買授權是無法註冊RHN來使用YUM,但一般我們在做練習又不可能去花錢買授權,所以只有2種方式讓你能用YUM.
1.自己使用光碟片的檔案建立Local YUM Server
2.使用其他的YUM Server
先介紹第2種最簡單的方式,大家在學RHEL時一定要認識CentOS,因為它就是一群善心人士基於RHEL也是Open Source所以希望能讓更多人使用,把RHEL重新建置成免費版本,要注意他無法保證跟RHEL一模一樣,但穩定度一定比Fedora好.
上面提到CentOS跟RHEL是極相似的雙胞胎,所以這也代表CentOS的YUM Server上的RPM也可以安裝在RHEL上.
如果有上過課的一定必須知道怎麼設定新的YUM Server目標,就是新增一個yum repos.
先到/etc/yum.repos.d目錄裡,建立一個到CentOS的yum repos
#cd /etc/yum.repos.d
#vi centos.repo      <==檔名可自定,但副檔名一定要.repo
將以下內容複製到centos.repo並儲存
[c5base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#released updates
[c5updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[c5addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[c5extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
#additional packages that extend functionality of existing packages
[c5plus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

再來就是將yum的cache清除
#yum clean all
完成,下次你就可以在RHEL上使用YUM了
注意:以上方式只是用於,平時在家裡做練習時方便用,如果在公司使用請購買RedHat的正式授權,以確保系統的穩定度.
不然就是改用CentOS
絕對不要再正式環境使用無法做正常yum更新的RHEL這樣是非常不安全的,而且也違反軟體著作財產權.

2008年6月30日 星期一

在RHEL5架設DNS Server

RHEL5跟以往RHEL4與RHEL3在架設DNS Server時,有些不一樣,
不一樣的地方在於,ㄟ~~configure file怎麼都沒看到哩,
還有預設的zone files哩,怎麼都沒有呀?!要我自己產生嗎?
OH MY GOD! 那有可能呀!所幸今天在高人的指點下,
找到了這些檔案身在何處呀!果然是高手高手高高手呀!

01- 安裝system-config-bind這隻套件
02- 到/usr/share/system-config-bind/profiles/下就可以找到named.conf與zone files.
03- 接下來把named.conf copy到 /var/named/chroot/etc/
04- 再把zone files copy到 /var/named/chroot/var/named/
05- 最後把將 /usr/share/doc/bind-*/sample/var/named/named.root copy到/var/named/chroot/var/named/

這樣就大功告成啦!剩下的就是自己改named.conf與新增網域正反解的zone files囉!
文張轉載自 http://go-linux.blogspot.com/2007/06/rhel5dns-server.html