---
title: "wifidog+authpuppy认证页面的配置"
author: "fp_moon"
date: "2013-10-29T02:15:53Z"
tags: []
categories: ["编程语言"]
slug: "wifidog-authpuppy"
draft: false
lastmod: "2013-10-29T02:17:29Z"
id: 1965877
url: "https://fp-moon.iteye.com/blog/1965877"
---

转自：http://blog.sina.com.cn/s/blog\_d2facf270101g7hy.html

[]()[]()[]()wifidog+authpuppy认证页面的配置[]()[]()

 

路由器上用的是wifidog  client，服务器后端管理用的是authpuppy。  
首先，选择自己的操作系统，在http://www.authpuppy.org/doc/Main\_Page网站里面，我的操作系统是Linux。

然后到这个网站http://www.authpuppy.org/doc/Getting\_Started去下载[check\_configuration.php](http://sf-to.org/1.4/check.php "http://sf-to.org/1.4/check.php")这个文件是检测你的电脑安装authpuppy需要哪些环境，下面是我配置好的环境  
[&lt;!--\[if gte vml 1\]&gt;&lt;v:shapetype id="\_x0000\_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f"&gt; &lt;v:stroke joinstyle="miter"/&gt; &lt;v:formulas&gt; &lt;v:f eqn="if lineDrawn pixelLineWidth 0"/&gt; &lt;v:f eqn="sum @0 1 0"/&gt; &lt;v:f eqn="sum 0 0 @1"/&gt; &lt;v:f eqn="prod @2 1 2"/&gt; &lt;v:f eqn="prod @3 21600 pixelWidth"/&gt; &lt;v:f eqn="prod @3 21600 pixelHeight"/&gt; &lt;v:f eqn="sum @0 0 1"/&gt; &lt;v:f eqn="prod @6 1 2"/&gt; &lt;v:f eqn="prod @7 21600 pixelWidth"/&gt; &lt;v:f eqn="sum @8 21600 0"/&gt; &lt;v:f eqn="prod @7 21600 pixelHeight"/&gt; &lt;v:f eqn="sum @10 21600 0"/&gt; &lt;/v:formulas&gt; &lt;v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/&gt; &lt;o:lock v:ext="edit" aspectratio="t"/&gt; &lt;/v:shapetype&gt;&lt;v:shape id="图片\_x0020\_4" o:spid="\_x0000\_i1028" type="#\_x0000\_t75" alt="wifidog+authpuppy认证页面的配置" href="http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&amp;url=http://album.sina.com.cn/pic/d2facf27gx6Di229KDacc" target="\_blank" style='width:510pt;height:440.25pt;visibility:visible; mso-wrap-style:square' o:button="t"&gt; &lt;v:imagedata src="file:///C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp\\msohtmlclip1\\01\\clip\_image001.png" o:title="wifidog+authpuppy认证页面的配置"/&gt; &lt;/v:shape&gt;&lt;!\[endif\]--&gt;&lt;!--\[if !vml\]--&gt;&lt;!--\[endif\]--&gt;](http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&url=http://album.sina.com.cn/pic/d2facf27gx6Di229KDacc)

然后到这个[http://launchpad.net/authpuppy](http://launchpad.net/authpuppy "http://launchpad.net/authpuppy") 下载authpuppy的源码，然后把解压后的authpuppy目录放到apache2的站点目录，我的是ubuntu12.10，安装后的apache2目录是/etc/apache2/sites-available/default，  
打开的内容是

&lt;VirtualHost \*:80&gt;  
        ServerAdmin webmaster@localhost

        DocumentRoot /var/www/  
        &lt;Directory /&gt;  
                Options FollowSymLinks  
                AllowOverride All  
        &lt;/Directory&gt;  
        &lt;Directory /var/www/authpuppy/web/&gt;  
                Options Indexes FollowSymLinks MultiViews  
                AllowOverride All  
                Order allow,deny  
                allow from all  
        &lt;/Directory&gt;

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/  
        &lt;Directory "/usr/lib/cgi-bin"&gt;  
                AllowOverride None  
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch  
                Order allow,deny  
                Allow from all  
        &lt;/Directory&gt;  
        ErrorLog ${APACHE\_LOG\_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,  
        # alert, emerg.  
        LogLevel warn

        CustomLog ${APACHE\_LOG\_DIR}/access.log combined  
&lt;/VirtualHost&gt;

由于刚开始什么都不懂，都不知道里面目录是什么意思，所以就挑几个来说明下

DocumentRoot /var/www    这个目录是apache2服务器的根目录，也就是说当你打开浏览器在地址栏输入127.0.0.1时，就是进入/var/www/这个目录里面

&lt;Directory /var/www/&gt;  
                Options Indexes FollowSymLinks MultiViews  
                AllowOverride All  
                Order allow,deny  
                allow from all  
        &lt;/Directory&gt;  
这个是你在apache里面架设服务器的根目录，比如我架设的是authpuppy，当我一进入authpuppy是/var/www/authpuppy/web/这个目录下的文件，其他的也没什么好讲的。所以我们应该把authpuppy目录放在/var/www/这个目录下面。

接下来就是配置这个apache这个，这个是让我最头疼的地方，配置了好几天，才搞明白是怎么回事。  
首先咱们来看下http://www.authpuppy.org/doc/Getting\_Started这个里面的配置内容

[&lt;!--\[if gte vml 1\]&gt;&lt;v:shape id="图片\_x0020\_5" o:spid="\_x0000\_i1027" type="#\_x0000\_t75" alt="wifidog+authpuppy认证页面的配置" href="http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&amp;url=http://album.sina.com.cn/pic/d2facf27gx6Di3RgzV8d2" target="\_blank" style='width:441pt;height:368.25pt;visibility:visible; mso-wrap-style:square' o:button="t"&gt; &lt;v:imagedata src="file:///C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp\\msohtmlclip1\\01\\clip\_image003.png" o:title="wifidog+authpuppy认证页面的配置"/&gt; &lt;/v:shape&gt;&lt;!\[endif\]--&gt;&lt;!--\[if !vml\]--&gt;&lt;!--\[endif\]--&gt;](http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&url=http://album.sina.com.cn/pic/d2facf27gx6Di3RgzV8d2)

我一开始也没多想就直接复制和粘帖，结果安装到第三步就出错了。哦，忘了说怎么安装了，在浏览器的地址栏上输入127.0.0.1查看authpuppy的目录在哪，然后进入authpuppy里面web的目录，就会在网页上跳出安装页面。

再回过来说说apache怎么配置吧，先给大家看看我的配置文件

 &lt;VirtualHost \*:80&gt;  
       ServerAdmin webmaster@localhost  
       ServerName authpuppy.localhost  
       ServerAlias authpuppy.test

       DocumentRoot /var/www/  
       DirectoryIndex index.php

        &lt;Directory /var/www/authpuppy/web/&gt;  
               Options Indexes FollowSymLinks MultiViews  
               AllowOverride All  
               Order allow,deny  
               allow from all  
       &lt;/Directory&gt;

       Alias /sf /var/www/authpuppy/lib/vendor/symfony/data/web/sf  
       &lt;Directory "/var/www/authpuppy/lib/vendor/symfony/data/web/sf"&gt;  
               AllowOverride All  
               Allow from All  
       &lt;/Directory&gt;

       ErrorLog ${APACHE\_LOG\_DIR}/error.log  
       # Possible values include: debug, info, notice, warn, error, crit,  
       # alert, emerg.  
       LogLevel warn

       CustomLog ${APACHE\_LOG\_DIR}/access.log combined

  &lt;/VirtualHost&gt;

不知道大家有没发现这两个目录不一样

ErrorLog /var/log/apache2/authpuppy/error.log  
CustomLog /var/log/apache2/authpuppy/access.log  
   
我在我的电脑里面发现/var/log/apache2/里面没有authpuppy这个目录，后来我就把这两个目录改了，最后安装成功。当你见到如下图片的时候就说明你已经安装成功，接下来尽管next就行了。  
 [&lt;!--\[if gte vml 1\]&gt;&lt;v:shape id="图片\_x0020\_6" o:spid="\_x0000\_i1026" type="#\_x0000\_t75" alt="wifidog+authpuppy认证页面的配置" href="http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&amp;url=http://album.sina.com.cn/pic/d2facf27gx6Di5e5b2sdc" target="\_blank" style='width:515.25pt;height:387pt;visibility:visible; mso-wrap-style:square' o:button="t"&gt; &lt;v:imagedata src="file:///C:\\DOCUME~1\\ADMINI~1\\LOCALS~1\\Temp\\msohtmlclip1\\01\\clip\_image005.png" o:title="wifidog+authpuppy认证页面的配置"/&gt; &lt;/v:shape&gt;&lt;!\[endif\]--&gt;&lt;!--\[if !vml\]--&gt;&lt;!--\[endif\]--&gt;](http://photo.blog.sina.com.cn/showpic.html#blogid=d2facf270101g7hy&url=http://album.sina.com.cn/pic/d2facf27gx6Di5e5b2sdc)  
   
   
现在authpuppy已经安装完了，先松一口气吧。  
   
   
接下来我们就来配置wifidog.conf文件以实现和authpuppy相链接。  
这是wifidog.conf文件  
http://dev.wifidog.org/browser/trunk/wifidog/wifidog.conf  
   
   
由于第一次接触路由，所以有几个地方先说明下，自己老是搞乱，给以后的新手留给经验。  
   
最最重要的一点是，在这个配置文件里面第一格不能是空格，否则就会出错。  
   
ExternalInterface br-lan  这个是lan口，这样才能连上路由，比如手机  
   
   
GatewayInterface eth0.2   这个是wan口，通过这个与authpuppy server通信。所以主机的网卡要和wan同一网络，  
我的wan口ip是192.168.2.200,要和Hostname同一网段，才能通信。  
   
AuthServer {                                                                     
    Hostname 192.168.2.2                                                         
    SSLAvailable yes                                                             
    Path /authpuppy/web/                                                         
}  
还有这个Path，一开始我是设置成  /   根目录，结果不行，出现了这个问题：  
HTTP Response from Server: [HTTP/1.1 404 Not Found  
   
后来设置成这个目录才可以。还有一点要注意的是Path的目录两边都要加/，不然也会出错。

 

 

[]()[]()Authpuppy下载：

[https://launchpad.net/authpuppy/+download](https://launchpad.net/authpuppy/+download)&lt;!--\[if !supportNestedAnchors]--&gt;[]()[]()&lt;!--\[endif]--&gt;

 

[]()[]()Authpuppy官网：

[http://www.authpuppy.org/](http://www.authpuppy.org/)

 

Authpuppy文档：

 

[http://www.authpuppy.org/doc/Main\_Page](http://www.authpuppy.org/doc/Main_Page)