1.硬件环境: 
硬盘:9.2 G ; 内存:128 M ; 网卡:EEpor100 
2.软件 
操作系统: RedHat 6.2 
3.优化RedHat 6.2 
安装时选择 
ftp 和 dns 
编辑文件 /etc/hosts 
改为: 
202.104.131.100 info.langoit.com.cn info 
编辑文件 /etc/named.conf 
改为: 
// generated by named-bootconf.pl 
options { 
directory "/var/named"; 
forwarders ; 
forwards only; 
// query-source address * port 53; 
}; 
// 
// a caching only nameserver config 
// 
zone "." in { 
type hint; 
file "named.ca"; 
}; 
zone "0.0.127.in-addr.arpa" in { 
type master; 
file "named.local"; 
}; 
编辑文件 /etc/resolv.conf 
改为: 
search langoit.com.cn 
nameserver 202.104.131.98 
nameserver 202.96.134.133 
优化linux 内核: 
删除没有的rpm 包: 
首先要停止正在运行的进程 
cd /etc/rc.d/init.d 
./sendmail stop 
./apmd stop 
./kudzu stop 
rpm -e --nodeps sendmail kudzu nfs-utils 
编辑文件 /usr/src/linux/include/linux/tasks.h 
编辑第十四行 (vi +14 ) : 
NR_TASKS 5120 ---> 3072 
MIN_TASKS_LEFT_FOR_ROOT 16 ---> 24 
编辑文件 /usr/src/linux/Makefile 
编辑第十八行 (vi +18 ) : 
HOSTCC =gcc 
---> 
HOSTCC =egcs 
编辑第二十五行 (vi +25 ) : 
CC =$(CROSS_COMPILE)gcc -D__KERNEL__ -I$(HPATH) 
---> 
CC =$(CROSS_COMPILE)egcs -D__KERNEL__ -I$(HPATH) 
编辑第九十行 (vi +90 ) : 
CFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
---> 
CFLAGS = -Wall -Wstrict-prototypes -O9 -funroll-loops -ffast-math -malign-double -mcpu= 
pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions 
编辑第十九行 (vi +19 ) : 
HOSTCFLAGS =-Wall -Wstrict-prototypes -O2 -fomit-frame-pointer 
---> 
HOSTCFLAGS =-Wall -Wstrict-prototypes -O9 -funroll-loops -ffast-math -malign-double -mcpu= 
pentiumpro -march=pentiumpro -fomit-frame-pointer -fno-exceptions 
设置内核: 
make xconfig 
具体可自己根据系统来设置 
在 /usr/src/linux/ 目录下 
make dep 
make clean 
make bzlilo 
make modules 
make modules_install 
4.
安装和优化mm,
Mysql,
Apache,
php,
phpMyAdmin,
PERL,mode_
PERL 1) 文件 
mm: mm-1.1.3.tar.gz 
Mysql: 
Mysql-3.22.32.tar.gz 
Apache: 
Apache_1.3.12.tar.gz 
php: 
php-4.0.0.2.0.5.tar.gz 
phpMyAdmin: 
phpMyAdmin_2.0.5.tar.gz 
mode_
PERL: mod_
PERL-1.24.tar.gz 
PERL-DBI: DBI-1.14.tar.gz 
DBD-Oracle-1.06.tar.gz 
Msql-
Mysql-modules-1.2214.tar.gz 
Data-Dumper-2.101.tar.gz 
Data-ShowTable-3.3.tar.gz 
e
PERL: e
PERL-2.2.14.tar.gz 
PERL: 
PERL-5.6.0.tar.gz 
解压文件: 
tar -zxpf 文件名 
注意:以下所有的预编译和
安装必须在要
安装的软件目录下 
#) 
安装mm 
./configure  
--disable-shared  
--prefix=/usr 
make 
make test 
make install 
make clean 
#) 
Mysql的
安装和配置 
#) 
Mysql的预编译 
CC="egcs"  
OPTIM="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro  
-march=pentiumpro -fomit-frame-pointer -fno-exceptions"  
./configure  
--prefix=/
Mysql  #) 
安装Mysql make 
make install 
make clean 
#) 配置
Mysql /
Mysql/bin/
Mysql_install_db 
初始化数据库 
cp /
Mysql/share/
Mysql/
Mysql.server /etc/rc.d/init.d/
Mysql cd /etc/rc.d/rc3.d 
ln -s ../init.d/
Mysql S70
Mysql 系统启动时加载
Mysql #) 
Apache 的预编译 
CC="egcs"  
OPTIM="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro  
-march=pentiumpro -fomit-frame-pointer -fno-exceptions"  
CFLAGS="-DDYNAMIC_MODULE_LIMIT=0"  
./configure  
--prefix=/
Apache  #) 
php的预编译 
CC="egcs"  
OPTIM="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro  
-march=pentiumpro -fomit-frame-pointer -fno-exceptions"  
./configure  
--prefix=/usr  
--with-
Apache=../
Apache_1.3.12  
--enable-safe-mode  
--with-mm  
--enable-inline-optimization  
--enable-memory-limit  
--enable-track-vars  
--with-
Mysql=/
Mysql  #) 
安装php make 
make install 
make clean 
#) mode_
PERL 的预编译 
PERL Makefile.PL  
EVERYTHING=1  
Apache_SRC=../
Apache_1.3.12/src  
USE_APACI=1  
DO_HTTPD=1 
#) 
安装mod_
PERL make 
make install 
make clean 
#) 编译
Apache EAPI_MM=SYSTEM  
CC="egcs"  
OPTIM="-O9 -funroll-loops -ffast-math -malign-double -mcpu=pentiumpro  
-march=pentiumpro -fomit-frame-pointer -fno-exceptions"  
CFLAGS="-DDYNAMIC_MODULE_LIMIT=0"  
./configure  
--prefix=/
Apache  --activate-module=src/modules/
php4/lib
php4.a  
--enable-module=
php4  
--activate-module=src/modules/
PERL/lib
PERL.a  
--enable-module=
PERL #) 
安装Apache make 
make install 
make clean 
cp /
Apache/bin/
Apachectl /etc/rc.d/init.d/httpd 
cd /etc/rc.d/rc3.d 
ln -s ../init.d/httpd S80httpd 
系统启动时加载
Apache #) 
安装e
PERL PERL Makefile.PL 
make 
make test 
make install 
make clean 
-frame-pointer -fno-exceptions"  
CFLAGS="-DDYNAMIC_MODULE_LIMIT=0"  
./configure  
--prefix=/
Apache  --activate-module=src/modules/
php4/lib
php4.a  
--enable-module=
php4  
--activate-module=src/modules/
PERL/lib
PERL.a  
--enable-module=
PERL #) 
安装Apache make 
make install 
make clean 
cp /
Apache/bin/
Apachectl /etc/rc.d/init.d/httpd 
cd /etc/rc.d/rc3.d 
ln -s ../init.d/httpd S80httpd 
系统启动时加载
Apache #) 
安装e
PERL PERL Makefile.PL 
make 
make test 
make install 
make clean 
make 
make test 
make install 
make clean 
make clean 
查看本文来源