apache symlinks denied even with followsymlinks


Symbolic link not allowed or link target not accessible: /path/httpdocs/news.html

There are a few reasons that can cause this message and this is for people who have ruled out the basics, eg. your symlinks are enabled and the right permissions are applied (but read on to learn about ownership requirements above the directory in question).



So there are a few key things here that cause Apache not to follow symlinks:

  1. One directory up for your vhost eg if you have /var/www/html/vhost then html MUST be owned by the httpd/apache user who runs the process.  Otherwise even though access is technically allowed, it will be denied. (even if the files and dirs involved have the right ownership).
  2. Make sure you actually have Options +Symlinks in your vhost and/or htaccess
  3. Make sure the permissions are correct, you will need read and execute permissions on the file/dir of the symlink or you could get that message


The other solution is to use this option in your vhost or htaccess:


Options -SymLinksIfOwnerMatch

#but be warned the above doesn't seem to work sometimes

 


Tags:

apache, symlinks, followsymlinks, symbolic, accessible, httpdocs, html, ruled, basics, eg, enabled, permissions, applied, ownership, requirements, directory, vhost, var, www, httpd, user, dirs, htaccess, execute, dir, symlink, symlinksifownermatch, doesn,

Latest Articles

  • Linux Ubuntu Wifi Disabled Only Works When Laptop Plugged Into Wall AC Power
  • CentOS 6 impossible to compile a newer libguestfs
  • chroot
  • How To Get Started on Ubuntu with gpt-2 OpenAI Text Prediction
  • Remove cloud-init in your VM
  • QEMU-KVM KVM Command Line Practical Guide
  • Linux How To Change NIC Name to eth0 instead of enps33 or enp0s25
  • virt-resize: error: libguestfs error: could not create appliance through libvirt.
  • Asterisk Does Not Retry When Authentication Fails
  • Linux Debian Ubuntu How To Install PEPPER Faster and Latest Adobe Flash Player in Firefox
  • How To Speed Up Linux Ubuntu and Debian Based Computers By Improving CPU Performance and Changing the CPU Governor
  • Convert data or file to base64 on a single line
  • Linux Mint Ubuntu Debian radeon slow 2D performance issues radeon_dp_aux_transfer_native: 158 callbacks suppressed
  • mdadm: super0.90 cannot open /dev/sdb1: Device or resource busy mdadm: /dev/sdb1 is not suitable for this array.
  • How To Install NextCloud on Centos 7 and Centos 8
  • AH01630: client denied by server configuration:
  • ERROR: Could not find a version that satisfies the requirement PIL (from versions: none) ERROR: No matching distribution found for PIL
  • ZTE Camera Cannot Work unable to connect to camera. Camera has been disabled becaue of security policies or is being used by other apps
  • QEMU KVM how to boot off a physical CD/DVD/BDROM Drive
  • How To Install OpenProject on Centos 7 Step-by-Step Guide