如何在www目录中创建符号链接?

时间:2022-06-21 19:34:21

I'm not even sure this is the right way to do this, but I am looking for some advice. I am developing on a Mac, but using VMWare to run this project in Windows.

我甚至不确定这是正确的方法,但我正在寻找一些建议。我正在Mac上开发,但使用VMWare在Windows中运行此项目。

I am using WAMPserver 2.2A. My directories look like this:

我正在使用WAMPserver 2.2A。我的目录看起来像这样:

C:\Users\John Doe\Development\project-web\
C:\wamp\www\

What I would like, is to develop my project in project-web, but have a symlink in www so I can run it in the browser with apache. This is what I tried:

我想要的是在project-web中开发我的项目,但在www中有一个符号链接,所以我可以在浏览器中用apache运行它。这是我试过的:

mklink project "C:\Users\John Doe\Development\project-web\"

I ran into some permissions errors when trying to approach it this way. I feel like this would be better than storing the project in \www\ but I might be wrong.

尝试以这种方式接近时遇到了一些权限错误。我觉得这比将项目存储在\ www \更好,但我可能错了。

Any advice would be great!

任何建议都会很棒!

1 个解决方案

#1


3  

Apache generally doesn't follow symlinks by default, as they can be trivially used to break out of the document root. I'd suggest looking into using an Apache Alias instead to create a virtual Apache folder that maps to your development directory

Apache默认情况下通常不遵循符号链接,因为它们可以简单地用于打破文档根目录。我建议使用Apache Alias来创建一个映射到开发目录的虚拟Apache文件夹

#1


3  

Apache generally doesn't follow symlinks by default, as they can be trivially used to break out of the document root. I'd suggest looking into using an Apache Alias instead to create a virtual Apache folder that maps to your development directory

Apache默认情况下通常不遵循符号链接,因为它们可以简单地用于打破文档根目录。我建议使用Apache Alias来创建一个映射到开发目录的虚拟Apache文件夹