floodlight控制器用PHP重新写webUI
大家都知道floodlight本身的webUI是localhost/ui/index.html
1.我试着用我的Linux环境架另一个服务器来提供php的环境。可以参考我的另一篇文章。关于怎么架构lamp。
2.Proxy 我们在宿主机上又搭建了一台服务器,后端即Command Proxy负责转发前端Web Interface的操作请求给Floodlight。
由于ajax不能跨域请求,所以建立了一个服务器端代理。Command Proxy是我们用PHP编写的一个后端脚本,它用来转发Web Interface的请求或者执行Web Interface发送的命令。
3.接着把整个PHP写的webUI放在var/www/html里面。就是floodlight那个resource里面那个web;
4.然后解决floodlight与webUI之间的通信问题
在floodlight里面改路径:
/**
* Copyright 2013, Big Switch Networks, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissio

本文介绍了如何使用PHP重写floodlight的Web用户界面。首先在Linux环境中搭建了LAMP服务器,然后通过Proxy解决跨域问题,利用PHP的Command Proxy脚本转发请求。将PHP Web UI部署到floodlight的资源目录,并修改floodlight配置以实现两者间的通信,最终成功在浏览器中展示PHP页面,实现查看网络拓扑图的功能。
最低0.47元/天 解锁文章
3294

被折叠的 条评论
为什么被折叠?



