Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 在虚拟主机内创建别名目录_Windows_Apache2_Alias_Virtualhost_Wampserver - Fatal编程技术网

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
目录中的权限

参考


有关更多详细信息,请参阅Apache指南,@felipsmartines请参阅更新的答案。我也重新启动了Apache2服务器。不走运,说真的,出了什么问题。我以前也这么做过,但没有成功!不管怎样,你是个魔术师!!!:P@PraveenKumar那么它成功了?对不起,我的英语糟透了。是的,它奏效了。但我有个问题。请看,我可以访问该网站,但
.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>