Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Basically, we have Dropbox running on a server to keep some files synced.

It works nicely, except when Dropbox has to write the files itself. It keeps writing them as root, and my webserver cannot serve these files later on.

The current fix is a manual chown -R apache:apache /var/www/html, but it's unnecesary and cumbersome, with the server users having to call me to fix it each time they get forbidden.

So, the question is, how do I make dropbox write files as user/group apache?

Software: CentOS 5.6, daemonized dropbox server, apache

share|improve this question

closed as not constructive by Bart De Vos, Dan, RobM, Kenny Rasschaert, pauska Apr 25 '12 at 10:51

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.If this question can be reworded to fit the rules in the help center, please edit the question.

1 Answer 1

Well, first off, using Dropbox as a deployment-platform is a bad idea. There are more suited tools to do this, I'm thinking about rsync and/or git...

Nevertheless, you probably installed DropBox with the root-user. Don't do this, install it as the apache-user. The deamon will run under the apache-user and will create files that apache has rights to read/write.

Open up the deamon-script, you will see it's just running dropbox.py. Edit this to run under apache and not under root.

But, and I can't stress this enough, you should be on the lookout for better alternatives.

share|improve this answer
4  
+1 for both "Don't install it as root" and "Find something better" -- rsync, git, puppet, chef, radmind, etc… –  voretaq7 Apr 25 '12 at 8:42
2  
There is a better way to achieve what you need: Don't use DropBox on a server. Try Capistrano or Fabric if you need a deployment tool. –  Kenny Rasschaert Apr 25 '12 at 9:16
4  
@ChristianSciberras Wow - you need to learn how to deal with people who are trying to help you. That's a pretty bad attitude you have there, bud. –  Dan Apr 25 '12 at 9:20
3  
@ChristianSciberras If it matches all your needs, then you wouldn't be posting this question, would you? –  Dan Apr 25 '12 at 9:23
3  
Just because something meets your needs does not mean you should use it. I could use a tank to drive to the shops but, as much as I'd like to, it's not the best idea, is it? "Best practices" and all that. –  tombull89 Apr 25 '12 at 9:25

Not the answer you're looking for? Browse other questions tagged or ask your own question.