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

  • SEARCH
  • Home
  • 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 8360489
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:28:46+00:00 2026-06-09T11:28:46+00:00

I have a CodeIgniter app running in production on Apache 2.2 with PHP 5.3

  • 0

I have a CodeIgniter app running in production on Apache 2.2 with PHP 5.3 on Ubuntu 11.10. I am also running PHP5-APC, if that matters. So the app runs as www-data:www-data per the default Apache2 install.

I am trying to figure out what to set my file permission to. Many threads on SO seem to prefer 755 for directories and 644 for files. There is one directory that must allow files to be uploaded to it.

Currently my deployment script does something like this:

  • wipe old site
  • copy new site over
  • chmod -R 000 on the new site
  • chmod all directories to 500
  • chmod all files to 400
  • chmod 700 on the upload directory

Everything seems to work fine. I can upload files and so on.. so, I don’t understand why people suggest 644 for files – I have a config file that has passwords and API keys – why would I want ‘others’ to have read-access to it?

What am I misunderstanding?

  • 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-06-09T11:28:48+00:00Added an answer on June 9, 2026 at 11:28 am

    Well, mainly the 644 permission is meant for when you have /var/www/site1.com with different user and group set then www-data, because then the 644 would allow other groups and users to read from that file, but will allow to read and write the owner of the file.

    As by default the user that uploads files and runs apache’s processes is www-data then I honestly think that if it works for you and you have no issues, it’s great because means a little more security.

    Update

    Just a small security issue, is that www-data has become a very common user and group for http services to run their processes. I would much recommend that each site/app have their own user and group.

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

Sidebar

Related Questions

I currently have a CodeIgniter web app running on Ubuntu with nginx. I just
I have a PHP app built on Codeigniter 1.7.2, currently in production and live,
i have written a small codeigniter test app that is currently running on my
I have an app (CodeIgniter) that uses the <?=$variable?> syntax instead of <?php echo
I'm working on upgrading a Codeigniter app I have running on 1.7.2 to 2.0.3
I'm using CodeIgniter (a PHP framework) to build an app, and I have an
I have a codeigniter code that is working on local Apache installation. But it
I have an Codeigniter app (using version 2.1.0) that is writing a transaction to
We're building a PHP app based on Good old codeigniter framework and have run
I have a codeigniter app that queryies an api and gets a simplexml object.

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.