a simple search engine to help find file in ftp directories
由于采用python cgi脚本来实现搜索部分的功能,所以需要配置apache的cgi。
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>
修改为:
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
AddHandler cgi-script .py
AddHandler default-handler .html .htm
</Directory>
另外还需要注意配置index的config.py,以及search的cgiConfig.py文件。
I always get WD=-1 or the message No space left on device (ENOSPC) whenever I try to add a new watch
You must have reached your quota of watches, type sysctl -n fs.inotify.max_user_watches to read your current limit and type sysctl -n -w fs.inotify.max_user_watches=16384 to modify (increase) it.
2012-12-04: 之前的代码中是使用配置文件中一个硬编码的外网ip来生成搜索结果中的ftp下载链接的。但某些情况下,在内网只能使用服务器的内网ip(比如192.168.1.254)来访问ftp搜索服务,那么这时生成的下载超链接是无效的,需要用户手动修改下载链接中的服务器域名或者外网ip。新代码中使用os.environ['SERVER_NAME']环境变量来根据用户请求url中的域名或者服务器ip部分来生成搜索结果中的下载超链接。
2012-12-18: 在搜索结果页面增加搜索框,这样如果用户对搜索结果不满意,就可以直接在搜索结果页面的搜索框内输入关键字再次搜索,而不用回到搜索主页面。另外美化了一下搜索结果页面。