分类 服务器架设 下的文章

AirOS的wifidog网关安装

Ubiquiti产品中的Wifidog
Ubiquiti产品被应用的越来越广。Openwrt可以在其产品中运行并且固件和AirOS都有自己的版本。
与openwrt不同,AirOS没有包管理器。当大部分文件系统是只读的时候,我们需要创建有wifidog的固件来运行AirOS中的wifidog。
1 从sourceforge中获取最近的wifidog TAR包,并复制到~/dev/wifidog目录中
2 获取wifidog airos包目录

cd ~/dev/wifidog
wget http://dev.wifidog.org/wiki/doc/install/airos/wifidog_airos.tar.gz
tar xvzf wifidog_airos.tar.gz

如果在原文编辑,目录在wifidog/contrib/airos
3 下载airos SDK: http://www.ubnt.com/support/downloads,并复制到~/dev/airos
4 解压SDK并准备文件

cd ~/dev/airos
tar xvjf SDK.UBNT.v5.2.tar.bz2
cd SDK.UBNT.v5.2

cd openwrt/package
ln -s ~/dev/wifidog/airos/wifidog/ 
cd ../dl
ln -s ~/dev/wifidog/wifidog-20090925.tar.gz

cd ../..
patch -p1 < openwrt/package/wifidog/files.patch

5 准备wifidog.conf文件,当airos是只读的时候,在路由器中无法转换成config文件

cd ~/dev/airos/SDK.UBNT.v5.2/openwrt
mkdir -p files/usr/etc
cp package/wifidog/files/wifidog.conf files/usr/etc/wifidog.conf

6 想要设置认证服务器需编辑files/usr/etc/wifidog.conf文件。如果没有使用SOHO路由器配置,网关界面也需要更改。
7 设置OS

make world V=99

8 你可以在open/bin目录中得到新镜像

本文章由 http://www.wifidog.pro/2015/03/06/airos%E7%9A%84wifidog%E5%AE%89%E8%A3%85.html 整理编辑,转载请注明出处

wifidog认证服务器常见问题

认证服务器常见问题
Wifidog认证服务器相关问题

问:运行认证服务器的要求是什么?
答:1)网络服务器:Apache,IIS
2)拥有PHP5模块的网络服务器
3)PostgreSQL >= 8.0
根据不同的特性,你需要:
1)为RSS支持,扩大PHP DOM。
2)为RADIUS认证支持,PEAR Radius。
3)为网络相薄的内容,Phlick API。

问:我可以用PostgreSQL代替MySQL吗?
答:不可以。不考虑支持MySQL。要做到支持两者并要保证质量,是非常有压力的。这不是你的简单的互联网应用或者CMS。如果你想了解更多,在邮箱列单里有长篇文档。

问:CMS太复杂了,我想将HTML代码加到门户网页。
答:我们意识到我们需要提供一个更好的文档。然而这个问题的答案很简单。你只要简单的使用“TrivialLangstring”目录,在文本框里加入一些HTML代码,并将这目录与门户网页绑定在一起就可以了。

问:我可以用XML格式提取热点状态数据吗?
答:可以,可以输出XML格式的热点状态数据列表。事实上,谷歌地图整合Wifidog部分就是依赖这一特性。Ile Sans Fil也在他的主页面上使用XSL样式表来创建特定格式的展示。

问:我的认证服务器之前特别快,但现在越来越慢,甚至无加载
答:你需要
1)建个脚本,经常运行一下VACUUM ANALYZE(清理数据库表垃圾空间并优化查询)
2)确保上诉脚本能正常运行
3)如果发现你的认证服务器逐渐变慢,动行一次VACUUM FULL ANALYZE,然后进入第二步
注解:如果你有规律的运行VACUUM ANALYZE,那么你就不需要VACUUM FULL ANALYZE。然而如果你很长时间没有运行VACUUM ANALYZE了,那么你需要运行一次VACUUM FULL ANALYZE.
问题在于没有进行资料移除处理,那么联接和节点表格会逐渐增加。简单的数据移除不会收回被旧元组占用的空间,只是使他们能够被重新利用。如果你长时间没有运行VACUUM,你可能会有大量一天内无法用完的空余元组。VACUUM FULL ANALYZE弥补了这点。你必须每处理20M时运行一次VACUUM,这样可以避免XID产生更多信息。
选择性的运性周期性VACUUM,可以使autovacuum daemon在近期的PostgreSQL版本中得以实现。那时当数据库符合要求,PostgreSQL将自动移除此数据库。

问:认证页上有错误信息出现
答:检查认证服务器上显示的常见警告错误信息。

