Symlinked MAMP Folder Causing 403 Forbidden

懵懂的女人 提交于 2019-12-03 18:53:19
Marc B

There's also the FollowSymlinks option in Apache, which is generally disabled by default. You can enable it by doing

Options +FollowSymlinks

This is a bit hacky, but I had this problem before and while the solution didn't necessarily make a whole lot of sense, it worked for me:

  1. sudo su <username> to assume the user (eg, if your webserver is running as nobody, use nobody
  2. If #1 is a user whose shell is something similar to /sbin/nologin, temporarily use usermod to change their shell to something you can use, like /bin/bash, before sudoing as them
  3. Symlink as the user instead of root or whatever user this was done as previously
  4. Reset any changes made in #2

Since symlinks are by default 0777, any normal process has read access provided that the destination directory is also of sufficient permissions (0644 would be fine) - for some reason Apache gave me problems with that to. Once I created the link as the user in question, it worked like a charm. HTH!

Edit: also, this almost goes without saying, but I'm assuming you verified the link yourself via a terminal to make sure that the link is correct, right?

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!