标签 wifidog配置 下的文章

在Windows XP SP2安装wifidog认证服务器

在Windows XP安装Wifidog
需求

安装
安装Postgres
解压文件夹,运行msi,选择默认选项,当有系统提示时创建用户和密码。

安装Apache
运行msi并选择所有默认选项

安装PHP
运行msi,有系统提示时,选择“Apache 2.2.x Module”
Apache配置目录,如:C:\Program Files\Apache Software Foundation\Apache2.2\conf\
安装所有选项(包括PEAR),并确认只安装下列扩展

  • activescript
  • curl
  • dio
  • gd2
  • gettext
  • htscanner
  • pecl_http
  • ldap
  • multi-byte string
  • mcrypt
  • mhash
  • pdflib
  • postgreSQL
  • Standard PHP
  • SVN
  • win32service
  • win32std
  • xmlrpc
  • xsl
  • zip

安装WIFIDOG
将WIFIDOG引入到“C:\wwwroot\”
使用一种实用程序如7ZIP将Smarty引入到“c:\wwwroot\wifidog-auth\wifidog\lib\”

配置

Start > All Programs > PostgreSQL 8.2 > PGADMIN III 

右键点击超级用户并点击连接,然后输入你的密码。
点击加号,展开列表
右键点击登录角色,然后点击“新登录角色…”
在“角色名称”输入wifidog,然后输入密码,点击OK
右键点击数据库图标然后点击“新数据库…”

name=wifidog
owner=wifidog
encoding=utf8
goto Start >All Programs >Apache >httpd.conf

找到以下命令

DocumentRoot = "C:/Program Files/Apache/htdocs"

并替换成

DocumentRoot "C:/wwwroot/wifidog-auth/wifidog"

将以下命令

<Directory "C:/Program Files/Apache/htdocs">

替换成

<Directory "C:/wwwroot/wifidog-auth/wifidog">

将以下命令

DirectoryIndex index.html

替换成

DirectoryIndex index.html index.php

Work Arounds
将以下命令

385         $process_info_user_id = posix_getpwuid(posix_getuid()); 
386  
387         if($process_info_user_id){ 
388             $process_username = $process_info_user_id['name']; 
389         } 
390         else { 
391             //Posix functions aren't available on windows 
392             $process_username = 'unknown_user'; 
393         } 
394         $process_info_group_id = posix_getgrgid(posix_getegid()); 
395         if($process_info_group_id){ 
396             $process_group = $process_info_group_id['name']; 
397         } 
398         else { 
399             //Posix functions aren't available on windows 
400             $process_group = 'unknown_group'; 
401         } 
402         $cmd_mkdir = ''; 
403         $cmd_chown = ''; 
404         $error = 0; 
405  
406         print "<p><em>HTTP daemon UNIX username/group</em>: $process_username/$process_group</p>"; 
407         #    print "<p><em>HTTPD group</em>: $process_group<BR</p>"; 
408         print "<p><table BORDER=\"1\"><tr><td><b>Directory</b></td></td><td><b>Owner</b></td><td><b>Writable</b></td></tr>\n"; 
409  
410         foreach ($dir_array as $dir) { 
411             print "<tr><td>$dir</td>"; 
412             if (!file_exists(WIFIDOG_ABS_FILE_PATH . "$dir")) { 
413                 print "<TD COLSPAN=\"2\" STYLE=\"text-align:center;\">Missing</td></tr>\n"; 
414                 $cmd_mkdir .= WIFIDOG_ABS_FILE_PATH . "$dir "; 
415                 $cmd_chown .= WIFIDOG_ABS_FILE_PATH . "$dir "; 
416                 $error = 1; 
417                 continue; 
418             } 
419  
420             $dir_info = posix_getpwuid(fileowner(WIFIDOG_ABS_FILE_PATH . "$dir")); 
421             if($dir_info) { 
422                 $dir_owner_username = $dir_info['name']; 
423             } 
424             else { 
425                 //Posix functions aren't available on windows 
426                 $dir_owner_username = fileowner(WIFIDOG_ABS_FILE_PATH . "$dir"); 
427             } 
428             print "<td>$dir_owner_username</td>"; 
429  
430             if (is_writable(WIFIDOG_ABS_FILE_PATH . "$dir")) { 
431                 print "<td>YES</td>"; 
432             } 
433             else { 
434                 print "<td>NO</td>"; 
435                 $cmd_chown .= WIFIDOG_ABS_FILE_PATH . "$dir "; 
436                 $error = 1; 
437             } 
438             print "</tr>\n"; 
439         } 
440         print "</table>\n"; 

