WebFaction
Community site: login faq

I'm running a PHP app that pulls content from a /content/ directory, and also includes links to files within that directory in the HTML output. To simplify the content publishing process, I installed Dropbox on my account, and then created a symlink for that /content/ folder to the Dropbox folder (which exists outside of the webapps folder). However, while PHP can read from the symlink just fine, Apache refuses to serve files from within /content/ - so any image files within it simply break, getting forbidden errors.

I've tried turning on FollowSymlinks in .htaccess, to no avail. Is it hardcoded from httpd.conf, and is there an alternative I can use? Thanks!

asked 26 Oct '12, 08:09

rirez
1313
accept rate: 0%


One thing you can try is creating a "Symbolic link" app from the control panel that points to your Dropbox folder, and then map this app to /content from the Websites section in the control panel.

You should also make sure that Nginx and Apache are allowed access to your Dropbox folder. You can ensure that using "setfacl", for example:

setfacl -m u:nginx:r-x /path/to/Dropbox
setfacl -m u:apache:r-x /path/to/Dropbox

If this fails, feel free to open a ticket, so we can take a look at your setup.

permanent link

answered 26 Oct '12, 08:52

todork
1.2k5
accept rate: 34%

edited 29 Oct '12, 12:14

seanf
12.2k42136

The setfacl command worked, thank you! Everything seems to be working fine now.

To note, I had a plan B: upload the static files to a separate folder, and use nginx on a full static server on a subdomain, symlinking the folder there. Nginx seems to ignore the issue entirely and can serve things just fine.

(26 Oct '12, 11:06) rirez

I'm having the same issue, but the setfacl command didn't work for me. Do I have to restart the server or something like that?

Thanks in advance!

(10 Feb '13, 00:05) jiserra

No, you shouldn't need to restart the server. If you're seeing a Forbidden message, it could be that your symlinked directory exists outside of your home directory; that's not permitted for security reasons.

(10 Feb '13, 00:10) ryans ♦♦

Sorry, it was my mistake with a script, it has nothing to do with that issue, all is working perfect now!

(10 Feb '13, 00:25) jiserra

nice, I had the exaat same issue and granting the permissions made it for me too. Didn't need to do the symlink and mapping stuff. Thanks!

(06 Dec '13, 14:38) mrossw
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×226
×1

question asked: 26 Oct '12, 08:09

question was seen: 3,994 times

last updated: 06 Dec '13, 14:38

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM