快捷搜索:  

架设某大型网站服务器之全部过程

根据开发设计需求架设大型的网站服务器。

主要软件:

apache jboss oracle

            简称:LAJO

            apache php mysql

            简称:LAMP

            proftpd mysql

            简称:LPM

            ssh expect

            iptables

            bind

            mail
具体要求:
海量用户访问

            海量用户存储

            (国内外互通)

            南北互通.
需求分析:
1.保证高要求高质量高性能,需要选择系*nix操作平台(这里选择as4.3);

            2.保证高访问量高数据处理,需要选数商业数据库(这里选择oracle9.2.0.4);

            3.解决南北互通(包括国内外互通),需要架设基于bind-view功能的智能DNS服务器.

            4.使用流行的B/S,C/S程序架构,需要选择了JBOSS服务器.

            5.更好地处理静态页面效果,需要选择了Apache服务器.

            6.根据程序注册用户与上传要求,需要架设ftp服务器.

            7.时时自动化系统监控,需要架设LAPM服务器.(这里使用软件cacti).

            8.公司与客户交流,需要架设邮件服务器.(这里使用postfix extmail).

            9.自动化文件数据处理与安全设置,需expect ssh iptables结合shell脚本.

            10.海量,需要集群负载均衡与配备存储设备.

具体流程:

1.硬件采购.

这里略.

2.操作系统安装

安装redhat as 4.3

系统空间划分(略)

安装开发环境,DNS,LAMP环境所需软件包.

并确认以下包已安装:

            compat-db

            compat-gcc

            compat-gcc-32

            compat-oracle-rhel4

            compat-libcwait

            compat-libgcc

            compat-libstdc  -296

            compat-libstdc  -33

            gcc

            gcc-c  

            gnome-libs

            gnome-libs-devel

            libaio-devel

            libaio

            make

            openmotif21

            xorg-x11-deprecated-libs-devel

            xorg-x11-deprecated-libs

            sysstat disk4

            openmotif21 disk3

            libaio disk3

            libaio-devel disk3

            freetype-devel disk3

            fontconfig-devel disk3

            xorg-x11-devel- disk3

            xorg-x11-deprecated-libs-devel- disk3

            glib-devel disk4

            orBit-devel disk4

            gtk -devel disk4

            alsa-lib-devel disk3

            audiofile-devel disk3

            esound-devel- disk3

            libjpeg-devel- disk3

            libtiff-devel- disk3

            libungif-devel- disk3

            imlib-devel disk4

            gnome-libs-devel disk4

            expect disk4
注意:我遇到的一个问题:全新的dell服务器1.5T,raid5,没有安装过任何系统,硬盘也没有分区,直接用as4.3安装盘安装提示:内存错误,蓝屏,而安装失败。用了好几种linux系统盘(包括windows安装盘)都如此,(手里没有硬盘格式分区工具,没有测试是否可以硬盘分区。)官方发行版说不支持超过2G内存,于是安装系统时先卸下2G内存,待安装完毕在请求支持超过2G内存的内核安装后就可以支持4G内存了,倘如日后全新安装系统不使用hugemem而使用默认的smp内核也能识别4G内存,更不会出现蓝屏问题。关于之中奥妙,还没有仔细研究过。。。。
#rpm –ivh kernel-elhugemem….rpm
修改启动文件grub.conf确保新安装的内核为优先启动.
#cat /etc/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,1)

            # kernel /vmlinuz-version ro root=/dev/sda8

            # initrd /initrd-version.img

            #boot=/dev/sda

            default=0

            timeout=5

            splashimage=(hd0,1)/grub/splash.xpm.gz

            hiddenmenu

            title Red Hat Enterprise Linux AS (2.6.9-22.ELhugemem)

            root (hd0,1)

            kernel /vmlinuz-2.6.9-22.ELhugemem ro root=LABEL=/ rhgb quiet

            initrd /initrd-2.6.9-22.ELhugemem.img

            title Red Hat Enterprise Linux AS (2.6.9-22.ELsmp)

            root (hd0,1)

            kernel /vmlinuz-2.6.9-22.ELsmp ro root=LABEL=/ rhgb quiet

            initrd /initrd-2.6.9-22.ELsmp.img

            title Red Hat Enterprise Linux AS-up (2.6.9-22.EL)

            root (hd0,1)

            kernel /vmlinuz-2.6.9-22.EL ro root=LABEL=/ rhgb quiet

            initrd /initrd-2.6.9-22.EL.img

            //////////////////////////////////////////////////////////

如果hiddenmenu,下面的内容顺序不对,请修改default=x(x对应ELhugemem项)

重启并加载另外2G内存.

这样让系统支持4G内存的正常运行.

2)系统安装完毕请作连接:

