wifidog安装--part5

在Red Hat Enterprise Linux4安装认证服务器
简介
这是在Red Hat Enterprise Linux4安装认证服务器的详细指南
具体指南
安装的先决条件
up2date postgresql-client postgresql-serverup2date gcc flex libxml2-devel postgresql-devel httpd-devel libtool libpng-devel subversion
注:在Centos5,“postgresql-client”被postgresql所代替,这点也符合于RHEL5。
从source安装PHP5
RHEL4没有最新的PHP来运行wifidog认证服务器,所以我们需要从source编译一个。
PHP5 source下载地址:http://www.php.net/get/php-5.1.6.tar.bz2/from/a/mirror:
cd folder_where_you_downloadedtar -jxvf php-5.1.6.tar.bz2
按照所需编译PHP:
cd php-5.1.6./configure --with-pgsql --with-apxs2 --with-gettext --with-zlib --with-gd --enable-mbstring --with-config-file-path=/etc makesudo make installsudo cp php.ini-dist /etc/php.ini
安装认证服务器
svn checkout https://dev.wifidog.org/svn/trunk/wifidog-authsudo mv wifidog-auth/ /var/www/
安装认证服务器的外部依赖
安装PEAR模块:
sudo pear install --alldeps Image_Graph-alpha
FCKE编辑器
wget http://umn.dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.3.1.tar.gz -zxvf FCKeditor_2.3.1.tar.gzcd
FCKeditorsudo mv * /var/www/wifidog-auth/wifidog/lib/FCKeditor/
注:尝试使用特定的Sourceforge服务器,例如http://umn.dl.sourceforge.net/有可能超时或失败。那么使用“generic”下载地址:
wget http://dl.sourceforge.net/sourceforge/fckeditor/FCKeditor_2.3.1.tar.gz

配置apache
在/etc/httpd/conf/httpd.conf文件:
将PHP添加到DirectoryIndex指令:
DirectoryIndex index.html index.html.var index.php
添加以下新指令:
AddType application/x-httpd-php .php
将DocumentRoot更改为:
DocumentRoot "/var/www/wifidog-auth/wifidog/"
确保你还没有适当的key
cd /etc/httpd/conf/rm ssl.key/server.keyrm ssl.crt/server.crtmake genkeycd /usr/share/ssl/certsmake testcertcd /etc/httpd/conf/ssl.keycp server.key server.key.encryptedopenssl rsa -in server.key.encrypted -out server.keychmod 400 server.key
配置postgresql
当Postgres8+在现在的机器中运行的更快时,RHEL4中的7.4版本已不足以运行wifidog了。
注:对于全新安装来说,只有首次运行了PostgreSQL才会产生下列文件。你必须在做完变更之后关闭或重新启动服务器。
将以下内容添加到/var/lib/pgsql/data/postgresql.cnf:
tcpip_socket = true
注:8.0已经用listen_addresses setting代替了tcpip_socket flag.PostgreSQL8.0及以上在配置中不会用“tcpip_socket”启动。如果你使用.PostgreSQL8.0及以上,用以下内容代替:
'listen_addresses = 'localhost'
这些都是默认的,没有必要改成postgresql.conf。
你也许还想将
log_destination = 'syslog'
添加到postgresql.conf 的“Reporting and Logging”部分,或者确保服务器错误提示信息被放置在你可以找到的地方。
将以下内容添加到/var/lib/pgsql/data/pg_hba.conf:
host wifidog wifidog 127.0.0.1/32 md5local wifidog wifidog md5
设置cron jobs
将以下内容添加到to /etc/crontab:

##Wifidog#Send status emails every two minutes*/2 * * * * apache /usr/local/bin/php/var/www/wifidog-auth/wifidog/cron/page.php#Vacuum the database every hour01 * * * * apache /usr/local/bin/php/var/www/wifidog-auth/wifidog/cron/vacuum.php

如果/var/www/wifidog-auth/wifidog/cron/cleanup.php文件存在,将以下内容添加到/etc/crontab:
*/5 * * * * apache /usr/local/bin/php/var/www/wifidog-auth/wifidog/cron/cleanup.php
移除安装文件
当然,唯一能访问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
注:你可以将它移到你选的任何位置,只要不是公用。

本文章由 http://www.wifidog.pro/2015/01/12/wifidog%E5%AE%89%E8%A3%855.html 整理编辑,转载请注明出处

标签: wifidog认证 wifidog安装 wifidog原理 wifidog分析 wifidog配置 wifidog流程 wifidog服务器 wifidog-ddwrt wifidog openwrt