Windows 在虚拟主机内创建别名目录
在问这个问题之前,我检查了、、和。我想我的搜索能力很弱 我正在使用版本Windows 在虚拟主机内创建别名目录,windows,apache2,alias,virtualhost,wampserver,Windows,Apache2,Alias,Virtualhost,Wampserver,在问这个问题之前,我检查了、、和。我想我的搜索能力很弱 我正在使用版本2.2e。我需要一个虚拟主机内的虚拟路径。让我说说我的两位主持人 主虚拟主机(本地主机) 但是当我试图访问http://apps.ptrl/blog,我收到一个错误403禁止页面 我做的对吗?如果您需要查看访问日志和错误日志,请参阅以下内容: # Access Log 127.0.0.1 - - [14/Oct/2012:09:53:11 +0530] "GET /blog HTTP/1.1" 403 206 127.0.0
2.2e
。我需要一个虚拟主机内的虚拟路径。让我说说我的两位主持人
主虚拟主机(本地主机)
但是当我试图访问http://apps.ptrl/blog
,我收到一个错误403禁止
页面
我做的对吗?如果您需要查看访问日志和错误日志,请参阅以下内容:
# Access Log
127.0.0.1 - - [14/Oct/2012:09:53:11 +0530] "GET /blog HTTP/1.1" 403 206
127.0.0.1 - - [14/Oct/2012:09:53:11 +0530] "GET /favicon.ico HTTP/1.1" 404 209
127.0.0.1 - - [14/Oct/2012:09:53:53 +0530] "GET / HTTP/1.1" 200 6935
127.0.0.1 - - [14/Oct/2012:09:53:53 +0530] "GET /app/blog/thumb.png HTTP/1.1" 404 216
# Error Log
[Sun Oct 14 09:53:11 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Wamp/vhosts/ptrl/praveen-kumar/blog
[Sun Oct 14 09:53:11 2012] [error] [client 127.0.0.1] File does not exist: C:/Wamp/vhosts/ptrl/apps/favicon.ico
[Sun Oct 14 09:53:53 2012] [error] [client 127.0.0.1] File does not exist: C:/Wamp/vhosts/ptrl/apps/app/blog, referer: http://apps.ptrl/
急切地等待帮助。我准备提供更多的信息,如果需要的话
更新#1:根据以下人员给出的说明更改虚拟主机声明:
ServerName apps.ptrl
DocumentRoot“C:/Wamp/vhosts/ptrl/apps”
ErrorLog“logs/apps ptrl error.log”
CustomLog“logs/apps ptrl access.log”通用
#博客的别名!
别名/blog“C:/Wamp/vhosts/ptrl/praveen kumar/blog”
通融
命令允许,拒绝
允许超越所有
通融
命令允许,拒绝
允许超越所有
DirectoryIndex.html index.htm index.php
更新#2:另一个问题:
我可以访问该网站。物理链接现在正在工作。i、 例如,我能够打开
http://apps.ptrl/blog/index.php
但不是http://apps.ptrl/blog/view-1.ptf
,将其转换为http://apps.ptrl/blog/index.php?page=view&id=1
。有什么解决方案吗?注意,如果您要创建一个到外部目录的目录,您可能需要明确允许访问目标目录:
<VirtualHost *:80>
ServerName apps.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/apps"
ErrorLog "logs/apps-ptrl-error.log"
CustomLog "logs/apps-ptrl-access.log" common
# Puts here, before Directory directive :)
Alias /blog "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
<Directory "C:/Wamp/vhosts/ptrl/apps">
allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>
ServerName apps.ptrl
DocumentRoot“C:/Wamp/vhosts/ptrl/apps”
ErrorLog“logs/apps ptrl error.log”
CustomLog“logs/apps ptrl access.log”通用
#放在此处,在目录指令之前:)
别名/blog“C:/Wamp/vhosts/ptrl/praveen kumar/blog”
通融
命令允许,拒绝
允许超越所有
还要注意,URL路径(第一个别名部分)即使在不区分大小写的文件系统上也是区分大小写的
另外,检查C:/Wamp/vhosts/ptrl/praveen kumar/blog
目录中的权限
参考
.htaccess
不起作用。它说找不到404
。你能帮忙吗?
<VirtualHost *:80>
ServerName blog.praveen-kumar.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
ErrorLog "logs/praveen-kumar-ptrl-error.log"
CustomLog "logs/praveen-kumar-ptrl-access.log" common
<Directory "C:/Wamp/vhosts/ptrl/praveen-kumar/blog">
allow from all
order allow,deny
AllowOverride All
</Directory>
DirectoryIndex index.html index.htm index.php
</VirtualHost>
<VirtualHost *:80>
ServerName apps.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/apps"
ErrorLog "logs/apps-ptrl-error.log"
CustomLog "logs/apps-ptrl-access.log" common
<Directory "C:/Wamp/vhosts/ptrl/apps">
allow from all
order allow,deny
AllowOverride All
</Directory>
DirectoryIndex index.html index.htm index.php
# The alias to the blog!
Alias /blog "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
<Directory "C:/Wamp/vhosts/ptrl/praveen-kumar/blog">
allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>
# Access Log
127.0.0.1 - - [14/Oct/2012:09:53:11 +0530] "GET /blog HTTP/1.1" 403 206
127.0.0.1 - - [14/Oct/2012:09:53:11 +0530] "GET /favicon.ico HTTP/1.1" 404 209
127.0.0.1 - - [14/Oct/2012:09:53:53 +0530] "GET / HTTP/1.1" 200 6935
127.0.0.1 - - [14/Oct/2012:09:53:53 +0530] "GET /app/blog/thumb.png HTTP/1.1" 404 216
# Error Log
[Sun Oct 14 09:53:11 2012] [error] [client 127.0.0.1] client denied by server configuration: C:/Wamp/vhosts/ptrl/praveen-kumar/blog
[Sun Oct 14 09:53:11 2012] [error] [client 127.0.0.1] File does not exist: C:/Wamp/vhosts/ptrl/apps/favicon.ico
[Sun Oct 14 09:53:53 2012] [error] [client 127.0.0.1] File does not exist: C:/Wamp/vhosts/ptrl/apps/app/blog, referer: http://apps.ptrl/
<VirtualHost *:80>
ServerName apps.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/apps"
ErrorLog "logs/apps-ptrl-error.log"
CustomLog "logs/apps-ptrl-access.log" common
# The alias to the blog!
Alias /blog "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
<Directory "C:/Wamp/vhosts/ptrl/praveen-kumar/blog">
allow from all
order allow,deny
AllowOverride All
</Directory>
<Directory "C:/Wamp/vhosts/ptrl/apps">
allow from all
order allow,deny
AllowOverride All
</Directory>
DirectoryIndex index.html index.htm index.php
</VirtualHost>
<VirtualHost *:80>
ServerName apps.ptrl
DocumentRoot "C:/Wamp/vhosts/ptrl/apps"
ErrorLog "logs/apps-ptrl-error.log"
CustomLog "logs/apps-ptrl-access.log" common
# Puts here, before Directory directive :)
Alias /blog "C:/Wamp/vhosts/ptrl/praveen-kumar/blog"
<Directory "C:/Wamp/vhosts/ptrl/apps">
allow from all
order allow,deny
AllowOverride All
</Directory>
</VirtualHost>