替换成

* posix_getpwuid() not implemented on Microsoft Windows platforms
*/

if (!function_exists('posix_getpwuid')) {
        print "<p><em>Automated Process not currently avalible on windows.</em> please make sure the following directories exist and have WRITE permissions</p>";
print "<p><table BORDER=\"1\"><tr><td><b>Directory</b></td></tr>\n";

        foreach ($dir_array as $dir) {
            print "<tr><td>$dir</td></tr>";
    }
print "</table>";
$error = 0;
}
else {
$process_info_user_id = posix_getpwuid(posix_getuid());

        if($process_info_user_id){
            $process_username = $process_info_user_id['name'];
        }
        else {
            //Posix functions aren't available on windows
            $process_username = 'unknown_user';
        }
        $process_info_group_id = posix_getgrgid(posix_getegid());
        if($process_info_group_id){
            $process_group = $process_info_group_id['name'];
        }
        else {
            //Posix functions aren't available on windows
            $process_group = 'unknown_group';
        }
        $cmd_mkdir = '';
        $cmd_chown = '';
        $error = 0;

        print "<p><em>HTTP daemon UNIX username/group</em>: $process_username/$process_group</p>";
        #    print "<p><em>HTTPD group</em>: $process_group<BR</p>";
        print "<p><table BORDER=\"1\"><tr><td><b>Directory</b></td></td><td><b>Owner</b></td><td><b>Writable</b></td></tr>\n";

        foreach ($dir_array as $dir) {
            print "<tr><td>$dir</td>";
            if (!file_exists(WIFIDOG_ABS_FILE_PATH . "$dir")) {
                print "<TD COLSPAN=\"2\" STYLE=\"text-align:center;\">Missing</td></tr>\n";
                $cmd_mkdir .= WIFIDOG_ABS_FILE_PATH . "$dir ";
                $cmd_chown .= WIFIDOG_ABS_FILE_PATH . "$dir ";
                $error = 1;
                continue;
            }

            $dir_info = posix_getpwuid(fileowner(WIFIDOG_ABS_FILE_PATH . "$dir"));
            if($dir_info) {
                $dir_owner_username = $dir_info['name'];
            }
            else {
                //Posix functions aren't available on windows
                $dir_owner_username = fileowner(WIFIDOG_ABS_FILE_PATH . "$dir");
            }
            print "<td>$dir_owner_username</td>";

            if (is_writable(WIFIDOG_ABS_FILE_PATH . "$dir")) {
                print "<td>YES</td>";
            }
            else {
                print "<td>NO</td>";
                $cmd_chown .= WIFIDOG_ABS_FILE_PATH . "$dir ";
                $error = 1;
            }
            print "</tr>\n";
        }
        print "</table>\n";
}

缺失必要的PHP扩展:

  • 确保在Start>All Programs >PHP >PHP.ini安装了所需扩展,并检测缺失扩展也在内
  • 在C:\wwwroot\下创建phpinfo.php的文件,并添加下列代码:

然后运行此文件确保PHP配置正确

在/classes/Locale.php文件中加入以下内容:

