floodlight控制器用PHP重新写webUI

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

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值