1月任务

2007年1月 training:

/****

time:2007-1-17 to 2007-1-30

一 整体设计分析

   A ;  | E

     (1) linux服务器的优化

         a:iptables配置

         b:I/O优化

      (2)   |e| 主要工作:搭建lamp环境

              主要是优化工作.

                 apahce:模块

                 mysql:集群 查询优化

*****/                                                     
在linux 2.6 以上内核系统 中搭建LAMP环境:               
A: 系统与软件
要求:                                                                       
至少安装3台服务器                                                            
                                                                             
1)。系统最小安全化安装:                                                   
并对内核进行(适合LAMP最佳化)自定义编译。                                   
其中要求要对apache,mysql,iptables(netfilter)的优化

/**
mysql=>gd.....=>apache=>php

rd enterprise as => +apt +内核裁剪

/apt +rh as 整合失败/for RPM包的dependence...

放弃APT 除非找到 code

/********apt for rh centos's apt rpm

http://rpm.pbone.net/index.php3/stat/4/idpl/1985014/com/apt-0.5.15cnc6-4.centos4.i386.rpm.html.

php

http://php.mirror.edu.cn/get/php-5.2.0.tar.gz/from/a/mirror

apache:

mysql

apache安装以及优化.

/***重点 apache/mysql的优化

http://www.isc.org/index.pl?/sw/bind/        iptables配

(为什么要那么系统优化或者内核编译,具体步骤)体现在文档中。                 
2)。除了系统外所有的软件包,使用.tar类包编译自定义安装到一个目录中         
比如:                                                                       
*.tar/tar.gz/tgz  ====/xxx/app/soft                                          
apache   ====/xxx/app/apache

http://apache.justdn.org/httpd/httpd-2.2.4.tar.gz   

modules:

http://dominia.org/djao/limitipconn.html                                  
php      ====/xxx/app/php

http://cn2.php.net/get/php-5.2.0.tar.gz/from/this/mirror                                                   
mysql    ====/xxx/app/mysql

http://mysql.linuxforum.net/Downloads/MySQL-5.0/mysql-max-5.0.27-linux-i686-icc-glibc23.tar.gz

/***很快的国内镜像站

groupadd mysql

useradd -g mysql mysql

tar zxvf mysql-max-*

cd mysql-max-*

scripts/mysql_install-db --user=mysql

chown -R mysql:mysql

cp support-files/mysql.server /etc/rc.d/init.d/

chmod +x /etc/rc.d/init.d/mysql.server
 chkconfig --add mysql.server #debian/ubuntu 为sudo update-rc.d 服务名 defaults 99

mkdir /var/lib/mysql-cluster

cp support-files/my-media.cnf /etc/my.cnf

vi  /etc/my.cnf

# Options for mysqld process:
[MYSQLD]                        
ndbcluster                      # run NDB engine
ndb-connectstring=192.168.0.72 # location of MGM node
 
# Options for ndbd process:
[MYSQL_CLUSTER]                 
ndb-connectstring=192.168.0.72  # location of MGM node

以上在所有节点上配置安装(包括管理节点)

管理节点上:

vi  /var/lib/mysql-cluster/config.ini

# Options affecting ndbd processes on all data nodes:
[NDBD DEFAULT]    
NoOfReplicas=2    # Number of replicas
DataMemory=80M    # How much memory to allocate for data storage
IndexMemory=18M   # How much memory to allocate for index storage
                  # For DataMemory and IndexMemory, we have used the
                  # default values. Since the "world" database takes up
                  # only about 500KB, this should be more than enough for
                  # this example Cluster setup.
 
# TCP/IP options:
[TCP DEFAULT]     
portnumber=2202   # This the default; however, you can use any
                  # port that is free for all the hosts in cluster
                  # Note: It is recommended beginning with MySQL 5.0 that
                  # you do not specify the portnumber at all and simply allow
                  # the default value to be used instead
 
# Management process options:
[NDB_MGMD]                      
hostname=192.168.0.72          # Hostname or IP address of MGM node
datadir=/var/lib/mysql-cluster  # Directory for MGM node logfiles
 
# Options for data node "A":
[NDBD]                          
                                # (one [NDBD] section per data node)
hostname=192.168.0.78          # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's datafiles
 
# Options for data node "B":
[NDBD]                          
hostname=192.168.0.81           # Hostname or IP address
datadir=/usr/local/mysql/data   # Directory for this data node's datafiles
 
# SQL node options:
[MYSQLD]                        
[MYSQLD]
[MYSQLD]

cp bin/ndb_mgm* /usr/local/bin
chmod +x ndb_mgm*
mgm上shell> ndb_mgmd -f /var/lib/mysql-cluster/config.ini
ndb上
shell> ndbd --initial
shell>support-files/mysql.server start
ndb_mgm
show
/*****
测试部分:

/**

http://bbs.chinaunix.net/viewthread.php?tid=574620


iptables ====/xxx/app/iptables                                               
proftp   ====/xxx/app/proftp                                                 
perl     ====/xxx/app/perl 

 ftp://ftp.cpan.org/pub/CPAN/src/perl-5.8.8.tar.gz                                               
.........                                                                    
其他的与LAMP相关的其他软件包:也安装在app下                                  
如:                                                                         
gd       ====/xxx/app/gd
/***php 支持画图功能

http://www.boutell.com/gd/http/gd-2.0.33.tar.gz

http://www.ijg.org/files/jpegsrc.v6b.tar.gz

cd /srv/ark/app/

mkdir jpeg

cd jpeg

mkdir bin

mkdir lib

mkdir man

mkdir man/man1

mkdir include

/configure --prefix=/usr/local/jpeg --enable-shared --enable-static
make ; make install

http://downloads.sourceforge.net/freetype/freetype-2.3.0.tar.gz?modtime=1169048835&big_mirror=0

png

http://downloads.sourceforge.net/libpng/libpng-1.2.15.tar.gz?modtime=1167985067&big_mirror=0

icon     ====/xxx/app/icon                                

zlib     ====/xxx/app/zlib
/**php 支持 zlib 压缩功能
http://www.zlib.net/zlib-1.2.3.tar.gz

php 支持xml xslt curl mhash

ftp://xmlsoft.org/libxml2/libxml2-2.6.27.tar.gz

tar libxml*

cd libxml*

./configure --prefix=/srv/ark/app/xml --with-zlib

make;make install

ftp://xmlsoft.org/libxml2/libxslt-1.1.17.tar.gz

tar libxslt

cd libxslt

./configure --prefix=/srv/ark/app/xstl --with-libxml-prefix=/srv/ark/app/xml

make;make install

http://curl.haxx.se/download/curl-7.16.0.tar.gz

tar zxvf curl*

cd curl

./configure --prefix=path

make;make install

http://downloads.sourceforge.net/mhash/mhash-0.9.7.1.tar.gz?modtime=1151296617&big_mirror=0

/**********************************

http://prdownloads.sourceforge.net/phpmyadmin/phpMyAdmin-2.9.2-all-languages.tar.gz?download

apache 连接进程限制模块,来限制apache的连接并发数

http://dominia.org/djao/limit/mod_limitipconn-0.22.tar.gz

用于Apache网站带宽控制,可以根据来源IP,网段来划分带宽,也可以根据网站文件类型来限制带宽

http://www.ivn.cl/apache/files/source/mod_bw-0.7.tgz

mod_evasive模块的前身就是mod_dosevasive,防止DDOS攻击

http://www.zdziarski.com/projects/mod_evasive/mod_evasive_1.10.1.tar.gz

加强apache的安全性,特别是在防sql 注入

http://www.modsecurity.org/download/modsecurity-apache_2.0.4.tar.gz

优化 apache运行,建立MM共享内存库。在这种情况下,它将允许mod_ssl使用一种高效的基于RAM的会话(session)缓存代替基于磁盘的会话缓存

ftp://ftp.ossp.org/pkg/lib/mm/mm-1.4.2.tar.gz

zend

http://downloads.zend.com/optimizer/3.2.2/ZendOptimizer-3.2.2-linux-glibc21-i386.tar.gz

mail:

http://www.chinese.qmail.org/servlet/template?series=33&article=74

...........                                               
/                                       
3)。 www,data,log,image,back目录分别位于:               
www  ====/xxx/www                                         
[www.domain.com]   程序文件                               
                                                          
data ====/xxx/data                                        
[data.domain.com]  程序中连接用数据库服务器,同时通过http:/
梦使芾硎菘?                                            
/*****************??????**************/                                                         
log  ====/xxx/log                                         
[log.domain.com]                                          
日志服务器,对apache 要求每天自动生成                     
                                                          