257         echo sprintf("Warning in /classes/Locale.php setCurentLocale: Unable to setlocale() to %s: %s.  I tried %s, %s, %s, %s, and got return value: %s, current locale is: %s",$q, $locale_id, $candidate_locale_array[0], $candidate_locale_array[1], $candidate_locale_array[2], $candidate_locale_array[3], $current_locale, setlocale(LC_ALL, 0))."<br/>";

在classes\SmartyWifidog.php中找到以下命令

136         $this->security = true; 

并更改为

136         $this->security = false; 

错误的URL 在path_defines_base文件中,将以下内容:

if ($browser_url == "" || substr($browser_url,-1,1) != '/') $browser_url .= '\';

更改为

if ($browser_url == "" || substr($browser_url,-1,1) != '/') $browser_url .= '';

本文章由 http://www.wifidog.pro/2015/03/11/windowxp%E5%AE%89%E8%A3%85wifidog%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1%E5%99%A8.html 整理编辑,转载请注明出处

在SuSE安装wifidog认证服务器和网关

在SuSE安装认证服务器和网关

在openSuSE 10.3安装wifidog
认证服务器和网关在同台设备中安装完毕。以下是openSuSE的详细安装指南。这个安装是非常初级的,所以请验证或更正。
--安装openSuSE10.3需要全部软件(需要至少7GB的硬盘空间)
--更新openSuSE10.3

安装wifidog认证服务器
--安装所有PHP5扩展
--安装postgresql-server
--按照http://www.novell.com/coolsolutions/feature/595.html中的指南启动apache(启动postgresql而不是mysql)
--将目录更改为

cd /srv/www 

--用以下命令下载认证服务器

svn checkout  https://dev.wifidog.org/svn/trunk/wifidog-auth 

--将目录改为

cd /etc/apache2 

--在default-server.conf文件中,将所有“/srv/www/htdocs”改成“/srv/www/wifidog-auth/wifidog”
--重启apache服务器
--用浏览器打开http://localhost/install.php,按指南进行操作。
当运行PHP安装时:
--进入到postgresql执行命令

su – postgres 

--当创建完数据库后,应该创建有username/groupname wwwrun/www的指定目录并且用以下命令创建所有权。用x84-64 openSuSE结构PHP安装器将无法指定usrname/groupname。X86和X86-64用以下命令:

