[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Apache mod_rewrite



On Wed, Aug 30, 2000 at 10:18:14PM +0000, Jaume Teixi wrote:
> I need to do the following in order to access stats for each based
> virtual host
> 
> when typing url   www.virtualhost1.com/stats  or
> www.virtualhost99.com/stats
> server page located under  /var/reports/virtualhost1   or
> /var/reports/virtualhost99

you're probably best off using a mod_perl/Apache::Registry
handler -- but short of that...

to avoid some repetition, enable the mod_macro facility
[ http://www.cri.ensmp.fr/~coelho/mod_macro/ ] and then:

# ls -F /var/www
host1/  host98/
host2/  host99/
host3/  reports/
...
# ls -F /var/www/reports
host1/  host98/
host2/  host99/
...

# pager /etc/apache/httpd.conf
...
<Macro Virtual $h $p>
	<VirtualHost 192.168.12.34>
	ServerAdmin webmaster@$h.com
	DocumentRoot $p/$h
	ServerName $h.com
	ServerAlias *$h.com
	DirectoryIndex index.html index.cgi

	<Directory $p/$h>
		AllowOverride None
		order allow,deny
		allow from all
	</Directory>
	Alias $p/reports/$h
	<Directory $p/reports/$h>
		Options -Indexes +FollowSymLinks
		DirectoryIndex index.html index.cgi
	</Directory>
	</VirtualHost>
</Macro>
...
Use Virtual "host1" "/var/www"
...
Use Virtual "host99" "/var/www"
...


also see apache (modperl) configuration tips at
http://perl.apache.org/guide/config.html#Configuring_Apache_mod_perl_wi



Reply to: