<VirtualHost *:80>
	ServerName www.example.com
	DocumentRoot /var/www/blogsum
	DirectoryIndex index.cgi

	Options +FollowSymlinks
	RewriteEngine On
	RewriteRule ^/rss.xml$ /index.cgi?rss=1 [PT,QSA]
	RewriteRule ^/rss2.xml$ /index.cgi?rss=2 [PT,QSA]
	RewriteRule ^/Page/([^/]+)$ /index.cgi?page=$1 [PT,QSA]
	RewriteRule ^/Tags/([^/]+)$ /index.cgi?search=$1 [PT,QSA]
	RewriteRule ^/([0-9]{4})/([0-9]{2})/([^/]+)$ /index.cgi?view=article&year=$1&month=$2&uri=$3 [PT,QSA]
	RewriteRule ^/([0-9]{4})/([0-9]{2})/?$ /index.cgi?view=article&year=$1&month=$2 [PT,QSA]
	RewriteRule ^/([0-9]{4})/?$ /index.cgi?view=article&year=$1 [PT,QSA]

	PerlModule Apache::PerlRun
	<LocationMatch ^/index.cgi>
		SetHandler perl-script
		PerlHandler Apache::PerlRun
		PerlRequire /var/www/blogsum/startup.pl
		Options ExecCGI
		Order deny,allow
		Allow from all
	</LocationMatch>
	<LocationMatch ^/admin.cgi>
		SetHandler perl-script
		PerlHandler Apache::PerlRun
		PerlRequire /var/www/blogsum/startup.pl
		Options ExecCGI
		Order deny,allow
		Allow from all
		AuthUserFile /var/www/conf/blogsum.htpasswd
		AuthName "Blogsum Admin - example.com"
		AuthType Basic
		<limit GET POST>
		require valid-user
		</limit>
	</LocationMatch>
	<LocationMatch ^/Blogsum/>
		SetHandler perl-script
		PerlHandler Apache::PerlRun
		Options -ExecCGI
		Order deny,allow
		Allow from all
	</LocationMatch>
	<LocationMatch ^/data/>
		Order deny,allow
		Deny from all
	</LocationMatch>
</VirtualHost>
