最後修改日期: 2006/06/30

  
Relay ( Ajax  Directory Manager )

Description:

       
這是一支 PHP 搭配 PERL 所開發的 web ajax 檔案目錄管理軟體,官方網站在 http://www.ecosmear.com/relay/ 官網這邊也有 demo 網頁可測試看看,Ajax 近來可真的熱到不行,目前很多網路上的網站開發都朝這方向進行Relay 這支程式是小弟不小心逛到檔案目錄管理還算蠻實用的所以就把它下載到我的 FreeBSD Server 裝起來玩玩,以下是我的安裝方式順便記錄一下免得過兩天又忘記沒得參考

Environment :

             硬體:i386 PC Intel P3 500
             作業系統:FreeBSD 6.0 Release
          
記憶體:256M RAM

Setp 1.

首先在 FreeBSD 下先確認是否有以下的環境:

PHP version 4+
MySQL version 4+
Perl 5.8.0
Apache 2.0

因為 Relay 需要用到 PHP 的 fileinfo extensions 而我的 PHP 恰好沒加裝 fileinfo 這個 extensions 所以我用 ports 再加裝

#cd /usr/ports/lang/php4-extensions       
#  切換到 ports 目錄下準備安裝 fileinfo 延伸套件
#make config

[X] FILEINFO     fileinfo support      # 我加選 fileinfo extensions

#make install       
#  有錯誤發生要我先 deinstall 再 reinstall
#make deinstall
#make reinstall

#cd /usr/lcoal/www/data   
  #  切換目錄並到官網下載  relayb01-062906.zip 軟體放到你的 apache 目錄下

#unzip relayb01-062906.zip        
# 用 unzip 解開

#chown -R www:www relay
       
# 更改 relay 目錄權限

Setp 2. 

手動建立 relay 資料庫並給個使用者及 relay_password

#mysql -p

mysql>create database relay;
mysql>grant all on relay.* TO relay@localhost IDENTIFIED BY 'relay_password';
mysql> flush privileges;
mysql> exit

※ 修改 apache 的 httpd.conf 檔讓 .pl 的檔案可運行於你的 relay 目錄下,因為 upload.pl 這支程式要能概在 ralay 目錄下也能執行所以就必須要開啟 mod_cgi 於這個執行目錄

ScriptAlias /relay/.* "/usr/local/www/data/relay/"

<Directory "/usr/local/www/data/relay">
    AllowOverride All
    Options All
    Order allow,deny
    Allow from all
</Directory>

AddHandler cgi-script .cgi .pl

#apachectl restart   # 重新啟動 apache

#vi /usr/local/www/data/relay/test.pl    # 寫個  hello world 測試看看是否成功運行 .pl

#!/usr/bin/perl

print "Content-type: text/html\n\n";
print "<html><body>\n";
print "<hr>Hello, world!<br><hr>\n";
print "</body></html>\n";

http://IP/rwlay/test.pl     # 可開個瀏覽器看看 .pl  的 CGI 程式是否可於這個目錄執行

Setp 3. 

一切就緒後即可開個 Browse 進入 http://IP/relay/ 就可以開始進入安裝畫面填入一些基本資料:

database

Database Host:  localhost
Database Name:  relay
Table Prefix:   relay_
Database Username: relay   
Database Password: relay_password

administrator

Username: admin   
Password: xxxxx

Utilities

GhostScript: /usr/local/bin/gs   
ImageMagick: /usr/local/bin/convert

成功後即會顯示:

Database Connected....
done
Dropping tables if the exist...done
Creating tables
*relay_clients...
*relay_filesystem...
*relay_log...
*relay_permissions...
*relay_users...
done creating tables
generating random password key : 68afcdb14ed47c792aa336ac6510a801 ... done
creating first relay administrator...done
rootpath : /usr/local/www/data/relay
setting up first Virtual Directory: /usr/local/www/data/relay/filestore....done
setting up permissions....done
thumbnailed image types : image\/jpeg|image\/png|application\/pdf|application\/postscript|image\/x-photoshop|image\/
Config Files Created
Verifying Perl Installation... for the upload script @ http://IP/relay/upload.pl?test ...done...

※ 最後開個 Browse 到 http://IP/relay/ 用  admin / xxxx 登入即可使用美美又實用的檔案管理程式