image====/xxx/image                                       
[image.domain.com] 图片等服务器                           
                                                          
back ====/xxx/back                                        
[back.domain.com]  备份服务器 自定义备份规则后文件存放于此
ftp服务器:要能够对www,image可读可写,对log.back可读                      
/****重点:各个目录的访问权限设置  apache日志生成格式设置*****/22.23                                                                        
其中log目录要求使用RFS文件系统,                                          
为此建议你做连接到一个单独的分区(比如/log),并对该分区限额                
                                                                          
4)。软件的安装要求写下先后顺序与具体操作步骤                             
/******安装过程中完成                                                                         
3台的建议部署:                                                           
1台:(国内/外;国内电信网通 互通 ) 主dns 服务器                      
2台:(集合了www,data,mail)的应用服务器                                   
                                                                          
B:应用服务器环境 /****|h|域名访问控制.DNS  

http://ftp.isc.org/isc/bind9/9.3.4/bind-9.3.4.tar.gz

要求:                                                                    

假设搭建的3台服务器:a. b. c                                             
a.上面有主dns, www.data.mail服务等                                       
b.上面有辅dns, www.data.mail服务等                                       
c.上面有辅dns, www.data.mail服务等                                       
                                                                          
其中要求对mysql做集群主从服务器环境配置                                   
                                                                          
域名解析要求:                                                            
www    --ip-a,ip-b,ip-c                                                   
data   --ip-a,ip-b,ip-c                                                   
image  --ip-a,ip-b,ip-c            
a:  负责国外访问                                                                                 
b/c 负责国内的电信/网通访问                                      
数据同步规则:                     
data: a. b. c                      
由mysql集群同步完成

www,image,mail使用NFS共享文件系

--------------------------------------------------------------------------------------

剩余内容:

dns 负载配置

lamp 环境的测试优化

入侵监测....

/加载apache防注入以及DDOS抵御模块
/iptables加载配置-----(DNS联接匹配)





/*************menuconfig
http://childman.bokee.com/5031051.html

http://fmwd.bokee.com/2229425.html

http://blog.chinaunix.net/u/21848/showart.php?id=166539

http://blog.csdn.net/cellbird/archive/2005/06/30/408437.aspx

 

 |*********

http://bbs.chinaunix.net/viewthread.php?tid=618322

http://bbs.chinaunix.net/viewthread.php?tid=713429

http://bbs.chinaunix.net/viewthread.php?tid=768920

http://bbs.chinaunix.net/viewthread.php?tid=574620

http://bbs.chinaunix.net/viewthread.php?tid=640588             

/***round rubin domain name system

DNS负载平衡的方法RR-DNS(Round-Robin Domain Name System

http://blog.chinaunix.net/u/3134/showart_233980.html

http://linux.chinaitlab.com/server/525373.html

/********************

notepad

http://forum.ubuntu.org.cn/about15108.html&highlight=modoles_install+error

lamp

http://forum.ubuntu.org.cn/about21033.html&highlight=modoles_install+error

apache _chinesedoc

http://lamp.linux.gov.cn/Apache/ApacheMenu/index.html

/*************

http://hi.baidu.com/auoto/blog/item/5e5df3f208140c13b07ec540.html
/*****config

http://bbs.chinaunix.net/viewthread.php?tid=860421&extra=page%3D1

/*****dns

http://www.fengnet.com/showart.asp?art_id=1444&cat_id=10

http://www.cublog.cn/u/19673/showart.php?id=123995

http://tel.21safe.com/articleview/2006-11-2/article_view_9224.htm

http://www.runstone.com/download/bind9-chinese.pdf  


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值