问:法语和日语字出现乱码
答:确认config.php有合适的设置区域。你也可能需要去规定Apache的字符集,把这行加入到你的httpd.conf:

AddDefaultCharset UTF-8

问:我的服务器不能发送邮件
或者会得到下列错误提示
1PHPMailer无法发送邮件。错误是:不能实例化mail函数
答:默认状态下,wifidog是通过PHPMailer来使用PHP 的mail()函数的。这信息是实际上是错误的。它是想说呼叫PHP的 mail()函数失败,大概是因为你的系统里没有安装邮件客户端。你也可以:
1)安装一个,并且确保他能够成功发送邮件
2)将wifidog/config.php改换成SMTP服务器来代替mail()
3)有时PHP能够用mail()来发送邮件但仍无效

本文章由 http://www.wifidog.pro/2015/03/05/wifidog%E8%AE%A4%E8%AF%81%E6%9C%8D%E5%8A%A1%E5%99%A8%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98.html 整理编辑,转载请注明出处

Debian Linux install wifidog auth server

Install prerequisites

Before we install anything lets be sure we have access to internet and that our apt database is updated

apt-get update

The authentification server require apache and php (we install the latest version)

apt-get install apache2 php5

Database server install

It also require a database server. PostgreSQL 8.1 is available. 8.1 is harder to configure but faster on current computer.

apt-get install postgresql-8.1

Configure PostgreSQL 8.1

If you selected postgresql-8.1, it will crash at install. You must configure postgresql.conf before being able to launch the services.

nano /etc/postgresql/8.1/main/postgresql.conf

This isn't a good security setting, you should make sure to configure the whole thing later on! Right now, you need, at least to change:

#listen_addresses='localhost'
SSL = true

for:

listen_addresse='*'
SSL = false

Install prerequisites - step2
We also need some specifics librairies

apt-get install xml-core gettext mcrypt libapache2-mod-php5 php5-cgi
apt-get install php5-mcrypt php5-mhash php5-pgsql php-pear php5-xmlrpc php5-curl

if you are using a current/2011 debian/ubuntu, you have to enable long variable names in suhosin - otherwise php will not work as expected:

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

To get the latest version of wifidog-auth we will need subversion:

apt-get install subversion

If you want multi-locales support, you will have to install that packages (or configure every one of them).

apt-get install locales-all

Some more libs

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

Some stuff that isn't needed for the install, but still nice to have on a server (and which won't be install by default). If you don't what these are, you might not need them ;-) Openssh-server will allow you to launch command remotly, very useful for the third screen of install.php

apt-get install openssh-server less

Install the auth server

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

Apache 2 configuration file
We need to change the document root. We take for granted that this server will be of no other "web" use... if it is, guess you'll have to learn how to configure apache2.

nano /etc/apache2/sites-available/default

and change (at the fifth line):

DocumentRoot /var/www/

to:

DocumentRoot /var/www/wifidog-auth/wifidog

remove the rewrite rule around line 17

restart apache2:

cd /etc/init.d/
./apache2 restart

Configure locale in wifidog.conf

If you have installed locales-all and you want to keep the "French" default portal page, this step isn't needed. In other cases: you will have to change the file config.php

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

on line 208 (ctrl+w+enter, ctrl+t+enter, 208) remplace

define('DEFAULT_LANG', 'fr_CA');

by:

define('DEFAULT_LANG', 'en_US');

Configure mail server

You need to have a valid mailer in order to mail account confirmation!

Installing postfix

apt-get install postfix

Select the "internet site with smart host" configuration option and answer the next series of questions.

Configure the auth server

Go to http://your-domaine.com/install.php and follow the instructions. You can follow the following walk-though, under the install step: auth-server. It isn't updated though. Or you can follow the onscreen introduction ;-)

They will ask to :

1) First screen

create a wifidog user in postgres

su - postgres
createuser wifidog --pwprompt 

IF you have PostgreSQL 8.1 : answer no to the three questions

create a database owned by this new user

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

you must then

cat /tmp/dog_cookie.txt

and click next in your browser (it will ask for the password in dog_cookie.txt)

2) Second screen: Verification of the installed software. If you followed this guide, you have everything install (except Radius support).

3) Third screen:

You will have to copy-paste the big serie of command, click refresh and next. The easiest way of doing that is if you have a ssh connection to your box (this is why I proposed openssh-server package earlier)

4) Fourth screen You may need to install Smarty. Let it do that. NEXT.

Click install for simplepie, (you may need to do this manually in your ssh session by changing /branches/ to /releases/ in the failed command from your web console session as the svn repo has changed structure at simplepie.org), then click NEXT.

Click install for feedpressreview, then next.

Click NEXT when asked to install Phlickr (it is already installed, even if the system doesn't see it).

5) Fill out your db information..

