|
bonding:
[root@mail ~]# cat /boot/config-2.6.18-194.el5 | grep BONDING
CONFIG_BONDING=m
[root@mail ~]# modprobe bonding
[root@mail ~]# lsmod | grep bonding
bonding 96873 0
ipv6 270305 27 bonding
[root@mail ~]# cd /etc/sysconfig/network-scripts/
[root@mail network-scripts]# ls
ifcfg-eth0 ifdown-ipv6 ifup ifup-isdn ifup-tunnel
ifcfg-eth1 ifdown-isdn ifup-aliases ifup-plip ifup-wireless
ifcfg-lo ifdown-post ifup-bnep ifup-plusb init.ipv6-global
ifdown ifdown-ppp ifup-eth ifup-post net.hotplug
ifdown-bnep ifdown-routes ifup-ippp ifup-ppp network-functions
ifdown-eth ifdown-sit ifup-ipsec ifup-routes network-functions-ipv6
ifdown-ippp ifdown-sl ifup-ipv6 ifup-sit
ifdown-ipsec ifdown-tunnel ifup-ipx ifup-sl
[root@mail network-scripts]# cp ifcfg-eth0 ifcfg-eth1
cp:是否覆盖“ifcfg-eth1”? y
[root@mail network-scripts]# cp ifcfg-eth0 ifcfg-bond0
[root@mail network-scripts]#
[root@mail network-scripts]# vim ifcfg-eth0
DEVICE=eth0
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
IPV6INIT=no
USERCTL=no
[root@mail network-scripts]# vim ifcfg-eth1
DEVICE=eth1
ONBOOT=yes
BOOTPROTO=none
TYPE=Ethernet
SLAVE=yes
MASTER=bond0
IPV6INIT=no
USERCTL=no
[root@mail network-scripts]# vim ifcfg-bond0
DEVICE=bond0
BOOTPROTO=none
ONBOOT=yes
IPADDR=172.17.16.5
NETMASK=255.255.255.0
GATEWAY=172.17.16.100
TYPE=Ethernet
IPV6INIT=no
USERCTL=no
[root@mail network-scripts]# vim /etc/modprobe.d/bond.conf
alias bond0 bonding
options bond0 miimon=50 mode=1
[root@mail network-scripts]# service network restart
正在关闭接口 eth0: [确定]
正在关闭接口 eth1: [确定]
关闭环回接口: [确定]
弹出环回接口: [确定]
弹出界面 bond0: [确定]
[root@mail network-scripts]# ifconfig
[root@mail network-scripts]# init 6 重启计算机
[root@mail network-scripts]#
[root@mail network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 50
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:07:95:8c
Slave Interface: eth1
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:07:95:96
[root@mail network-scripts]#
关闭网卡eth1:
[root@mail network-scripts]# cat /proc/net/bonding/bond0
Ethernet Channel Bonding Driver: v3.4.0 (October 7, 2008)
Bonding Mode: fault-tolerance (active-backup)
Primary Slave: None
Currently Active Slave: eth0
MII Status: up
MII Polling Interval (ms): 50
Up Delay (ms): 0
Down Delay (ms): 0
Slave Interface: eth0
MII Status: up
Link Failure Count: 0
Permanent HW addr: 00:0c:29:07:95:8c
Slave Interface: eth1
MII Status: down
Link Failure Count: 1
Permanent HW addr: 00:0c:29:07:95:96
[root@mail network-scripts]#
安装php:
[root@localhost ~]# tar fvxj httpd-2.2.22.tar.bz2
[root@localhost ~]# ls
anaconda-ks.cfg httpd-2.2.22 install.log php-5.4.10.tar.bz2
Desktop httpd-2.2.22.tar.bz2 install.log.syslog vmware-tools-distrib
[root@localhost ~]# cd httpd-2.2.22
[root@localhost httpd-2.2.22]#
[root@localhost httpd-2.2.22]# ./configure --prefix=/usr/local/http --enable-so
[root@localhost httpd-2.2.22]# make && make install
启动httpd
[root@localhost httpd-2.2.22]# /usr/local/http/bin/httpd
在浏览器中输入:http://172.17.17.6/
It works!
[root@localhost httpd-2.2.22]# cd /usr/local/http/
[root@localhost http]# ls
bin cgi-bin error icons lib man modules
build conf htdocs include logs manual
[root@localhost http]# cd htdocs/
[root@localhost htdocs]# ls
index.html
[root@localhost htdocs]#
[root@localhost htdocs]# vim index.html
修改文件:
today is monday!
在浏览器中输入:http://172.17.17.6/
today is monday!
[root@localhost htdocs]# vim phpinfo.php
输入:
安装php
[root@localhost htdocs]# cd
[root@localhost ~]# ls
anaconda-ks.cfg httpd-2.2.22 install.log php-5.4.10.tar.bz2
Desktop httpd-2.2.22.tar.bz2 install.log.syslog vmware-tools-distrib
[root@localhost ~]# tar fvxj php-5.4.10.tar.bz2
[root@localhost ~]# cd php-5.4.10
[root@localhost php-5.4.10]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/http/bin/apxs
安装libxml2-devel 在httpd.conf中生成php模块:
[root@localhost php-5.4.10]# mount /dev/cdrom /mnt
mount: block device /dev/cdrom is write-protected, mounting read-only
[root@localhost php-5.4.10]# yum install libxml2-devel -y
配置:
[root@localhost php-5.4.10]# ./configure --prefix=/usr/local/php --with-apxs2=/usr/local/http/bin/apxs
编译:
[root@localhost php-5.4.10]# make && make install
修改httpd.conf文件:
[root@localhost ~]# cd /usr/local/http/
[root@localhost http]# cd conf/
[root@localhost conf]# ls
extra httpd.conf magic mime.types original
[root@localhost conf]#vim httpd.conf
在# LoadModule foo_module modules/mod_foo.so下添加:
AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps
重启服务:
[root@localhost httpd-2.2.22]# /usr/local/http/bin/httpd
在浏览器中输入:
http://172.17.17.6/phpinfo.php
观察运行结果。
|
|
|
|
|
|
|