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 8799315
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:17:31+00:00 2026-06-14T00:17:31+00:00

I just ported my website server which allow file uploading . Now it runs

  • 0

I just ported my website server which allow file uploading . Now it runs vps on ubuntu 11.04.
Uploaded files are stored in folder call files which had owner : root and group :root as similar to other folders.

But problem is when i tried to run the php function (readfile()) to read any of the file from the folder it didn’t read that file and But when i changed the folder owner and group to 10000 and 1005 which is same as was in previous server. PHP instantly found that file and downloading was started. I was not able to guess what is problem and how this happened. Because i have tried changing files and its content group and owner to root.

Can anyone describe how this happened, and how to change it to again my own group or owner.And also there is no group and owner named 10000 and 1005 presently in my VPS.

Is it some kind of, bug or hacking done on server.

  • 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-14T00:17:33+00:00Added an answer on June 14, 2026 at 12:17 am

    on ubuntu apache’s user is www-data.

    In your first scenario apache did not have the correct access. Take for example default permissions on 12.04 for /var/www directory

    -rw-r--r-- 1 root root 177 Sep 15 11:43 index.html

    As you can see apache can only r this file. And that is all it needs to do.
    The first set -rw- corresponds to the user. The second set of perms r-- correspond to the group and the third set r-- correspond to everyone else.

    Since php is being run by www-data you would not be able to to write to this file.

    Creating a upload directory in /var/www using sudo mkdir uploads gives permissions.

    drwxr-xr-x 2 root root 4096 Nov 8 11:59 uploads

    once again www-data is not able to write to the uploads directory!

    You could open up the ‘other’ permissions (not good because any user could then write to this directory, when in fact you only want www-data to be able to write), you could add www-data as the owner of this directory. You could create an admin group or something and add www-data to it, (or just change group to www-data if no other users need to use it, and probably many other more secure ways, i’m not a sys admin, that is why serverfault would be good:))

    As for your user issue, it is def a problem if a user doesn’t exist and you try to use chown

    daniel@daniel:/var/www$ sudo chown doesnotexist:stuff uploads/
    chown: invalid user: doesnotexist:stuff'
    

    Did you check which users are presnet? using groups or cat /etc/passwd?

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

Sidebar

Related Questions

I'm creating a comment system for my website. Right now its just a basic
I'm just working on a website dealing with javascript local dates/times. Dates/Times are stored
So I just have posted a question about this code (which was answered): $(document).ready(Main);
So, we've got PHP 5.3.2 installed on a Windows 2008 R2 Server. PHP.ini file
i have some html files as part of a regular website that has been
I have a classifieds website where users may sell/buy just about anything... My issue
When I run my ASPNet MVC 2 Preview 1 website under VS dev server
I am just beginning with GTK+. I have an Ubuntu 11.04. How should I
I am making one website about books and the user reaches the book which
I posted before but now I seem to actually see the problem, just having

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.