Lighthttpd - 从 Web 应用程序更新系统网络配置文件的最佳方法
我有一个 Gumstix(运行 Linux),我正在将其用于一个项目,并且希望能够通过在内置 Web 服务器上运行的网页来配置以太网/wifi 配置。
想想路由器和类似的东西是如何工作的——你可以登录一个默认的网址并从那里配置一切——这就是我想要做的。
有人知道这样做的好方法吗?是否有一个模板化的配置文件在某处,然后我只需用模板化的配置文件覆盖现有的网络配置文件(使用提供的用户信息,例如wifi密钥等)。这似乎不是最干净/最正确的做事方式......或者是否有一些库等我可以用来实现这一目标?
谢谢!
I have a Gumstix (runs linux) that im using for a project and would like to be able to configure the ethernet / wifi configuration through a web page running on the built in web server.
Think of how routers and the such work - you can log into a default web address and configure everything from there - thats what I want to be able to do.
Does anybody know of a good way to do this? Is it a matter of having a templated configuration file somewhere, then i just override the existing network config file with the templated one (using provided user information, e.g. wifi key etc). This doest seem like the cleanest / most correct way of doing things...or is there some libraries etc that I can use to achieve this?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您想自己承担繁重的工作,那么您就走在正确的道路上。对于一个有针对性的、简单的界面来说,这可能是正确的选择。您可以使用 .htaccess 来要求用户名和密码以保证其相当安全。
另外,不要忘记重新启动配置的任何服务,以便它们获取新的配置。
或者对于预构建的解决方案,有很多选项,您可以将 webmin 调整为合理的东西。
If you want to do the heavy lifting yourself, you're on the right path. For a targetted, simple interface it might be the way to go. You can use .htaccess to require a username and password to keep it reasonably secure.
Also don't forget to restart whatever services are configured so that they pick up the new config.
Or for a prebuilt solution, there's a number of options out there, you might be able to tune webmin down to something reasonable.