21 2008

痛苦一下:SUSE SP2没有下载下来

Posted by Yangybcy in Linux



    为了升级偶的SUSE到SP2。偶的本本连开了2天,都没有把这该死的SP2文件下载完。每次都是到66.9%就挂老!!!!!!!!

收藏与分享
19 2008

mono (Mono provides the necessary software to deve

Posted by Yangybcy in Linux

偶然从Novell网上看到MONO这东西    一搜 。居然还有这样的东东。可以把.NET迁移到LINUX等系统上。

 

What is Mono?

Mono provides the necessary software to develop and run .NET client and server applications on Linux, Solaris, Mac OS X, Windows, and Unix. Sponsored by Novell (http://www.novell.com), the Mono open source project has an active and enthusiastic contributing community and is positioned to become the leading choice for development of Linux applications.

Mono allows your existing binaries to run on Linux with copy-deployment

http://www.mono-project.com/Main_Page

 

收藏与分享
17 2008

Suse下载中国镜像开通

Posted by Yangybcy in Linux

http://en.opensuse.org/Mirrors_Released_Version#China

 

Asia

China

ftp.opensuse.org.cn ()
Download openSUSE 10.2
x86 CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
x86-64 CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
ppc CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
Checksums MD5SUMS MD5SUMS MD5SUMS
Installation Repository Installation Repository
Addon-NonOSS-Installation Repository
Sources Sources
Addon-NonOSS-Sources

CERNET SERVER: The below server is located in CERNET, which means it’s much faster if you are also in CERNET, the network of Chinese Education and Research.

ftp://opensuse.realss.cn (Xiamen)
Download openSUSE 10.2
x86 CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
x86-64 CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
ppc CD1 CD2 CD3 CD4 CD5 Addon-NonOSS-CD1 Addon-Lang-CD2 DVD3 Start-CD-Image4
Checksums MD5SUMS MD5SUMS MD5SUMS
Installation Repository Installation Repository
Addon-NonOSS-Installation Repository
Sources Sources
Addon-NonOSS-Sources

 

收藏与分享
15 2008

LINUX小问题集

Posted by Yangybcy in Linux

1.GRUB在什么地方
  答:/etc/grub.conf   或 /boot/grub

2.查看CPU信息(网上抄的)
cat /proc/acpi/thermal_zone/THM/temperature && cat /proc/cpuinfo | grep 'cpu MHz'
temperature:             86 C
cpu MHz         : 1867.000
cpu MHz         : 1867.000

3.如何查看gtk版本
从邮件列表看到的查看gtk版本的一些方法:

一、使用外部命令查看安装的gtk库版本

$pkg-config –modversion gtk+    (查看1.2.x版本)

$pkg-config –modversion gtk+-2.0  (查看 2.x 版本)

$pkg-config –version (查看pkg-config的版本)

$pkg-config –list-all |grep gtk (查看是否安装了gtk)

二、使用dl库查看动态链接库中的符号链接:


#include <dlfcn.h>
#include <stdio.h>
int
main(void)
{
    void *gtk;
    int *maj, *min, *mic;
    int status = 1;

    gtk = dlopen("libgtk-x11-2.0.so", RTLD_LAZY);
    if (!gtk)
        return 1;
    maj = dlsym(gtk, "gtk_major_version");
    min = dlsym(gtk, "gtk_minor_version");
    mic = dlsym(gtk, "gtk_micro_version");
    if (maj && min && mic) {
        printf("%d.%d.%d\n", *maj, *min, *mic);
        status = 0;
    }
    dlclose(gtk);
    return status;
}

三、如果在gtk程序运行中要检测版本,可以使用gtk库中定义的符号常量。

extern      const guint gtk_major_version;
extern      const guint gtk_minor_version;
extern      const guint gtk_micro_version;
extern      const guint gtk_binary_age;
extern      const guint gtk_interface_age;
gchar*      gtk_check_version               (guint required_major,
                                             guint required_minor,
                                             guint required_micro);

#define     GTK_MAJOR_VERSION
#define     GTK_MINOR_VERSION
#define     GTK_MICRO_VERSION
#define     GTK_BINARY_AGE
#define     GTK_INTERFACE_AGE
#define     GTK_CHECK_VERSION               (major,minor,micro

收藏与分享
18 2007

GRUB引导进单用户模式的三种方式

Posted by Yangybcy in Linux

 作为一个Linux系统管理员,你可能会把Linux 超级用户密码遗忘了,把/etc/inittab或/etc/rc.d/rc.sysinit之类文件误编辑,导致系统不能正常启动的恼人错误?
  
  
  
  
  
  
  
  
  而为了解决以上问题,你就需要进到linux根文件系统处于可读写状态的单用户模式下。
  
  下面介绍在GRUB引导下进入Linux单用户模式的三种方式:
  
  (1) 硬件环境:
  
  intel P4 / 1G RAM / sata 80G
  
  (2) 软件环境:
  
  1)Fedora Core 3(以下简称为FC3)和Windows2000 advance server双系统
  
  2)LVM管理Linux分区
  
  3)/boot/grub/grub.conf文件内容:
  
  # grub.conf generated by anaconda # # Note that you do not have to rerun grub after making changes to this file # NOTICE: You have a /boot partition. This means that # all kernel and initrd paths are relative to /boot/, eg. # root (hd0,2)
  # kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00 # initrd /initrd-version.img #boot=/dev/sda default=1 timeout=1000 splashimage=(hd0,2)/grub/splash.xpm.gz hiddenmenu title Fedora Core (2.6.9-1.667)
  root (hd0,2)
  kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-1.667.img title windows 2000 adv rootnoverify (hd0,0)
  chainloader +1
  
  首先,启动电脑,屏幕出现如下提示:
  
  Press any key to enter the menu Booting windows 2000 adv in 999 seconds…
  
  按任一键跳过计时,进入下一步:
  
  GNU GRUB version 0.95 (639K lower/103924K upper memory)
  Fedora Core (2.6.9-1.667)
  Windows 2000 adv
  
  下面是GRUB的提示:
  
  ‘e’ 在booting前编辑启动命令行
  
  ‘a’ 在booting前编辑kernel的参数
  
  ‘c’进入grub命令行

    由此按‘e’、a‘、’c‘三个不同的键,进入三种不同的操作:
  
  1.快速法:
  
  选择Fedora Core (2.6.9-1.667)菜单,
  
  按a键:
  
  grub append>ro root=/dev/VolGroup00/LogVol00 rhgb quiet
  
  修改成:
  
  grub append>ro root=/dev/VolGroup00/LogVol00 single quiet
  
  按ENTER键完成修改并booting进入Linux单用户模式
  
  sh-3.00#
  
  2.简便法:
  
  选择Fedora Core (2.6.9-1.667)菜单,
  
  按e键:
  
  root (hd0,2)
  
  kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 rhgb quiet initrd /initrd-2.6.9-1.667.img选择kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 rhgb quiet命令行
  
  按e键:
  
  grub edit>kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
  
  修改成:
  
  grub edit>kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 single quiet
  
  按ENTER键完成修改
  
  按b键booting进入Linux单用户模式
  
  sh-3.00#
  
  3.手动法:
  
  按c键进入grub命令行:
  
  (在grub命令行下按TAB键可得到grub命令帮助与grub命令的可能选项)
  
  grub>fstest (grub>filesystem tracing is now on grub>root (hd0,2) (
  
  (指定保存有Linux 内核的分区为第一个硬盘的第三个分区)
  
  grub>filesystem type is ext2fs,partition type 0×83 grub>kernel /vmlinuz-2.6.9-1.667 ro root=/dev/VolGroup00/LogVol00 single quiet (
  
  (指定内核文件为/boot/vmlinuz-2.6.9-1.667,内核参数为ro—readonly, 根分区为/dev/VolGroup00/LogVol00,rhgb—图形方式启动,quiet—不输出启动信息)
  
  grub>initrd /initrd-2.6.9-1.667.img (
  
  (在内核启动前加载支持系统硬件设备的内核模块——initrd镜像文件——/boot/initrd-2.6.9-1.667.img,并初始化RAM disk)
  
  grub>boot (
  
  如果系统的配置与脚本文件正确,以上三种方式在Booting command-list中都会出现:
  
  remounting root filesystem in read-write mode:[OK]
  
  表示此时linux单用户模式下的根文件系统处于可读可写状态。
  
  如果系统的配置与脚本文件出现错误,linux单用户模式下的根文件系统进入“read-only file system”既只读状态,此时,打入:
  
  sh-3.00#mount –o remount rw –t ext3 /
  
  让根文件系统重新mount成可读写,你就可以自由编辑出现错误的系统文件了。

收藏与分享
18 2007

Linux命令:改变文件或目录的访问权限

Posted by Yangybcy in Linux

Linux命令:改变文件或目录的访问权限 Linux系统中的每个文件和目录都有访问许可权限,用它来确定谁可以通过何种方式对文件和目录进行访问和操作。


文件或目录的访问权限分为只读,只写和可执行三种。以文件为例,只读权限表示只允许读其内容,而禁止对其做任何的更改操作。可执行权限表示允许将该文件作为一个程序执行。文件被创建时,文件所有者自动拥有对该文件的读、写和可执行权限,以便于对文件的阅读和修改。用户也可根据需要把访问权限设置为需要的任何组合。


有三种不同类型的用户可对文件或目录进行访问:文件所有者,同组用户、其他用户。所有者一般是文件的创建者。所有者可以允许同组用户有权访问文件,还可以将文件的访问权限赋予系统中的其他用户。在这种情况下,系统中每一位用户都能访问该用户拥有的文件或目录。


每一文件或目录的访问权限都有三组,每组用三位表示,分别为文件属主的读、写和执行权限;与属主同组的用户的读、写和执行权限;系统中其他用户的读、写和执行权限。当用ls -l命令显示文件或目录的详细信息时,最左边的一列为文件的访问权限。例如:


$ ls -l sobsrc. tgz


-rw-r–r– 1 root root 483997 Ju1 l5 17:3l sobsrc. tgz


横线代表空许可。r代表只读,w代表写,x代表可执行。注意这里共有10个位置。第一个字符指定了文件类型。在通常意义上,一个目录也是一个文件。如果第一个字符是横线,表示是一个非目录的文件。如果是d,表示是一个目录。


例如:


- rw- r– r–


普通文件 文件主 组用户 其他用户


是文件sobsrc.tgz 的访问权限,表示sobsrc.tgz是一个普通文件;sobsrc.tgz的属主有读写权限;与sobsrc.tgz属主同组的用户只有读权限;其他用户也只有读权限。


确定了一个文件的访问权限后,用户可以利用Linux系统提供的chmod命令来重新设定不同的访问权限。也可以利用chown命令来更改某个文件或目录的所有者。利用chgrp命令来更改某个文件或目录的用户组。


下面分别对这些命令加以介绍。


chmod 命令


chmod命令是非常重要的,用于改变文件或目录的访问权限。用户用它控制文件或目录的访问权限。


该命令有两种用法。一种是包含字母和操作符表达式的文字设定法;另一种是包含数字的数字设定法。


1. 文字设定法


chmod [who] [+ | - | =] [mode] 文件名?


命令中各选项的含义为:


2. 数字设定法


我们必须首先了解用数字表示的属性的含义:0表示没有权限,1表示可执行权限,2表示尚慈ㄏ蓿?表示可读权限,然后将其相加。所以数字属性的格式应为3个从0到7的八进制数,其顺序是(u)(g)(o)。


例如,如果想让某个文件的属主有“读/写”二种权限,需要把4(可读)+2(可写)=6(读/写)。


数字设定法的一般形式为:


chmod [mode] 文件名?


chgrp命令


功能:改变文件或目录所属的组。


语法:chgrp [选项] group filename?


该命令改变指定指定文件所属的用户组。其中group可以是用户组ID,也可以是/etc/group文件中用户组的组名。文件名是以空格分开的要改变属组的文件列表,支持通配符。如果用户不是该文件的属主或超级用户,则不能改变该文件的组。


该命令的各选项含义为:


- R 递归式地改变指定目录及其下的所有子目录和文件的属组。


chown 命令


功能:更改某个文件或目录的属主和属组。这个命令也很常用。例如root用户把自己的一个文件拷贝给用户xu,为了让用户xu能够存取这个文件,root用户应该把这个文件的属主设为xu,否则,用户xu无法存取这个文件。


语法:chown [选项] 用户或组 文件


说明:chown将指定文件的拥有者改为指定的用户或组。用户可以是用户名或用户ID。组可以是组名或组ID。文件是以空格分开的要改变权限的文件列表,支持通配符。


该命令的各选项含义如下:


- R 递归式地改变指定目录及其下的所有子目录和文件的拥有者。


- v 显示chown命令所做的工作。


操作对象who可是下述字母中的任一个或者它们的组合:


u 表示“用户(user)”,即文件或目录的所有者。


g 表示“同组(group)用户”,即与文件属主有相同组ID的所有用户。


o 表示“其他(others)用户”。


a 表示“所有(all)用户”。它是系统默认值。


操作符号可以是:


+ 添加某个权限。


- 取消某个权限。


= 赋予给定权限并取消其他所有权限(如果有的话)。


设置mode所表示的权限可用下述字母的任意组合:


r 可读。


w 可写。


x 可执行。


X 只有目标文件对某些用户是可执行的或该目标文件是目录时才追加x 属性。


s 在文件执行时把进程的属主或组ID置为该文件的文件属主。方式“u+s”设置文件的用户ID位,“g+s”设置组ID位。


t 保存程序的文本到交换设备上。


u 与文件属主拥有一样的权限。


g 与和文件属主同组的用户拥有一样的权限。


o 与其他用户拥有一样的权限。


文件名:以空格分开的要改变权限的文件列表,支持通配符。


在一个命令行中可给出多个权限方式,其间用逗号隔开。例如:chmod g+r,o+r example


使同组和其他用户对文件example 有读权限。

收藏与分享
18 2007

红帽Linux获美国政府最高安全等级认证

Posted by Yangybcy in Linux

    据国外媒体报道,在IBM服务器上执行的红帽操作系统─Red Hat Enterprise Linux 5的存取控制能力在5月7日取得了美国政府信息安全认证机构所颁发的最高安全等级认证,这意味着那些对信息安全要求较为严格的政府单位将可采用红帽的 Linux操作系统。


此一评鉴是由IBM提出,评估的是在IBM System x、System p、System z及BladeCenter服务器上执行的Red Hat Enterprise Linux 5操作系统。


此次红帽操作系统在三项存取控制部分取得了最高的评估担保等级,包括「卷标式安全保护设定文件」(Labeled Security Protection Profile,LSPP)、「可控制存取保护设定档」(Controlled Access Protection Profile,CAPP)及「以角色为基础的存取控制保护设定档」(Role-Based Access Control Protection Profile,RBAC)。


这并不是Linux操作系统首次取得EAL 4认证,之前红帽其它操作系统版本及Novell的Suse Linux也都曾取得EAL 4认证,但这却是Linux操作系统首次在存取控制能力上取得该认证。


红帽所取得的是国家安全局旗下的国际信息担保组织(National Information Assurance Partnership,NIAP)所颁发的第四级「评估担保等级」(Evaluation Assurance Level 4;EAL 4),NIAP专门评估商业技术产品的安全性,这也是该组织信息安全等级中最高的一级。


一般企业并不会要求此一等级的安全认证,但是有些对信息管控较严格的政府单位则会要求较高的安全等级,例如国防部或国安局等。此外,过去操作系统开发商会要求企业额外购买取得LSPP及RBAC认证的部份,但现在一套操作系统就能支持不同等级的安全性。


InfoWorld引用IBM开放系统副总裁Dan Frye指出,对Linux产业而言这是一个大消息,因为这显示出开放原始码软件可被用在机密运算任务中,证明那些认为开放原始码操作系统不能这样做的人是错的。

收藏与分享
30 2007

在LINUX下面安装e1000网卡

Posted by Yangybcy in Linux

今天一台Xeon3.0的机器 主板是IntelS5000VSA型的。
客户要求装红旗系统 。装好后,识别不到网卡。

从网上下得驱动。
解压

读ReadMe

开始rpmbuild -tb ***.tar.gz

然后tar zxvf ***.tar.gz

进入刚解压的目录
drivers/src/

执行make install

默认是安装到
/lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000/e1000.ko


哈哈  下面是ReadMe

Building and Installation
=========================

To build a binary RPM* package of this driver, run 'rpmbuild -tb
<filename.tar.gz>'.  Replace <filename.tar.gz> with the specific filename
of the driver.

NOTE: For the build to work properly, the currently running kernel MUST
      match the version and configuration of the installed kernel sources.
      If you have just recompiled the kernel reboot the system now.

      RPM functionality has only been tested in Red Hat distributions.

1. Move the base driver tar file to the directory of your choice.  For
   example, use /home/username/e1000 or /usr/local/src/e1000.

2. Untar/unzip archive:

     tar zxf e1000-x.x.x.tar.gz

3. Change to the driver src directory:

     cd e1000-x.x.x/src/

4. Compile the driver module:

     make install

   The binary will be installed as:

     /lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000/e1000.[k]o

   The install locations listed above are the default locations.  They
   might not be correct for certain Linux distributions.  For more
   information, see the ldistrib.txt file included in the driver tar.

5. Load the module using either the insmod or modprobe command:

     modprobe e1000

     insmod e1000

   Note that for 2.6 kernels the insmod command can be used if the full
   path to the driver module is specified.  For example:

     insmod /lib/modules/<KERNEL VERSION>/kernel/drivers/net/e1000/e1000.ko

   With 2.6 based kernels also make sure that older e1000 drivers are
   removed from the kernel, before loading the new module:

     rmmod e1000; modprobe e1000


6. Assign an IP address to the interface by entering the following, where
   x is the interface number:

     ifconfig ethx <IP_address>

7. Verify that the interface works.  Enter the following, where <IP_address>
   is the IP address for another machine on the same subnet as the
   interface that is being tested:

     ping  <IP_address>    

收藏与分享
29 2007

安装RED HAT AS4 64位FOR EM64T 重启问题

Posted by Yangybcy in Linux

halt 正常

REBOOT
init 6 重启

报:acpi :invalid reset regiset bit width:0×0
不停地报:acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0
acpi :invalid reset regiset bit width:0×0

 

-------

从新安装  在boot:下敲 linux acpi=noirq

as4改用新的acpi管理还有一些bug,等出高的update吧  as3用的apm就很稳定

--------

安装完后,在/boot/grub.conf里,修改kernel行,增加acpi=off
也可以….

收藏与分享
11 2007

在redhat,fedora3,fedora4和centOS4.x上安装vhcs2

Posted by Yangybcy in Linux

好多朋友在问我,怎么在redhat9,fedora3,fedora4以及centOS上安装vhcs2。
就写了这篇文章,希望对大家有用,感谢支持我的朋友们!


在redhat,fedora3,fedora4和centOS4.x上安装vhcs2的步骤:

1.装redhat系统时,对于新手来说,建议在装系统时选择everything,把所有的rpm包都装上。并且不要用启用SElinux
如果你是老鸟,那就另当别论了~ ~。

2.我建议用redhat的apt来安装,这样对于以后装其他的都容易点。
wget http://ftp.freshrpms.net/pub/fre … 1.1.fc3.fr.i386.rpm
rpm -Uvh apt-0.5.15cnc6-1.1.fc3.fr.i386.rpm
apt-get update
apt-get dist-upgrade

3.运行:apt-get install  php-pear php-imap php-gd ncftp \
                         bind libmcrypt libmcrypt-devel \
                         libmcrypt libmcrypt-devel \
                         libxslt-devel libjpeg-devel libpng-devel \
                         freetype-devel libc-client-devel php-imap \
                         php-snmp net-snmp-devel



4.修改/etc/fstab系统支持quota
例如:把LABEL=/   /   ext3    defaults    1 1修改成:
        LABEL=/   /   ext3    defaults,usrquota     1 1
# touch /aquota.user
# chmod 600 /aquota.user
# mount -o remount /
# quotacheck -avugm


5.安装ftp服务proftpd:

wget ftp://ftp.ibiblio.org/pub/mirror … oftpd-1.2.10.tar.gz
tar zxvf proftpd-1.2.10.tar.gz
mv proftpd-1.2.10 proftpd
cd /usr/local/proftpd
./configure \
–sysconfdir=/etc \
–localstatedir=/var \
–prefix=/usr \
–with-modules=mod_sql:mod_sql_mysql:mod_quotatab:mod_quotatab_sql \
–with-includes=/usr/include/mysql \
–with-libraries=/usr/lib/mysql
make
make install

6.redhat安装vhcs2时,一般都必须安装perl的一些模块:

# perl -MCPAN -e shell
After configuring CPAN ( multiple prompts ), install the following modules:
cpan> install MIME::Entity MIME:arser MIME::Base64 Crypt::CBC Crypt::Blowfish Term::ReadPassword

7.安装openssl-perl:
apt-get install openssl-perl*    #不安装的话,将会在安装courier时出现错误。


8.如果要自己重新编译安装php的话,使用下面命令:
cd /usr/local/
wget http://us2.php.net/distributions/php-4.3.10.tar.bz2
tar xjvf php-4.3.10.tar.bz2
mv php-4.3.10 php
cd php
./configure \
–with-mysel –with-pgsql –with-mcrypt=/usr/lib \
–build=i386-redhat-linux –target=i386-redhat-linux-gnu \
–with-jpeg –with-openssl –with-png \
–with-pear –with-calendar –with-xml \
–with-ftp –with-freetype –with-bz2 –with-iconv \
–sysconfdir=/etc –mandir=/usr/share/man \
–enable-sockets –enable-calendar –enable-bcmath \
–enable-ctype –enable-exif –enable-filepro \
–enable-ftp –enable-memory-limit \
–enable-sigchild –enable-magic-quotes \
–enable-yp –enable-track-vars \
–with-apxs2=/usr/sbin/apxs
make  
make instal

也可以使用系统自己安装配置的php。


9.安装cyrus-sasl:

# cd /usr/local/
# wget ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-2.1.20.tar.gz
# tar xvfz cyrus-sasl-2.1.20.tar.gz
# mv cyrus-sasl-2.1.20 cyrus-sasl
# cd cyrus-sasl
#./configure
# make                
# make install
# ln -s /usr/local/lib/sasl2 /usr/lib/sasl2
# perl -pi.bak -e "s/saslauthd/auxprop/g" /usr/local/lib/sasl2/smtpd.conf

10.安装postfix服务:

# wget http://postfix.energybeam.com/so … ostfix-2.2.1.tar.gz
# tar xvfz postfix-2.2.1.tar.gz
# mv postfix-2.2.1 /usr/local/postfix
# cd /usr/local/postfix
# make makefiles CCARGS="-DUSE_SASL_AUTH -I/usr/local/include/sasl" \
# AUXLIBS="-L/usr/local/lib -lsasl2"
# make
# make install

10.安装Courier-pop3d,imapd和authd:
# cd /usr/local/
# wget http://internap.dl.sourceforge.n … uthlib-0.55.tar.bz2
# tar xjvf courier-authlib-0.55.tar.bz2
# mv courier-authlib-0.55 courier-authlib
# cd /usr/local/courier-authlib
# ./configure –with-redhat –disable-root-check \
–with-mailuser=courier –with-mailgroup=courier
# make
# make install
# make install-configure
# groupadd courier

11.安装courier:

# useradd -c 'Courier Mail Server' -d /dev/null -g courier -s /bin/false courier
# cd /usr/local
# wget http://unc.dl.sourceforge.net/so … rier-0.49.0.tar.bz2
# tar xjvf courier-0.49.0.tar.bz2
# mv courier-0.49.0 courier
# cd /usr/local/courier
# ./configure –with-redhat –disable-root-check \
–with-mailuser=courier –with-mailgroup=courier \
–with-db=gdbm
# make
# make install
# make install-configure

12.做一些脚本的连接工作:

# echo 'su -c "/usr/lib/courier/share/sqwebmail/cleancache.pl" bin' >> /etc/cron.hourly/courier.cron
# touch /usr/local/etc/authlib/userdb
# chown daemon /usr/local/etc/authlib/userdb
# chgrp daemon /usr/local/etc/authlib/userdb
# chhmod 600 /usr/local/etc/authlib/userdb
# ln -s /usr/lib/courier/sbin/webmaild /etc/init.d
# echo '/usr/local/sbin/authdaemond start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/courier start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/pop3d start' >> /etc/rc.local
# echo '/usr/lib/courier/sbin/imapd start' >> /etc/rc.local

# ln -s /usr/libexec/postfix /usr/lib/postfix
# ln -s /usr/lib/perl5/5.8.5/i386-linux-thread-multi/CORE/libperl.so /lib/
# cp -p /usr/local/courier/rfc822/rfc822.h /usr/local/include/

# service named start    #把bind启动起来
# ln -s /etc/httpd /etc/apache2
# adduser www-data   新建网站用户


13.修改$home/engine/vhcs2.conf文件:

SERVER_HOSTNAME = <YOUR HOST NAME>
BASE_SERVER_IP = <YOUR IP ADDDRESS>
DATABASE_PASSWORD = <YOUR MYSQL PASSWORD>
BIND_CONF_FILE = /usr/sbin/apachectl
BIND_DB_DIR = /var/named/
BIND_DB_DIR = /var/named/
APACHE_CMD = /etc/rc.d/init.d/httpd
APACHE_NAME = httpd
APACHE_LOG_DIR = /var/log/httpd
APACHE_USERS_LOG_DIR = /var/log/httpd/users
APACHE_BACKUP_LOG_DIR = /var/log/httpd/backup
APACHE_CONF_FILE = /etc/httpd/sites-available/vhcs2.conf
APACHE_USER = apache
APACHE_GROUP = apache
MTA_SASLDB_FILE = /etc/sasldb2
MTA_SA
SLDB_PASSWD2 = /usr/sbin/saslpasswd2
CMD_MAKEUSERDB = /usr/local/sbin/makeuserdb
CMD_NAMED = /etc/init.d/named
CMD_HTTPD = /etc/init.d/httpd
MAIL_TRAFF_LOG = maillog


14.tar xvjf vhcs2.4.tar.bz2 cd ./vhcs-2.4 make install


15.因为刚才将所有的文件生成到 /tmp/vhcs2下面了
cp -R /tmp/vhcs2/etc/* /etc/
cp -R /tmp/vhcs2/var/* /var/
cp -R /tmp/vhcs2/usr/* /usr/

改变MySQL的数据库管理员密码
mysqladmin -u root -p password "new password here"然后运行配置脚本
/var/www/vhcs2/engine/setup/vhcs2-setup会问你几个问题,如密码,IP等


16.编辑apache2的配置文件,将vhcs2.conf的配置包含进去
pico /etc/apache2/httpd.conf加到最后一行

Include /etc/apache2/sites-available/vhcs2.conf重新启动apache

/etc/init.d/apache2 restart9.将vhcs的服务加到启动脚本
update-rc.d vhcs2_daemon defaults update-rc.d vhcs2_network defaults

17.运行下面的命令:

echo 'include /etc/httpd/sites-available/vhcs2.conf' >> /etc/httpd/conf/httpd.conf
cd /etc/vhcs2/bind/parts/
cp -p cfg_entry.tpl cfg_entry.tpl.bak
perl -pi.bak -e "s/\{DB_DIR\}\/\{DMN_NAME\}\.db/\{DMN_NAME\}\.db/g" cfg_entry.tpl
perl -pi.bak -e "s/0700/0755/g" /var/www/vhcs2/engine/vhcs2-*

18.需要建立下面的脚本:/etc/init.d/vhcs2内容如下:

<——————- CUT HERE———————->
#!/bin/bash
# description: Start or stop the vhcs2 daemon
#
### BEGIN INIT INFO
# Provides: vhcs2
# Required-Start: $network $syslog
# Required-Stop: $network
# Default-Start: 2 3 5
# Default-Stop: 0 1 6
# Description: Start or stop the vhcs2 daemon
### END INIT INFO

# Source function library.
. /etc/rc.d/init.d/functions

name='vhcs2'
lockfile=/var/lock/subsys/vhcs2
conffile=/etc/vhcs2/vhcs2.conf
pidfile=/var/run/vhcs2.pid
daemon=/var/www/vhcs2/daemon/vhcs2_daemon
name=vhcs2_daemon
RETVAL=0
start() {
        echo -n $"Starting $prog: "
        daemon "$daemon -p $pidfile"
        RETVAL=$?
        if ?"$RETVAL" = "0"; then
                touch $lockfile
        fi
        echo
}
stop() {
        echo -n $"Stopping $prog: "
        killproc $daemon -TERM
        RETVAL=$?
        if ?"$RETVAL" = "0"; then
                rm -f $lockfile
        fi
        echo
}

case "$1" in
'start')
        start
        ;;
'stop')
        stop
        ;;
'status')
        status $daemon
        ;;
'restart')
        stop
        start
        ;;
*)
        echo "Usage: $0 { start | stop | restart }"
        RETVAL=1
        ;;
esac

exit $RETVAL
<——————- CUT HERE———————->


其实在redhat9,fedora3,fedora4和centOS4.x上安装都是很相似的,都可以按照上面的方法来做。

本人已经成功的在redhat9,fedora3,fedora4和centOS4.x成功的配置vhcs2这个开源的系统。

收藏与分享
Pages: 上一页 1 2 3 4 5