簡(jiǎn)介
這是在Red Hat Enterprise Linux4安裝認(rèn)證服務(wù)器的詳細(xì)指南
具體指南
安裝的先決條件
up2date postgresql-client postgresql-server
up2date gcc flex libxml2-devel postgresql-devel httpd-devel libtool libpng-devel subversion
注:在Centos5,“postgresql-client”被postgresql所代替,這點(diǎn)也符合于RHEL5核蘸。
從source安裝PHP5
RHEL4沒(méi)有最新的PHP來(lái)運(yùn)行wifidog認(rèn)證服務(wù)器啸驯,所以我們需要從source編譯一個(gè)。
PHP5 source下載地址: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
按照所需編譯PHP:
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
安裝認(rèn)證服務(wù)器
svn checkout https://dev.wifidog.org/svn/trunk/wifidog-auth
sudo mv wifidog-auth/ /var/www/
安裝認(rèn)證服務(wù)器的外部依賴
安裝PEAR模塊:
sudo pear install --alldeps Image_Graph-alpha
FCKE編輯器
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/
注:嘗試使用特定的Sourceforge服務(wù)器,例如http://umn.dl.sourceforge.net/有可能超時(shí)或失敗针姿。那么使用“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/"
確保你還沒(méi)有適當(dāng)?shù)膋ey
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
配置postgresql
當(dāng)Postgres8+在現(xiàn)在的機(jī)器中運(yùn)行的更快時(shí)搓幌,RHEL4中的7.4版本已不足以運(yùn)行wifidog了迅箩。
注:對(duì)于全新安裝來(lái)說(shuō),只有首次運(yùn)行了PostgreSQL才會(huì)產(chǎn)生下列文件拐揭。你必須在做完變更之后關(guān)閉或重新啟動(dòng)服務(wù)器奕塑。
將以下內(nèi)容添加到/var/lib/pgsql/data/postgresql.cnf:
tcpip_socket = true
注:8.0已經(jīng)用listen_addresses setting代替了tcpip_socket flag.PostgreSQL8.0及以上在配置中不會(huì)用“tcpip_socket”啟動(dòng)。如果你使用.PostgreSQL8.0及以上,用以下內(nèi)容代替:
'listen_addresses = 'localhost'
這些都是默認(rèn)的龄砰,沒(méi)有必要改成postgresql.conf。
你也許還想將
log_destination = 'syslog'
添加到postgresql.conf 的“Reporting and Logging”部分式镐,或者確保服務(wù)器錯(cuò)誤提示信息被放置在你可以找到的地方。
將以下內(nèi)容添加到/var/lib/pgsql/data/pg_hba.conf:
host wifidog wifidog 127.0.0.1/32? ? ? ? ? ? md5
local wifidog wifidog? ? ? ? ? md5
設(shè)置cron jobs
將以下內(nèi)容添加到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 hour
01 * * * * apache /usr/local/bin/php
/var/www/wifidog-auth/wifidog/cron/vacuum.php
如果/var/www/wifidog-auth/wifidog/cron/cleanup.php文件存在歹茶,將以下內(nèi)容添加到/etc/crontab:
*/5 * * * * apache /usr/local/bin/php
/var/www/wifidog-auth/wifidog/cron/cleanup.php
移除安裝文件
當(dāng)然你弦,唯一能訪問(wèn)install.php文件的只有你。你將需要將install.php文件移出公眾視線尸昧。
1)進(jìn)入到wifidog目錄(/var/www/wifidog-auth/wifidog)
cd /var/www/wifidog-auth/wifidog
2)將install.php文件移到根目錄,他人無(wú)法訪問(wèn):
mv install.php ../install.php
注:你可以將它移到你選的任何位置领迈,只要不是公用。
本文章由 http://www.wifidog.pro 整理編輯衷蜓,轉(zhuǎn)載請(qǐng)注明出處