Archive for 四月, 2007

最近服务器换了新配置,试了好几个发行版的Linux,都认不出网卡来。因为要经常让机房的人帮忙装系统,不考虑自己再编译网卡驱动什么的,想找一个可以直接用的。最后面还是debian 4可以~
期间试用了Centos 5,考虑刚发布不久,内核是2.6.18,下了第一张光盘。安装过程中,不认网卡(本来就换着试试的心理)。更可悲的是,安装过程前前后后需要放入4\\5张光盘,而我只选择安装基本系统啊,桌面、服务器组件一要概不选,这样也要放这么多张光盘。那不得下载7张光盘,真不知道怎么安排光盘文件的。如此大费周折的系统还那么多人喜欢用。^_^
说稳定吧,感觉还是debian稳定,当然也有硬件因素。

Functions fail on large files (filesize,is_file,is_dir)

Description:
————
Error:
(errno=75 – Value too large for defined data type)

Functions:
is_file
is_dir
filesize

Premise:
size of file is greater than 2GB.

A workaround for this is:

$filesize=exec(\”ls -l \’$yourfile\’ | awk \’{print $5}\’\”);

function is_dir_LFS($path){
return ((\’d\’==substr(exec(\”ls -dl \’$path\’\”),0,1))?(true):(false));
}


from:
http://bugs.php.net/bug.php?id=27792

\r\n   现在,Ubuntu是比较流行的Linux版本。它的安装方法通常是先下载安装光盘ISO镜像,然后或者刻盘安装,或者从硬盘安装,而又以后者居多。现在,我们使用另外一种方法——网络安装,这样可以省去下载安装光盘ISO镜像的麻烦,而时间和硬盘安装差不多。

1、下载网络安装的启动加载文件(initrd.gz和linux)存放于C:(FAT32格式)。

http://archive.ubuntu.com/ubuntu/dists/dapper/main/installer-i386/current/images/netboot/ubuntu-installer/i386/initrd.gz

http://archive.ubuntu.com/ubuntu/dists/dapper/main/installer-i386/current/images/netboot/ubuntu-installer/i386/linux

  注意下载后linux会自动被添加.txt的扩展名,要把它去掉。


2、下载GRUB FOR DOS,然后解压主文件夹在c:\\boot中,拷贝出其中的menu.lst和grldr两个文件到c:,找到boot.ini,在其最后加入一行:
C:\\GRLDR=\”Start GRUB FOR DOS\”

3、重启,选择GRUB,按C进入GRUB的命令行模式。

root (hd0,0)
kernel /linux root=/dev/ram ramdisk_size=250000,devfs=mount,dall vga=771
initrd /initrd.gz
boot

  即进入Ubuntu安装程序,依次按提示操作即可。

  注意,如果安装过程中想使用自动分区,安装前最好在硬盘上腾出一片连续的空闲区间,不在上面建任何文件系统。

\r\n \r\n \r\n

Debian GNU/Linux使用SysV模块作为系统初始脚本。与RH一样,Debian使用一个扩展的SysV模块,而Slackware主要是基于BSD的,并为了使用SysV模块而写了几个方便的脚本。
定位SysV目录
Debian GNU/Linux,与大多数使用SysV模块的系统一样,将相关的目录存放在/etc目录之下。也就是说,SysV目录/etc/init.d是脚本自身,而/etc/rc1.d,/etc/rc2.d直到/etc/rc6.d是特殊运行级别的目录。而管理所有这些的脚本为/etc/rc.d/rc。
然而RH7.2,是将SysV目录全部放在/etc/rc.d目录之下。也就是就说,RH使用/etc/rc.d/init.d,而不是/etc/init.d。为了兼容性,RH创建了一些由/etc指向/etc/rc.d下相关目录的链接。
使用Debian工具进行工作
RH包含了一些用于自动管理SysV初始脚本过程的工具,也就是chkconfig民service。Debian并包含这些工具,但是却提供相似的管理工具:update-rc.d与invoke-rc.d。
使用update-rc.d
Debian的update-rc.d与RH的chkconfig工具相类似。然而chkconfig是一个二进制程序,而update-rc.d是一个Perl脚本。这些工具有不同的命令行选项,但是却执行类似的功能。下表列出了update-rc.d的一些用法。如果要查看完整的信息,我们可以查阅相关的和册页。
命令                                        功能
update-rc.d -f <service> remove            从所有的运行级别配置目录中是删除指定的服务
update-rc.d <service> start <order> <runlevels>    配置服务在运行级别列表中按指定的顺序启动
update-rc.d <service> stop <order> <runlevels>    配置服务在运行级别列表中指定的顺序停止
update-rc.d与RH的chkconfig之间最大的不同就在于update-rc.d是要设置所以指向/etc/init.d目录下服务脚本的运行级别链接,而chkconfig是要每一个运行级别单独配置服务。从本质上来说,这也就意味着每次我们使用update-rc.d改变一个运行级别,我们就不得不改变所有的。例如,下面的命令序列与命令chkconfig -level 2345 inetd off的作用相同:
$ update-rc.d -f inetd remove
$ update-rc.d inetd stop 20 0 1 2 3 4 5 6 .
第一个命令移除了所有的指向/etc/init.d/inetd服务脚本的运行级别链接,-f标志将会使得update-rc.d即使在inetd脚本本身已经存在的情况仍然进行相应的处理。第二个命令在每一个运行级别创建了一个服务级别为20的停止脚本。例如,这会创建一个/etc/rc3.d/K20inetd的符号链接来禁止运行级别3中inetd的运行。(在这里我们要注意的是我们要显示的添加reboot与shutdown运行级别,即0和6,仅管其中所有的服务都会被设置成为“stop“)。作为另外的一个例子,下面所显示的命令将会在运行级别3到5允许inetd的运行,而在其他的运行级别中则被禁止:
$ update-rc.d -f inetd remove
$ update-rc.d inetd start 20 3 4 5 . stop 20 0 1 2 6 .
Debian的update-rc.d最初看起来会叫人有一些迷惑,但是旦我们明白,我们就会发现他可以多么出色的完成我们的工作。
使用invoke-rc.d
Debian下与RH的service命令作用等同的命令为invoke-rc.d。这两个命令在大多数情况下的作用是完全相同的。例如,service inetd start与invoke-rc.d inetd start有相同的作用(启动inetd服务,相应的停止服务的命令为invoke-rc.d inetd stop)。invoke-rc.d命令也有一个额外的我们可以深入研究的命令参数,但是一般来说这两个命令是相同的。
/etc/initta中的不同
主要配置系统初始化过程的文件是/etc/inittab。这个文件管理在系统启动时的脚本。下面的是与其他的发行版本中的inittab文件所不同的几个地方:
1 Debian的默认运行级别是2.
2 Debian并不会在/etc/inittab文件中中配置X Window系统显示管理器。
3 运行级别2与3是相同的,而运行级别4与5是相同的。
4 运行级别4与5只会运行一个虚拟终端,而运行级别2与3却会运行6个。

deb http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-proposed main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ feisty main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ feisty-security main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ feisty-updates main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ feisty-proposed main restricted universe multiverse
deb-src http://ubuntu.cn99.com/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ feisty main restricted universe multiverse

deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-updates main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-updates main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-backports main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-backports main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-security main restricted universe multiverse
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-security main restricted universe multiverse
deb http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-proposed main multiverse restricted universe
deb-src http://ubuntu.csie.ntu.edu.tw/ubuntu/ feisty-proposed main restricted universe multiverse

deb http://mirror.lupaworld.com/ubuntu feisty main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu feisty-security main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu feisty-updates main restricted universe multiverse
deb http://mirror.lupaworld.com/ubuntu feisty-backports main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu feisty main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu feisty-security main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu feisty-updates main restricted universe multiverse
deb-src http://mirror.lupaworld.com/ubuntu feisty-backports main restricted universe multiverse

deb http://ubuntu.beryl-project.org feisty main