设为首页 收藏本站
查看: 730|回复: 0

[经验分享] php与bonding

[复制链接]

尚未签到

发表于 2018-12-22 11:23:50 | 显示全部楼层 |阅读模式
  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
观察运行结果。




运维网声明 1、欢迎大家加入本站运维交流群:群②:261659950 群⑤:202807635 群⑦870801961 群⑧679858003
2、本站所有主题由该帖子作者发表,该帖子作者与运维网享有帖子相关版权
3、所有作品的著作权均归原作者享有,请您和我们一样尊重他人的著作权等合法权益。如果您对作品感到满意,请购买正版
4、禁止制作、复制、发布和传播具有反动、淫秽、色情、暴力、凶杀等内容的信息,一经发现立即删除。若您因此触犯法律,一切后果自负,我们对此不承担任何责任
5、所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其内容的准确性、可靠性、正当性、安全性、合法性等负责,亦不承担任何法律责任
6、所有作品仅供您个人学习、研究或欣赏,不得用于商业或者其他用途,否则,一切后果均由您自己承担,我们对此不承担任何法律责任
7、如涉及侵犯版权等问题,请您及时通知我们,我们将立即采取措施予以解决
8、联系人Email:admin@iyunv.com 网址:www.yunweiku.com

所有资源均系网友上传或者通过网络收集,我们仅提供一个展示、介绍、观摩学习的平台,我们不对其承担任何法律责任,如涉及侵犯版权等问题,请您及时通知我们,我们将立即处理,联系人Email:kefu@iyunv.com,QQ:1061981298 本贴地址:https://www.yunweiku.com/thread-654354-1-1.html 上篇帖子: php加密算法小结 下篇帖子: PHP 数值
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

扫码加入运维网微信交流群X

扫码加入运维网微信交流群

扫描二维码加入运维网微信交流群,最新一手资源尽在官方微信交流群!快快加入我们吧...

扫描微信二维码查看详情

客服E-mail:kefu@iyunv.com 客服QQ:1061981298


QQ群⑦:运维网交流群⑦ QQ群⑧:运维网交流群⑧ k8s群:运维网kubernetes交流群


提醒:禁止发布任何违反国家法律、法规的言论与图片等内容;本站内容均来自个人观点与网络等信息,非本站认同之观点.


本站大部分资源是网友从网上搜集分享而来,其版权均归原作者及其网站所有,我们尊重他人的合法权益,如有内容侵犯您的合法权益,请及时与我们联系进行核实删除!



合作伙伴: 青云cloud

快速回复 返回顶部 返回列表