Remove installation files

Of course, the only one that should have access to the install.php file is you. You will need to move the file "install.php" out of public sight.

1) Go to your wifidog directory (/var/www/wifidog-auth/wifidog in our case).

cd /var/www/wifidog-auth/wifidog

2) Move "install.php" file to the parent directory which is not visible to the public:

mv install.php ../install.php

note that you can move it wherever you want, but make sure it's not public.

本文章由 http://www.wifidog.pro/2015/03/02/Debian-Linux-install-wifidog-auth-server.html 整理编辑,转载请注明出处

Red Hat Enterprise Linux install wifidog auth server

Step-by-step instructions

Install prerequisites

up2date postgresql-client postgresql-server
up2date gcc flex libxml2-devel postgresql-devel httpd-devel libtool libpng-devel subversion

Note: With Centos5, at least, "postgresql-client" is replaced by "postgresql." This appears to be true for RHEL5 as well.
Install PHP5 from source
RHEL4 doesn't have a recent enough PHP to run the wifidog auth server. We will have to compile one from source

Download PHP5 sources http://www.php.net/get/php-5.1.6.tar.bz2/from/a/mirror:

cd folder_where_you_downloaded
tar -jxvf php-5.1.6.tar.bz2

Compile PHP with the required options:

cd php-5.1.6
./configure --with-pgsql --with-apxs2 --with-gettext --with-zlib --with-gd --enable-mbstring --with-config-file-path=/etc 
make
sudo make install
sudo cp php.ini-dist /etc/php.ini

Install the auth server

svn checkout https://dev.wifidog.org/svn/trunk/wifidog-auth
sudo mv wifidog-auth/ /var/www/

Install auth server external dependencies
Install required PEAR modules:

sudo pear install --alldeps Image_Graph-alpha

FCKEditor:

wget http://umn.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.3.1.tar.gz 
tar -zxvf FCKeditor_2.3.1.tar.gz
cd FCKeditor
sudo mv * /var/www/wifidog-auth/wifidog/lib/FCKeditor/ 

Note: Attempting to use a specific Sourceforge server, e.g. http://umn.dl.sourceforge.net/ is likely to time out or otherwise fail. Instead, use the "generic" download address, like this:

wget http://dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.3.1.tar.gz

Configure apache
In file /etc/httpd/conf/httpd.conf:

Add php to the DirectoryIndex? directive:

DirectoryIndex index.html index.html.var index.php

Add the following new directive:

AddType application/x-httpd-php .php

Change DocumentRoot? to

DocumentRoot "/var/www/wifidog-auth/wifidog/"

Optional: Setup a ssl self signed key

Make sure you don't already have a proper key, this will destroy it!

cd /etc/httpd/conf/
rm ssl.key/server.key
rm ssl.crt/server.crt
make genkey
cd /usr/share/ssl/certs
make testcert
cd /etc/httpd/conf/ssl.key
cp server.key server.key.encrypted
openssl rsa -in server.key.encrypted -out server.key
chmod 400 server.key

Configure postgresql
While Postgres 8+ would be much faster on modern machines, version 7.4 in RHEL4 is NOT sufficient to run wifidog.

Note: For a completely new installation, the files listed below will not exist until the PostgreSQL service has been started for the first time. You must then either SIGHUP or restart the service after making changes.

Add the following line to /var/lib/pgsql/data/postgresql.conf:

tcpip_socket = true

Note: 8.0 has replaced the tcpip_socket flag with the listen_addresses setting. PostgreSQL 8.0 and up will not start with "tcpip_socket" in the configuration. If you are using PostgreSQL 8.0 and up, use the following instead:

'listen_addresses = 'localhost'

As this is the default, it may not be necessary to make a change to postgresql.conf.

You probably also want to add

log_destination = 'syslog' 

to the "Reporting and Logging" section of postgresql.conf, or otherwise make sure that server error messages are put someplace where you can find them.

Add the following lines to /var/lib/pgsql/data/pg_hba.conf:

host wifidog wifidog 127.0.0.1/32            md5
local wifidog wifidog           md5

Configure the auth server
Go to http://your_server_adress_here/install.php and follow the instructions.

Note: As you follow the instructions, you will be asked to create a database and user, and to assign a password. The configuration file contains a hard-coded password: wifidogtest. If you are experimenting, use that password when you set up the PostgreSQL user. Otherwise, you must edit config.php with your desired password before you start the installation process. Changing local.config.php doesn't work at this point in the installation.

本文章由 http://www.wifidog.pro/2015/03/02/Red-Hat-install-wifidog-auth-server.html 整理编辑,转载请注明出处