简体   繁体   English

Apache中的符号链接无法正常工作

[英]Symbolic Links in Apache not working as expected

I'm trying to get a symbolic link working in Apache on Mac OS X (Mountain Lion). 我正在尝试使符号链接在Mac OS X(Mountain Lion)上的Apache中工作。

When I go to the folder containing the link in my browser, Apache sees the link as a file rather than a folder. 当我在浏览器中转到包含链接的文件夹时,Apache会将链接视为文件而不是文件夹。 If I click it, my browser attempts to download the link as a file. 如果单击它,我的浏览器将尝试将链接下载为文件。

Additionally, if I go to actual link in the browser, I get a message informing me I am not authorised. 另外,如果我转到浏览器中的实际链接,则会收到一条消息,通知我未获得授权。

I made the link in terminal using 'ln -s'. 我使用'ln -s'在终端中建立了链接。

Can anyone help me, this is very frustrating. 谁能帮我,这很令人沮丧。

Context: 内容:

Developing a Wordpress theme, want the theme to be in a different directory than the usual Wordpress themes directory. 开发Wordpress主题时,希望该主题与通常的Wordpress主题目录位于不同的目录中。 Have seen it done in this way before, however I've been unsuccessful in achieving the same result. 以前已经以这种方式看到过它,但是我一直未能获得相同的结果。

There are two possibilities here. 这里有两种可能性。

Firstly apache may not have permissions to read and execute the directory you have symlinked. 首先,apache可能没有权限读取和执行已符号链接的目录。

or alternatively it could be that your Apache is not configured to follow symbolic links 或者可能是您的Apache没有配置为遵循符号链接

If your .htaccess file is permitted to override options then you can try adding this to your .htaccess file. 如果允许您的.htaccess文件覆盖选项,则可以尝试将其添加到.htaccess文件中。

Options +FollowSymLinks

Otherwise you will need to change your Apache config file. 否则,您将需要更改您的Apache配置文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM