CentOS(RHEL) 开机自动加载内核模块

2008-06-14 | 10:16分类:Redhat/CentOS | 标签: | 292 Views

CentOS4(RHEL4) 的 /etc/rc.sysinit 文件中有这样一段:

# Load modules (for backward compatibility with VARs)
if [ -f /etc/rc.modules ]; then
        /
etc/rc.modules
fi

所以,可以创建 /etc/rc.modules 文件来加载模块。如:
vi /etc/rc.modules

#!/bin/sh
#
# This script will be load other user-defined modules.
 
modprobe softdog

chmod +x /etc/rc.modules

而在 CentOS5(RHEL5) 的 /etc/rc.sysinit 文件的上述一段之前还有一段:

# Load other user-defined modules
for file in /etc/sysconfig/modules/*.modules ; do
  [ -x $file ] && $file
done

可以参照 /etc/sysconfig/modules 目录下的 udev-stw.modules 创建一个以 .modules 结尾的可执行文件来加载模块。

VMware 创建使用共享磁盘

2008-06-12 | 18:09分类:VMware | 标签: | 409 Views

1. 创建共享磁盘
在 VMware 的安装目录下(一般是 C:\Program Files\VMware\VMware Server),有个 vmware-vdiskmanager.exe 文件(老版本是 plainmaker.exe),
把它复制到共享磁盘目录下,创建共享磁盘(老版本共享磁盘文件的扩展名为 .pln)。
D:
cd VMware\SAN
vmware-vdiskmanager.exe -c -s 72Gb -a lsilogic -t 0 sharedisk.vmdk
-t 0 是实际使用多少空间就是多少空间,而 -t 2 是预分配磁盘空间。

2. 使用共享磁盘
配置虚拟机,在虚拟机界面选择 "Edit virtual machine settings" 添加硬盘,然后选 "Use a existing virtual disk" 。
在 "Advanced" 选项中为新加的硬盘选择虚拟设备节点,选择的序号应在已存在的磁盘后,避免操作系统设备序号改变引起的错误。

在需要使用共享磁盘的虚拟机的目录中打开 vmx 文件,添加如下内容(根据实际情况添加):
scsi2:0.shared = "TRUE"
disk.locking = "FALSE"

CentOS 5.1 安装 Oracle 10gR2

2008-04-26 | 9:23分类:Oracle, Redhat/CentOS | 标签: | 717 Views

Oracle 10gR2 安装的硬件需求
所需最小内存为 512MB,而所需最小交换空间为 1GB。
对于内存小于或等于 2GB 的系统,交换空间应为 RAM 数量的两倍;对于内存大于 2GB 的系统,交换空间应为 RAM 数量的一到两倍。
Oracle 10gR2 软件还需要 2.5GB 的可用磁盘空间,而数据库则另需 1.2GB 的可用磁盘空间。/tmp 目录至少需要 400MB 的可用空间。

据此,根据宿主机器的情况,在 VMware 上创建了虚拟主机。内存 1GB,一块 20GB 的 IDE 硬盘。

CentOS 5.1 的安装
文本模式安装(linux text),安装完成默认启动的是文本界面(init 3)。
选择 简体中文,但文本安装模式不支持 utf8,所以安装过程还是英文模式,但安装完成后的系统是中文的。

分区如下(安装完成后 df -h 的输出):

Filesystem            Size  Used Avail Use% Mounted on
/dev/hda1             965M  223M  693M  25% /
/dev/hda3             965M   21M  895M   3% /tmp
/dev/hda6             1.9G   70M  1.8G   4% /var
/dev/hda5             3.8G  1.5G  2.2G  40% /usr

/dev/hda2 为 2GB 的 swap 分区,留了 10GB 空间安装 Oracle 10gR2,还没有分区。

时区去掉 使用 UTC。

默认要安装的包全去掉,选上自定义包,然后只选了 Gnome 桌面环境和 X Window System,其它的都去掉。
Oracle 10gR2 的安装需要桌面环境。

第一次启动时的 Steup Agent:
防火墙设置里关闭了防火墙,禁用了 SELinux。
系统服务只留下了 crond network sshd syslog vncserver xfs
vncserver 是为了远程通过图形界面安装 Oracle 10gR2。为了使用中文需要开启 xfs 字体服务。
全文阅读 »

Nginx PHP FastCGI 安装配置记录

2008-04-18 | 18:26分类:Linux, PHP | 标签: | 3,915 Views

安装 PHP
下载:http://www.php.net/downloads.php
因需要兼容老程序,这里用的还是 PHP4 ,可根据自己的需要更改编译选项。
tar jxvf php-4.4.8.tar.bz2
cd php-4.4.8
./configure \
--prefix=/usr/local/php-fcgi \
--enable-fastcgi \
--enable-discard-path \
--enable-force-cgi-redirect \
--enable-mbstring=all \
--enable-memcache \
--with-config-file-path=/usr/local/php-fcgi/etc \
--with-gd=/usr/local/gd \
--with-zlib \
--with-png \
--with-jpeg \
--with-freetype \
--with-mysql=/usr/local/mysql \
--with-dom
make
make install
cp -f php.ini-dist /usr/local/php-fcgi/etc/php.ini

安装 ZendOptimizer
Zend 的优化器,免费使用,如果加密了 PHP 程序文件,这是必须的。
如果没有使用 Zend 优化器,PHP 进程的内存会难以释放。
下载:http://www.zend.com/en/products/guard/downloads
tar zxvf ZendOptimizer-3.3.3-linux-glibc23-i386.tar.gz
cd ZendOptimizer-3.3.3-linux-glibc23-i386
./install
cd ..

安装 eAccelerator
PHP scripts 的缓存,对于提高 PHP 程序执行速度很有帮助。
下载:http://eaccelerator.net/
tar jxvf eaccelerator-0.9.5.2.tar.bz2
cd eaccelerator-0.9.5.2
/usr/local/php-fcgi/bin/phpize
./configure --enable-eaccelerator=shared --with-php-config=/usr/local/php-fcgi/bin/php-config
make
make install
cd ..

安装 memcache
用于缓存 sql 查询,对于降低数据库压力,提升查询速度有很大好处。
下载:http://pecl.php.net/package/memcache
tar zxvf memcache-2.2.3.tgz
cd memcache-2.2.3
/usr/local/php-fcgi/bin/phpize
./configure --with-php-config=/usr/local/php-fcgi/bin/php-config
make
make install

安装 Linghttpd's spawn-fcgi
用 Lighttpd 的 spawn-fcgi 来管理 PHP FastCGI 进程。
下载 Lighttpd: http://www.lighttpd.net/download
yum -y install pcre-devel
(debian: apt-get -y install libpcre3-dev)
tar zxvf lighttpd-1.4.19.tar.bz2
cd lighttpd-1.4.19
./configure --without-bzip2
make
cp -a src/spawn-fcgi /usr/local/php-fcgi/bin/
全文阅读 »

给 QQ 和 MSN 添加中国心

2008-04-17 | 14:07分类:Other | 标签: | 769 Views

QQ:
先把头像图片保存到本地

然后,
QQ 设置 -> 个人设置 -> 个人资料 -> 更改头像 -> 本地上传
选择 china.gif ,确定。

MSN:
工具 -> 选项 -> 个人信息
在 名称 前添加引号内的内容:"(L)China "

Pages: Prev 1 2 3 4 5 6 7 8 9 10 Next