mercredi 9 avril 2014

Hôte virtuel Apache - Stack Overflow


i have been struck on this for a looooong time now :-(, Basically my "Alias" tag is not working in my c:\xampp\apache\conf\virtual-hosts.conf. Url http://raghu.tkiportal works OK but http://raghu.tkiportal/simplesaml DOES NOT. The directory structure for Alias tag exists in my localhost (i checked)


This is my setting for one of many sites


NameVirtualHost *:80
<VirtualHost *:80>
AcceptPathInfo On
ServerName raghu.tkiportal
Alias /simplesaml C:/xampp/htdocs/tki_portal4.2/extension/feide/lib/simplesaml/www
DocumentRoot C:/xampp/htdocs/tki_portal4.2

<Directory C:/xampp/htdocs/tki_portal4.2>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>



LogLevel debug
ErrorLog C:/xampp/apache/logs/raghu_tki_portal_error.log
CustomLog C:/xampp/apache/logs/raghu_tki_portal_access.log combined
ServerSignature On
RewriteEngine On


RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_image_tki_portal.php [L]

RewriteRule !(^/design|^/var|.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf|mov|html|xml|xsl|htc)$ /index.php

</VirtualHost>

Do you guys see any fault with my settings? The same setting works on linux box.


Any help would be very much appreciated...Thanks guys


RD




Try this (as Windows uses \ instead of / in path names):


Alias /simplesaml C:\xampp\htdocs\tki_portal4.2\extension\feide\lib\simplesaml\www
DocumentRoot C:\xampp\htdocs\tki_portal4.2

I haven't run Apache on Windows before but think that the / in the paths are the issue.




is http://raghu.tkiportal/extension/feide/lib/simplesaml/www working?


Then reading your configuration I'm afraid the last rewrite rule takes precedence on your alias (or applies just after). So your /simplesaml/index.[html.php] is redirected on /index.php


The rewrite rule contains exceptions, try to add simplesaml in the exceptions listing:


RewriteRule !(^/simplesaml|^/design|^/var|.* ...

To debug this you could activate RewriteLogLevel 9 and a Rewrite Log /absolute/path/to/debug.log and check that you calls on /simplesaml are rewritten by mod_rewrite




[SOLVED] I had to include a RewriteCond...saying if its simplesaml then don't apply the the last rewrite rule. thanks for the tip regilero regarding the RewriteRule.



i have been struck on this for a looooong time now :-(, Basically my "Alias" tag is not working in my c:\xampp\apache\conf\virtual-hosts.conf. Url http://raghu.tkiportal works OK but http://raghu.tkiportal/simplesaml DOES NOT. The directory structure for Alias tag exists in my localhost (i checked)


This is my setting for one of many sites


NameVirtualHost *:80
<VirtualHost *:80>
AcceptPathInfo On
ServerName raghu.tkiportal
Alias /simplesaml C:/xampp/htdocs/tki_portal4.2/extension/feide/lib/simplesaml/www
DocumentRoot C:/xampp/htdocs/tki_portal4.2

<Directory C:/xampp/htdocs/tki_portal4.2>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>



LogLevel debug
ErrorLog C:/xampp/apache/logs/raghu_tki_portal_error.log
CustomLog C:/xampp/apache/logs/raghu_tki_portal_access.log combined
ServerSignature On
RewriteEngine On


RewriteRule ^/var/([^/]+/)?storage/images(-versioned)?/.* /index_image_tki_portal.php [L]

RewriteRule !(^/design|^/var|.*/storage|^/var/storage|^/var/.*/cache|^/var/cache|^/extension/.*/design|^/kernel/setup/packages|^/packages|^/share/icons).*\.(gif|css|jpg|png|jar|js|ico|pdf|swf|mov|html|xml|xsl|htc)$ /index.php

</VirtualHost>

Do you guys see any fault with my settings? The same setting works on linux box.


Any help would be very much appreciated...Thanks guys


RD



Try this (as Windows uses \ instead of / in path names):


Alias /simplesaml C:\xampp\htdocs\tki_portal4.2\extension\feide\lib\simplesaml\www
DocumentRoot C:\xampp\htdocs\tki_portal4.2

I haven't run Apache on Windows before but think that the / in the paths are the issue.



is http://raghu.tkiportal/extension/feide/lib/simplesaml/www working?


Then reading your configuration I'm afraid the last rewrite rule takes precedence on your alias (or applies just after). So your /simplesaml/index.[html.php] is redirected on /index.php


The rewrite rule contains exceptions, try to add simplesaml in the exceptions listing:


RewriteRule !(^/simplesaml|^/design|^/var|.* ...

To debug this you could activate RewriteLogLevel 9 and a Rewrite Log /absolute/path/to/debug.log and check that you calls on /simplesaml are rewritten by mod_rewrite



[SOLVED] I had to include a RewriteCond...saying if its simplesaml then don't apply the the last rewrite rule. thanks for the tip regilero regarding the RewriteRule.


0 commentaires:

Enregistrer un commentaire