#ln –s /tmp /temp
3.配置DNS

由于要南北互通,开源得只有使用view的ACL访问控制列表文件来实现多线路的自动导向.

(当然也有其他的商业解决办法,比如智能路由与交换机的设置来实现,我们这里使用开源的而且容易实现与调整的解决软件bind)

关于view的ACL获得办法有很多途径,这里不一一商讨.

具体架设参考如下

默认安装的bind为9系列的,已经支持view,配置分为三步骤分别如下所示.
(1)修改named.conf

            (2)创建与配置hosts

            (3)域名解析

            #vi /etc/named.conf

            ////////////////////////文件内容开始///////////////////

            //

            // named.conf for Red Hat caching-nameserver

            //

            options {

            directory "/var/named";

            dump-file "/var/named/data/cache_dump.db";

            statistics-file "/var/named/data/named_stats.txt";

            /*

            * If there is a firewall between you and nameservers you want

            * to talk to, you might need to uncomment the query-source

            * directive below. Previous versions of BIND always asked

            * questions using port 53, but BIND 8.1 uses an unprivileged

            * port by default.

            */

            // query-source address * port 53;

            };

            //

            // a caching only nameserver config

            //

            controls {

            inet 127.0.0.1 allow { localhost; } keys { rndckey; };

            };

            include "/etc/rndc.key";

            //modify by mingfu 060404

            acl "CNC" {

            58.16.0.0/16;

            58.17.0.0/17;

            58.17.128.0/17;

            58.18.0.0/16;

            58.19.0.0/16;

            58.20.0.0/16;

            58.21.0.0/16;

            58.22.0.0/15;

            58.240.0.0/15;

            58.242.0.0/15;

            58.244.0.0/15;

            58.246.0.0/15;

            58.248.0.0/13;

            60.0.0.0/13;

            60.8.0.0/15;

            60.10.0.0/16;

            60.11.0.0/16;

            60.12.0.0/16;

            60.13.0.0/18;

            60.13.128.0/17;

            60.14.0.0/15;

            60.16.0.0/13;

            60.24.0.0/14;

            60.30.0.0/16;

            60.31.0.0/16;

            60.208.0.0/13;

            60.216.0.0/15;

            60.218.0.0/15;

            60.220.0.0/14;

            61.48.0.0/13;

            61.133.0.0/17;

            61.134.96.0/19;

            61.134.128.0/17;

            61.135.0.0/16;

            61.137.128.0/17;

            61.138.0.0/17;

            61.138.128.0/18;

            61.139.128.0/18;

            61.148.0.0/15;

            61.156.0.0/16;

            61.159.0.0/18;

            61.161.0.0/18;

            61.161.128.0/17;

            61.162.0.0/16;

            61.163.0.0/16;

            61.167.0.0/16;

            61.168.0.0/16;

            61.176.0.0/16;

            61.179.0.0/16;

            61.181.0.0/16;

            61.182.0.0/16;

            61.189.0.0/17;

            125.32.0.0/16;

            125.40.0.0/13;

            202.96.0.0/18;

            202.96.64.0/21;

            202.96.72.0/21;

            202.97.128.0/18;

            202.97.224.0/21;

            202.97.240.0/20;

            202.98.0.0/21;

            202.98.8.0/21;

            202.99.64.0/19;

            202.99.96.0/21;

            202.99.128.0/19;

            202.99.160.0/21;

            202.99.168.0/21;

            202.99.176.0/20;

            202.99.208.0/20;

            202.99.224.0/21;

            202.99.232.0/21;

            202.99.240.0/20;

            202.102.128.0/21;

            202.102.224.0/21;

            202.102.232.0/21;

            202.106.0.0/16;

            202.107.0.0/17;

            202.108.0.0/16;

            202.110.0.0/17;

            202.111.128.0/18;

            203.93.8.0/24;

            203.93.192.0/18;

            210.13.128.0/17;

            210.14.160.0/19;

            210.14.192.0/19;

            210.15.32.0/19;

            210.15.96.0/19;

            210.15.128.0/18;

            210.21.0.0/16;

            210.52.128.0/17;

            210.53.0.0/17;

            210.53.128.0/17;

            210.74.96.0/19;

            210.74.128.0/19;

            210.82.0.0/15;

            218.8.0.0/14;

            218.12.0.0/16;

            218.21.128.0/17;

            218.24.0.0/14;

            218.56.0.0/14;

            218.60.0.0/15;

            218.67.128.0/17;

            218.68.0.0/15;

            218.104.0.0/14;

            219.154.0.0/15;

            219.156.0.0/15;

            219.158.0.0/17;

            219.158.128.0/17;

            219.159.0.0/18;

            220.252.0.0/16;

            221.0.0.0/15;

            221.2.0.0/16;

            221.3.0.0/17;

            221.3.128.0/17;

            221.4.0.0/16;

            221.5.0.0/17;

            221.5.128.0/17;

            221.6.0.0/16;

            221.7.0.0/19;

            221.7.32.0/19;

            221.7.64.0/19;

            221.7.96.0/19;

            221.8.0.0/15;

            221.10.0.0/16;

            221.11.0.0/17;

            221.11.128.0/18;

            221.11.192.0/19;

            221.12.0.0/17;

            221.12.128.0/18;

            221.13.0.0/18;

            221.13.64.0/19;

            221.13.96.0/19;

            221.13.128.0/17;

            221.14.0.0/15;

            221.192.0.0/15;

            221.194.0.0/16;

            221.195.0.0/16;

            221.196.0.0/15;

            221.198.0.0/16;

            221.199.0.0/19;

            221.199.32.0/20;

            221.199.128.0/18;

            221.199.192.0/20;

            221.200.0.0/14;

            221.204.0.0/15;

            221.206.0.0/16;

            221.207.0.0/18;

            221.207.64.0/18;

            221.207.128.0/17;

            221.208.0.0/14;

            221.212.0.0/16;

            221.213.0.0/16;

            221.216.0.0/13;

            222.128.0.0/14;

            222.132.0.0/14;

            222.136.0.0/13;

            222.160.0.0/15;

            222.162.0.0/16;

            222.163.0.0/19;

            222.163.32.0/19;

            222.163.64.0/18;

            222.163.128.0/17;

            };

            view "view_cnc" {

            match-clients { CNC; };

            zone "." {

            type hint;

            file "named.ca";

            };

            zone "0.0.127.IN-ADDR.ARPA" {

            type master;

            file "localhost.rev";

            };

            include "master/cnc.def";

            };

            view "view_any" {

            match-clients { any; };

            zone "." {

            type hint;

            file "named.ca";

            };

            zone "0.0.127.IN-ADDR.ARPA" {

            type master;

            file "localhost.rev";

            };

            include "master/telecom.def";

            };

            ////////////////////////文件内容结束///////////////////


