NoseyParker 是早期 Linux 平台上知名的開源 FTP 搜尋引擎,透過定期掃描指定 FTP 站點建立本地索引資料庫,提供 Web 介面供用戶快速檢索檔案位置。雖然專案已停止維護,但其架構設計 (C 語言核心 + CGI 介面 + 定時掃描腳本) 仍具參考價值。本文記錄在紅旗 Linux 2.0 上從源碼編譯、配置、部署至 Apache CGI 的完整流程。
parkerd (守護進程) + NewData (掃描腳本) + cgi/cgistatus/cgiswitch (Web 查詢介面) + 索引檔案# 1. 下載源碼 (原站點已失效,可嘗試鏡像或封存)
wget https://web.archive.org/web/2003*/e.pku.edu.cn/parker.2000-09-06.*.tgz
tar xzf parker.*.tgz -C /root/parker
# 2. 編輯 Makefile 設定安裝根目錄
cd /root/parker/src
vi Makefile
# 修改: parker_home = /root/parker
# 3. 配置伺服器 IP (parker.h)
vi parker.h
# 修改 SERVER 和 PARKERSERVER 為本機實際 IP
# 4. 編譯
make config # 生成配置
make # 編譯核心程式與 CGI
make install # 安裝至 $parker_home/bin, $parker_home/html 等
vi /root/parker/etc/Parker_Hosts
# 每行一個 FTP 站點,支援 IP 或域名
ftp.ntu.edu.tw
ftp.nctu.edu.tw
192.168.1.100
# 可指定埠口: ftp.example.com:2121
# 複製編譯產生的 CGI 執行檔至 Apache cgi-bin 目錄
cp /root/parker/src/cgi /var/www/cgi-bin/
cp /root/parker/src/cgistatus /var/www/cgi-bin/
cp /root/parker/src/cgiswitch /var/www/cgi-bin/
chmod 755 /var/www/cgi-bin/cgi*
# Apache 配置確認 (httpd.conf)
ScriptAlias /cgi-bin/ "/var/www/cgi-bin/"
<Directory "/var/www/cgi-bin">
AllowOverride None
Options ExecCGI
Require all granted
</Directory>
# 複製 HTML 檔案至 DocumentRoot
cp -r /root/parker/HTML/* /var/www/html/parker/
# 訪問: https://server/parker/
# /etc/services 新增
parker 3000/tcp # NoseyParker daemon port
# /etc/inetd.conf (或 /etc/xinetd.d/parker)
parker stream tcp nowait root /root/parker/bin/parkerd parkerd
# 重啟 inetd/xinetd
service inetd restart # 或 xinetd
crontab -e
# 每日 02:00 執行全量掃描 (建議低峰期)
0 2 * * * cd /root && ./parker/bin/NewData >> /var/log/parker-newdata.log 2>&1
# 注意: 必須在 /root 目錄下執行 (腳本內部使用相對路徑)
/root/parker/html/ 下 HTML 檔案調整版面、配色、Logo/root/parker/src/cgi.c 重新編譯 (需 C/HTML 基礎)| 方案 | 語言/架構 | 特點 | 維護狀態 |
|---|---|---|---|
| NoseyParker | C + CGI | 輕量、無資料庫依賴、純檔案索引 | 停止維護 (2000年代) |
| FileBrowser | Go + Web UI | 單一二進位、支援 S3/雲端儲存、現代 UI、認證授權 | 活躍 |
| Alist | Go + Gin + React | 多儲存後端 (本地/雲盤/ftp/webdav)、WebDAV 掛載、搜尋 | 活躍 |
| Recoll | C++ + Xapian | 全文檢索、支援郵件/文檔/郵件、桌面/Web 介面 | 活躍 |
| Meilisearch/Typesense | Rust/C++ | 即時搜尋引擎、REST API、容錯、分面過濾 | 活躍 |