Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5939149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:47:08+00:00 2026-05-22T15:47:08+00:00

Running Ubuntu 10.04 on Linode, RVM, Rails 3, Apache with Passenger module, carrierwave and

  • 0

Running Ubuntu 10.04 on Linode, RVM, Rails 3, Apache with Passenger module, carrierwave and mini-magick

I get:

Rails Error: Unable to access log file. Please ensure that /srv/www/mysite.com/testapp/log/production.log exists and is chmod 0666. The log level has been raised to WARN and the output directed to STDERR until the problem is fixed.

and Errno::EACCES (Permission denied /srv/www/mysite.com/testapp/public/uploads/tmp/20110517-1707-2938-6455):

I ran chmod -R root:root /srv/www/mysite.com/testapp

Then: chmod -R www-data:www-data /srv/www/mysite.com/testapp & chmod -R www-data:www-data /srv/www/mysite.com/testapp/public/uploads

Since the only 2 directories that should be writable is the log files and uploads directory I tried to secure the rest. Are there any other folders / files that I need to make writable?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:47:09+00:00Added an answer on May 22, 2026 at 3:47 pm

    Permissions on web sites is a little strange: on the one hand, the content needs to be readable by the webserver and FastCGI or Passenger or whatever executes the (in this case, Ruby) code. On the other hand, if the webserver user owns the files, then a hacked webserver or (more likely 🙂 your code could modify the executable files and static files that are your website. It happens too often.

    If the content of the website is owned by some other user, not writable by the web server software, then the website can not be overwritten by attackers. (Of course, you have a few open sockets to a database connection; all the database backed data can be corrupted by attackers. Also, any directory where you allow uploads could be corrupted by attackers. But the goal is to reduce the privileges of the software as far as reasonable.)

    So, all that said, on to your specific question; your webserver software runs as www-data, and it makes sense for your log files and upload directory to be owned by www-data:

    mkdir -p /srv/www/mysite.com/testapp/log/   # might not exist yet
    chown -R pcasa:pcasa /srv/www/mysite.com/   # or some other user
    chmod 755 /srv/www/mysite.com
    chmod 755 /srv/www/mysite.com/testapp/
    # populate the app directory with your files, if you haven't done so already
    chown -R www-data:www-data /srv/www/mysite.com/testapp/log
    chmod 755 /srv/www/mysite.com/testapp/log   # see notes
    chmod 644 /srv/www/mysite.com/testapp/log/* # see notes
    

    I made the assumption that all users on your system can read the log. This might not be true. Use 700 in place of 755 and 600 in place of 644 if you don’t want all system users to read the log files.

    Next, for your uploads directory:

    mkdir -p /srv/www/mysite.com/testapp/public/uploads/tmp  # might not exist yet
    chown -R www-data:www-data /srv/www/mysite.com/testapp/public/uploads
    chmod 755 /srv/www/mysite.com/testapp/public/uploads
    chmod 755 /srv/www/mysite.com/testapp/public/uploads/tmp
    

    Again, I’ve made the assumption that all users on your system can be able to see all the uploaded content. Use 700 in place of 755 if you just want the webserver software to be able to read the files.

    These are simple guidelines that should work; you can get more complicated if you want to keep the website software and content shared only between the user that owns the website and the user that runs the website, by running the webserver with a supplementary group (see newgrp(1) and group(5) manpages for details) and giving the files the same group owner, and using the group permission bits (the middle octal number: 750 vs 700). It’s complicated enough that unless you’ve got a good reason, it’s probably not worth going down this route. (Definitely worth doing once on a development machine somewhere, just so you’re familiar enough with it that you can use it in the future. 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running Ubuntu 10, RVM, Passenger and apache2. Trying to configure and get Redmine running.
Running ubuntu 9.04 jaunty. When I run make I get the following error: Python
I am running Ubuntu 10.04 Lucid, Ruby 1.9.3p125, Ruby on Rails 3.2.2 and RVM
I'm running Ubuntu 11.10 and installed Ruby 1.9 like this: $ sudo apt-get install
I am running Ubuntu 11.04 with Apache/MySQL/PHP5 installed. I completely followed the installation process
I'm running Ubuntu 11.10 server and successfully installed Phusion Passenger. I'm getting the following
I'm running Ubuntu 11.10 and have run sudo apt-get install jenkins to install Jenkins
I'm running Ubuntu 11.10 and have installed rvm using the standard instructions listed here
I'm running Ubuntu 8.04 and I recently received the following error when visiting a
I am running Ubuntu 10.04 Lucid and I was probably wrong to uninstall RVM

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.