2005
01.06
01.06
我使用过这些社会性形式的网站,感觉很好
- 网络书签
http://del.icio.us/ - 照片
http://www.flickr.com/ - RSS聚会器
http://www.bloglines.com/ - 地址簿
http://www.wealink.com/ - 个人目标记载
http://www.43things.com/ - 音乐
http://webjay.org/
还有什么可以推荐补充的?
Reloading
我使用过这些社会性形式的网站,感觉很好
还有什么可以推荐补充的?
mod_userdir可以让linux机器上的用户都有一个虚拟主机,缺省目录为~/public_html。配合suexec,其还可以使各个虚拟主机的cgi程序以各自的用户身份执行。
但是mod_userdir的形式为http://servername/~username/,而我们希望可以通过不同的域名访问不同的虚拟主机。
因此我试着使用mod_rewrite将http://domainname/的访问转换为userdir的形式。apache的配置脚本httpd.conf相关内容如下(假设用户目录为/home/username)
LogFormat "%{VHOST}e %V %h %l %u %t %r %>s %b %{Referer}i %{User-Agent}i" vhost
CustomLog logs/vhosts_access_log vhost
RewriteEngine on
#RewriteLog /usr/local/apache2/logs/rewrite_log
#RewriteLogLevel 9
RewriteMap lowercase int:tolower
RewriteMap vhost txt:/home/vhost.map
RewriteCond %{ENV:VHOST} ^$
RewriteCond %{REQUEST_URI} ^/~([^/]+)
RewriteCond ${lowercase:%1} ^(.+)$
RewriteRule ^.*$ $0 [PT,E=VHOST:%1]
RewriteCond %{ENV:VHOST} ^$
RewriteCond %{HTTP_HOST} !^$
RewriteCond ${lowercase:%{HTTP_HOST}} ^(.+)$
RewriteCond ${vhost:%1} ^(.+)$
RewriteRule ^.*$ $0 [E=VHOST:%1]
RewriteCond %{ENV:VHOST} !^$
RewriteCond %{REQUEST_URI} !^/~
RewriteCond %{REQUEST_URI} !^/cgi-bin/
RewriteRule ^/(.*)$ /~%{ENV:VHOST}/$1 [PT]
RewriteCond %{ENV:VHOST} !^$
RewriteCond %{REQUEST_URI} ^/cgi-bin/
RewriteRule ^/(.*)$ /~%{ENV:VHOST}/$1 [PT,T=application/x-httpd-cgi]
RewriteCond %{REQUEST_URI} ^/~[^/]+/cgi-bin/
RewriteRule ^.*$ $0 [PT,T=application/x-httpd-cgi]
Options Indexes FollowSymLinks Includes
AllowOverride All
Order allow,deny
Allow from all
Options ExecCGI
SetHandler cgi-script
AllowOverride All
Order allow,deny
Allow from all
vhost.map内容为
# domain name # username example.vhost example www.example.vhost example erning.vhost erning www.erning.vhost erning
这样,启动apache后,就可以通过 http://www.example.vhost/ 访问 http://servername/~example/。 (设置了hosts文件,使.vhost后缀的域名可以使用)