su wwwrun 
mkdir ‘indicated files’; 
chown -R wwwrun ‘indicated files’ 
chgrp -R www `indicated files’ 

--在连接到数据库之前,必须在/var/lib/pqsql/data中更改pg_hba.conf。所以将目录改为

cd /var/lib/pgsql/data 

--编辑pg_hba.conf,将“ident sameuser”变更为“md5 samerole”
默认设置:

local all all ident sameuser 
host all all 127.0.0.1/32 ident sameuser 
host all all ::1/128 ident sameuser

新设置:

local all all md5 samerole 
host all all 127.0.0.1/32 md5 samerole 
host all all ::1/128 md5 samerole

--重启postgresql服务器
--注:为了在第一次安装后能用命令“su-postrges”直接连接到数据库,重启旧值和postgresql。在启运认证服务器之前,还原“md5 samerole”。
在安装完PHP后,你会被重新定向到wifidog认证页面。做为管理员第一次登录后:
--配置认证服务器
--用任意一个本地IP地址(例如192.168.0.1)来修改本地主机。

Wifidog网关安装
--用以下命令在本地目录ex./root下载wifidog软件

svn checkout  https://dev.wifidog.org/svn/trunk/wifidog

--更改目录为

cd/root/wifidog

--安装网关的命令

./autogen.sh
make 
make install 

--连接到第二个有线网络卡并进行配置
按指南将SuSE10做为路由器进行安装,指南可从以下网页获得:http://www.novell.com/coolsolutions/feature/16579.html
--通过服务器内部卡将另一台终端电脑连接到服务器
--测试通过服器将另一台电脑与互联网这间进行连接是否有效
--创建/usr/local/etc目录

cp /root/wifidog/wifidog.conf /usr/local/etc/. 
cp /root/wifidog/wifidog-msg.html /usr/local/etc/. 

--在wifidog.conf文件中依据你硬件和服务器的配置对内部和外部设备进行配置。例如:

GatewayID default 
    ExternalInterface eth0 
    GatewayInterface eth2 
    AuthServer { 
        Hostname 192.168.0.1 
        SSLAvailable no 
        SSLPort 443 
        HTTPPort 80 
        Path / 
} 

--192.168.0.1是将服务器作为路由器进行安装时,嵌入到内部卡的任意IP地址。这个地址也相当于是认证服务器的默认虚拟主机的用户名。
--重启服务器
--用以下命令启动网关

wifidog -f -d 7 

通过内部无线路由器连接到wifidog
--断开终端PC的内部以太网网线,并连接到有内部无线路由器或接入点的LAN。
--配置将作为接入点的外部路由器和内部路由器。如以下所示:
http://www.dslreports.com/faq/11233
--通过路由器与终端PC进行连接,并转到wifidog的登录页面。
--如果在连接时遇到问题,用以下命令重启网络:

/etc/init.d/network restart

本文章由 http://www.wifidog.pro/2015/03/11/Suse%E5%AE%89%E8%A3%85wifidog%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%92%8C%E7%BD%91%E5%85%B3.html 整理编辑,转载请注明出处

在Ubuntu Linux安装wifidog认证服务器(2)

Apache 2配置文件
我们需要变更文件路径。我们认为这台服务器不应该有其它“网络”使用。如果这样,你就需要学习如何配置apache2。

nano /etc/apache2/sites-available/default

将以下内容:(在第五行)

DocumentRoot /var/www/

更改为

DocumentRoot /var/www/wifidog-auth/wifidog

重启apache2:

sudo /etc/init.d/apache2 restart

在wifidog.conf配置语言环境
如果你想翻译所有语言,你需要创建所有语言环境。如果你的磁盘空间很充足,你可以能过各种方法进行操作。最简单的方法是在ubuntu执行以下命令:

sudo apt-get install language-pack-bg-base language-pack-de-base language-pack-el-base language-pack-es-base language-pack-fr-base language-pack-it-base language-pack-ja-base language-pack-pt-base language-pack-sv-base

你也许想在config.php文件中设置门户页面的默认语言

sudo nano /var/www/wifidog-auth/wifidog/config.php

define('DEFAULT_LANG', 'fr_CA');

改为

define('DEFAULT_LANG', 'en_US');

设置邮件服务器
你需要有有效的邮件程序来发送帐号确认信息。
安装postfix

sudo apt-get install postfix

选择“internet site with smart host”配置选项并回答下面一系列问题。

配置认证服务器
访问http://your-domaine.com/install.php并按指南操作。也可以参照以下步骤。
如果你还没有配置dns/domain重定向,你可以用“ifconfig”命令获取IP地址。
你必须执行

cat /tmp/dog_cookie.txt

然后在浏览器中点击下一步(在dog_cookie.txt文件中会需要密码)
1)First screen
在postgres创建一个wifidog用户

su - postgres
createuser wifidog --pwprompt 

当需要插入密码时执行

wifidogtest

如果你有PostgreSQL 8.1:三个问题的回答都为否。如果你有PostgreSQL7.4:两个问题的回答为否。
创建此用户的数据库

createdb wifidog --encoding=UTF-8 --owner=wifidog

2)Second screen:你需要复制粘贴这一长串的命令,点击刷新和下一步。此操作最简单的方法是看你是否将SSH链接到你的box。

sudo su -

然后复制整个命令包
3)Third screen:检测已安装过的软件。如果你按此指南操作,你已经具有了所有安装的条件。安装simplepie,然后安装PHPMailer,下一步安装feedpressreview,下一步安装Smarty。(虽然系统没有检测到,但Phlickr已经被安装)点击下一步。
4) Forth screen: 添加DB信息

移除安装文件
当然,唯一能访问install.php文件的只有你。你将需要将install.php文件移出公众视线。
1)进入到wifidog目录(/var/www/wifidog-auth/wifidog)

cd /var/www/wifidog-auth/wifidog

2)将install.php文件移到根目录,他人无法访问:

mv install.php ../install.php

注:你可以将它移到你选的任何位置,只要不是公用。
编辑install.php文件的第931行,移除“window.location.reload(true);”

本文章由 http://www.wifidog.pro/2015/03/10/Ubuntu%E5%AE%89%E8%A3%85wifidog%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1%E5%99%A8-2.html 整理编辑,转载请注明出处

在Ubuntu Linux安装wifidog认证服务器(1)

简介
这是在Ubuntu Linux安装认证服务器的详细指南

安装distro
从Ubuntu:current release下载distro。烧录到盘上并启动有cdrom的电脑。这是标准安装:点击桌面上的“安装”并按指南操作。默认安装会安上许多不需要的东西,如果你没有足够的磁盘空间,你可以试试安装Debian。

Ubuntu默认软件管理器是APT,这让我很轻松的完成这个指南(大部分从debian安装指南剪切粘贴过来的)
重启时,在GUI输入你的用户名/密码,启动Applications/Accessories/Terminal。

安装prerequisites
你将会做为标准用户登录,所以我们需要在每个“root-runned”命令前面加上sudo。
在进行安装操作之前,我们需连接到网络并更新APT数据库

sudo apt-get update

认证服务器需要一个网络服务器(apache2)和PHP(最新版本)

sudo apt-get install apache2 php5

如果你使用的是current/2011 debian/ubuntu,你需要在suhosin使用长变量名,这样PHP才能正常运行:

vi /etc/php5/apache2/conf.d/suhosin.ini
-> add:  suhosin.post.max_name_length = 100
-> add:  suhosin.request.max_varname_length = 100

数据库服务器安装
我们还需要数据库服务器,所以需要安装PostgreSQL并已被完全配置。

sudo apt-get install postgresql

安装prerequisites-step2
我们也需要一些细节库

sudo apt-get install php5-cgi
sudo apt-get install php5-mhash php5-pgsql php-pear php5-xmlrpc php5-curl php5-mcrypt php5-dev
sudo apt-get install language-pack-en-base

如果用最近版本的wifidog-auth,我们需要安装subversion:

sudo apt-get install subversion

在“sudo pear install Phlickr-0.2.5.tgz”,你会看到这样的错误提示:"/tmp/glibctestWTQG39:1:22: error: features.h no such file"...
这没关系,安装会继续并且FlickrPhotoStream将会成为有效内容类型。

sudo pear install XML_RPC
cd /tmp
wget http://ovh.dl.sourceforge.net/sourceforge/phlickr/Phlickr-0.2.5.tgz
sudo pear install Phlickr-0.2.5.tgz 
rm Phlickr-0.2.5.tgz

你也许想要安装openssh-server(更便于远程连接)。但这不是WIFIDOG-AUTH的所必需的。
sudo apt-get install openssh-server

安装认证服务器

svn checkout https://dev.wifidog.org/svn/trunk/wifidog-auth
sudo mv wifidog-auth/ /var/www/
/var/www/wifidog-auth/wifidog/classes/Dependency.php文件需要被编辑,否则smarty安装将失败。
Change line 122 to the following:'website' => "http://www.smarty.net/",
Change line 123 to the following: 'installSourceUrl' => "http://www.smarty.net/files/Smarty-2.6.26.tar.gz",

本文章由 http://www.wifidog.pro/2015/03/10/Ubuntu%E5%AE%89%E8%A3%85wifidog%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1%E5%99%A8.html 整理编辑,转载请注明出处