Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SetEnv Apache (Rewrite, alias, vhost)

Status
Not open for further replies.

mcvdmvs

Technical User
Sep 18, 2000
172
NL
I'm struggeling with configuring Apache 1.3. I want to set an environment variable and set logfiles to a dynamic name. I rewrite a part of the url, get the prefix (which is the name of the website i want to load) and set the document root with a rewrite rule.

Code:
<VirtualHost *>
	# Rewrite
	RewriteEngine on
	RewriteOptions MaxRedirects=10
	RewriteLog /var/log/[URL unfurl="true"]www/rewrite.log[/URL]
	RewriteLogLevel 0

	RewriteCond %{HTTP_HOST} ^(.+)\.office\.company\.nl$
	RewriteRule ^(.+) %{HTTP_HOST}$1 [C]
	RewriteRule %{DOCUMENT_ROOT} /project/$1/trunk/htdocs/

	Port              80 
	ServerAdmin       webmaster@company.nl
	ServerName        $domain

	DocumentRoot      /project/$domain/trunk/htdocs/
	SetEnv CONFIG_DIR /project/$domain/trunk/config/

	# Loggin
	ErrorLog          /var/log/[URL unfurl="true"]www/$domain.error[/URL]
	TransferLog       /var/log/[URL unfurl="true"]www/$domain.access[/URL]

	Alias /uploaded/  /project/$domain/uploaded/

	# php
	php_admin_flag magic_quotes_gpc off
	php_admin_flag register_globals off
</VirtualHost>

The above is ofcourse not working, but it gives you the idea of what im trying to do. The main problem is the loggin to the right errorfile and the setenv.

I understand that setenv is called after all the apache forks/redirects an rewrite, so setenv will never help me with my problem. The question is, how can i solve this puzzle (which mod should i use to do this trick, if possilbe)

mcvdmvs
&quot;It never hurts to help&quot; -- Eek the Cat
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top