简体   繁体   English

Apache虚拟主机

[英]Apache virtual host

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) 我现在已经对此感到震惊了:-( ,,基本上我的“ Alias”标签在我的c:\\ xampp \\ apache \\ conf \\ virtual-hosts.conf中不起作用。网址http://raghu.tkiportal可以正常工作可以,但是http://raghu.tkiportal/simplesaml不会。Alias标签的目录结构存在于我的本地主机中(我已选中)

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. 相同的设置适用于Linux机器。

Any help would be very much appreciated...Thanks guys 任何帮助将不胜感激...谢谢大家

RD RD

Try this (as Windows uses \\ instead of / in path names): 尝试以下操作(因为Windows在路径名中使用\\而不是/):

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. 我以前没有在Windows上运行Apache,但认为路径中的/是问题。

is http://raghu.tkiportal/extension/feide/lib/simplesaml/www working? http://raghu.tkiportal/extension/feide/lib/simplesaml/www是否有效?

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 因此,您的/simplesaml/index.[html.php]被重定向到/index.php

The rewrite rule contains exceptions, try to add simplesaml in the exceptions listing: 重写规则包含异常,请尝试在异常列表中添加simplesaml:

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 要进行调试,您可以激活RewriteLogLevel 9和一个Rewrite Log /absolute/path/to/debug.log并检查您对/ simplesaml的调用是否已被mod_rewrite重写

[SOLVED] I had to include a RewriteCond...saying if its simplesaml then don't apply the the last rewrite rule. [已解决]我必须包括一个RewriteCond ...说明它的simplesaml是否不应用最后的重写规则。 thanks for the tip regilero regarding the RewriteRule. 感谢您提供有关RewriteRule的提示regilero。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM