wifi用户认证解决方案——Wifidog+Authpuppy的程序安装与配置

最近实验室在作一个项目,其中须要wifi的接入认证,本身写一个认证系统比较麻烦,先用wifidog进行实验测试。在此我将这几天作的事作个整理总结。
搭建wifidog系统主要就三大步,一是在OpenWrt的路由器上安装Wifidog应用程序,二是在服务器上安装authpuppy认证服务,三是配置网络结点和路由器认证php

工做环境:   服务器:ubuntu 16.04 + authpuppyhtml

          路由器:NetGear WNDR3800 + wifidognode

 

1、在OpenWrt的路由器上安装Wifidog应用程序

安装Wifidog程序有两种方式,一种是在刷了OpenWrt的路由器上直接安装Wifidog;或者是把Wifidog直接编译进OpenWrt中。因为项目还须要安装其余程序,这里我选择第二种方式。mysql

1. 在OpenWrt系统的源码文件下,编辑feeds.conf.default文件linux

vim feeds.conf.default

 在其中增长一行:git

src-git wifidog https://github.com/wifidog/wifidog-gateway.git

 2. 而后更新,再安装:github

./scripts/feeds update -a ./scripts/feeds install -a

3. 终端执行编译命令web

make menuconfig

4. 在Network/captive portals/下选择wifidog 就有选择 WiFiDog 这一项了sql

 

2、在服务器上安装authpuppy认证服务

一、首先安装authpuppy服务端验证

1. 安装php开发环境:shell

sudo apt-get install apache2 php-mysql libapache2-mod-php mysql mysql-server

 2. 启用apache rewrite,不然会出现(Therequested URL /install/3 was not found on this server.)错误

sudo a2enmod rewrite

 3. 到https://launchpad.net/authpuppy 从http://launchpad.net/authpuppy下载authpuppy最新源码,解压并移动到/var/www/目录下。

tar xvzf authpuppy-<version>-<stability>_<packaging>.tgz sudo mv authpuppy /var/www/

4. 为authpuppy赋予权限

chmod 777 /var/www/html/authpuppy/ -R

5. 修改/etc/apache2/sites-enabled/000-default.conf替换全部内容

sudo gedit /etc/apache2/sites-enabled/000-default.conf

 修改以下:

<VirtualHost *:80> ServerAdmin webmaster@localhost ServerName authpuppy.localhost ServerAlias authpuppy.test DocumentRoot /var/www/authpuppy/web DirectoryIndex index.php <Directory /var/www/authpuppy/web/> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> Alias /sf /var/www/authpuppy/lib/vendor/symfony/data/web/sf <Directory "/var/www/authpuppy/lib/vendor/symfony/data/web/sf"> AllowOverride All Allow from All </Directory> ErrorLog /var/log/apache2/authpuppy/error.log # Possible values include: debug, info, notice, warn, error, crit, # alert, emerg. LogLevel warn CustomLog /var/log/apache2/authpuppy/access.log combined </VirtualHost>

 6. 重启apache

sudo service apache2 restart

 7. Mysql数据库的建立

authpuppy须要使用数据库进行用户认证管理,能够使用mysql建立一个名为authpuppy的数据库。

user@yourserver $> mysqladmin -uroot -p create authpuppy

 8. 访问http://localhost出现authpuppy配置页面

9. 点击下一步继续,这一步会检测系统的环境是否知足authpuppy的要求,不知足的会显示红色,按要求配置好就能够点击下一步了。

10. wifidog数据库的配置。填写在低7步建立的数据库名字,并填写你的数据库帐号和密码等信息,此处为了方便,使用root登陆,读者能够新建一个user用于访问。

11. 一直点击下一步,直到出现管理员用户配置页面,配置用户信息:

12. 最后配置成功,出现以下页面,此时authpuppy的基本配置完成:

13. 之后再次访问http://localhost,就会出现以下页面,不须要从新配置了:

 

二、配置服务器和插件管理

1. 访问http://localhost ,经过管理员帐户登陆,配置authserver

2. 配置完成后再次访问http://localhost 就会出现以下界面

3. 点击Manageplugins,点击View all available plugins and updates添加插件,
安装apAuthLocalUserPlugin这个插件,并启用,就能够对登陆帐号进行管理了,更多插件的使用能够本身慢慢摸索。

3、配置网络结点和路由器认证

1. 访问http://localhost 以管理员身份登陆,点击Managenodes进行结点的管理,服务器默认为咱们建立了一个叫My first node的结点,咱们对其进行编辑,修改Name :wifidog,gw id:123456,deployment status 选择Deployed

2. 登陆到路由器(linux直接使用ssh命令,windows下能够使用putty、xshell等工具),编辑/etc/wifidog.conf,须要配置的主要有三项:

#这个须要与服务器中gw id相对应 GatewayID 123456 #查看本身的路由器进行配置,外网接口 ExternalInterfaceeth0.2 #路由器内网接口 GatewayInterface br-lan #服务器配置 AuthServer { #服务器的ip地址 Hostname192.168.0.224 SSLAvailable yes Path / }

3. 启动wifidog

/etc/init.d/wifidog enable /etc/init.d/wifidog start

4. 链接该无线网络,开始验证。

 

本文有部份内容来自文章——公共场所wifi认证解决方案wifidog+authpuppy 

 

over

相关文章
相关标签/搜索