apache 2.2:如何在 RootDirectory 内设置 VirtualHost?

apache 2.2:如何在 RootDirectory 内设置 VirtualHost?

我想在 RootDirectory 中设置 VirtualHost。例如,

我的项目C:/myproject

我想要访问http://localhost/myproject

编辑:

我已经在里面创建了一个别名httpd-vhosts.conf,但是我没有权限。

<VirtualHost *:80>
    DocumentRoot "C:/apache-2.2/htdocs"
    ServerName localhost
    Alias /test "D:\arbol\documentos\test"  
</VirtualHost>

下面的代码是授予权限的正确方法吗?

<VirtualHost *:80>
    DocumentRoot "C:/apache-2.2/htdocs"
    ServerName localhost
    Alias /test "D:\arbol\documentos\test"  

      <Directory "D:\arbol\documentos\test">        
        allow from all
        order allow,deny
        AllowOverride All
      </Directory>

</VirtualHost>

答案1

尝试这个:

  <Directory "D:\arbol\documentos\test">        
         Options +Indexes +FollowSymLinks +MultiViews
         AllowOverride All
         Order allow,deny
         allow from all
         Require all granted
  </Directory>             

相关内容