#mkdir /var/named/master

            #mkdir /var/named/master/cnc

            #mkdir /var/named/master/telecom

            #touch /var/named/master/cnc.def

            #touch /var/named/master/telecom.def
说明:关于如何进行域名解析配置:
@Zone区文件配置:

            Master/Cnc.def 网通

            Master/Telecom.def 电信

            *.def文件里面为解析域名的zone配置区设置部分.

            @Hosts 区文件配置

            Master/Cnc 网通

            Master/Telecom 电信

            下面以解析www.xxxx.com为例

            #vi /var/named/master/cnc.def

            ////////////////////////文件内容开始///////////////////

            zone "xxxx.com" {

            type master;

            file "master/cnc/xxxx.com";

            };

            ////////////////////////文件内容结束///////////////////

            #vi /var/named/master/telecom.def

            ////////////////////////文件内容开始///////////////////

            zone "xxxx.com" {

            type master;

            file "master/telecom/xxxx.com";

            };

            ////////////////////////文件内容结束///////////////////

            #vi /var/named/master/cnc/xxxx.com

            ////////////////////////文件内容开始///////////////////

            $TTL 3600

            $ORIGIN xxxx.com.

            @ IN SOA ns.xxxx.com. root.ns.xxxx.com.(

            2005121013 ;Serial

            3600 ; Refresh ( seconds )

            900 ; Retry ( seconds )

            68400 ; Expire ( seconds )

            15 );Minimum TTL for Zone ( seconds )

            ;

            @ IN NS ns.xxxx.com.

            @ IN MX xxxx.com.

            ;;ip for cnc

            @ IN A x.x.x.x(网通IP)

            www IN A x.x.x.x(网通IP)

            ////////////////////////文件内容结束///////////////////

            #vi /var/named/master/telecom/xxxx.com

            ////////////////////////文件内容开始///////////////////

            $TTL 3600

            $ORIGIN xxxx.com.

            @ IN SOA ns.xxxx.com. root.ns.xxxx.com.(

            2005121013 ;Serial

            3600 ; Refresh ( seconds )

            900 ; Retry ( seconds )

            68400 ; Expire ( seconds )

            15 );Minimum TTL for Zone ( seconds )

            ;

            @ IN NS ns.xxxx.com.

            @ IN MX xxxx.com.

            ;;ip for telecom

            @ IN A x.x.x.x(电信IP)

            www IN A x.x.x.x(电信IP)

            ////////////////////////文件内容结束///////////////////
顶(0)
踩(0)

您可能还会对下面的文章感兴趣:

最新评论