Apache mod_rewrite and mod_vhost_alias Virtual Hosts and %1
- by Matt Wall
I have put the main bits of my httpd.conf down below. I am using %1 to get the host field so I can dynamically add vhosts by just creating dns/folders.
One problem is I need to reference this:
HttpStreamingLiveEventPath "D:/FMSApps/%1"
HttpStreamingContentPath "D:/FMSApps/%1"
In Apache when I try say to do this:
http://test.domain.com/hds-vod/myfile.mp4.f4m it sees the %1 in the logs, and fails. Apache gives me this:
[error] mod_jithttp [403]: No access to D:/Content/%1/DefaultContent/eve.mp4
What I'm looking for is the D:/Content/%1/DefaultContent/eve.mp4 to become
D:/Content/test/DefaultContent/eve.mp4
Anyone have any useful resources / hints etc. to help me? Meanwhile my Google searching continues...!
Listen 80
ServerName main1.rtmphost.com
AccessFileName .htaccess
ServerSignature On
UseCanonicalName Off
HostnameLookups Off
Timeout 120
KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15
RewriteLogLevel 0
RewriteLog logs/rewrite.log
DocumentRoot D:/Content
LoadModule vhost_alias_module modules/mod_vhost_alias.so
VirtualDocumentRoot "D:/Content/%1"
RewriteEngine On
<Directory />
Options None
AllowOverride None
Order allow,deny
Allow from all
Satisfy all
</Directory>
<IfModule f4fhttp_module>
<Location /vod>
HttpStreamingEnabled true
HttpStreamingContentPath "D:/FMSApps/%1"
Options FollowSymLinks
</Location>
Redirect 301 /live/events/livepkgr/events /hds-live/livepkgr
<Location /hds-live>
HttpStreamingEnabled true
HttpStreamingLiveEventPath "D:/FMSApps/%1"
HttpStreamingContentPath "D:/FMSApps/%1"
HttpStreamingF4MMaxAge 2
HttpStreamingBootstrapMaxAge 2
HttpStreamingFragMaxAge -1
Options FollowSymLinks
</Location>
</IfModule>