阿帕奇虚拟主机

发布于 2024-10-10 10:13:37 字数 1321 浏览 8 评论 0原文

我已经被这个问题困扰了很长时间了:-(,基本上我的“别名”标签在我的 c:\xampp\apache\conf\virtual-hosts.conf 中不起作用。Url http://raghu.tkiportal 工作正常,但 http:// raghu.tkiportal/simplesaml 不存在。别名标记的目录结构存在于我的本地主机中(我检查过)

这是我对许多站点之一的设置

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>

你们看到我的设置有任何错误吗? 你们

非常感谢任何帮助...谢谢

RD

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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

酒废 2024-10-17 10:13:37

试试这个(因为 Windows 在路径名中使用 \ 而不是 /):

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

我以前没有在 Windows 上运行过 Apache,但认为路径中的 / 是问题所在。

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.

此岸叶落 2024-10-17 10:13:37

http://raghu.tkiportal/extension/feide/lib/simplesaml/www 工作?

然后读取您的配置,恐怕最后的重写规则优先于您的别名(或在之后应用)。因此,您的 /simplesaml/index.[html.php] 被重定向到 /index.php

重写规则包含例外,请尝试在例外列表中添加 simplesaml:

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

要调试此内容,您可以激活 RewriteLogLevel 9 和重写日志 /absolute/path /to/debug.log 并检查 /simplesaml 上的调用是否已被 mod_rewrite 重写

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

晒暮凉 2024-10-17 10:13:37

[已解决] 我必须包含一个 RewriteCond...说如果它是 simplesaml 那么不应用最后的重写规则。感谢 regilero 关于 RewriteRule 的提示。

[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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文