Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Weird OVZ behavior
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

Weird OVZ behavior

jcalebjcaleb Member
edited November 2012 in General

First of all, I don't take this against my host, as bad things can really go wrong, its part of life.

The problem: 2 weeks ago, I got an OVZ and installed debian6, NLMP and a single wordpress website, whose files are in /home/jon/public_html. Owner of public_html and all child contents are jon:www-data, and permission is 770. All is working fine and I can access website and do stuff and all.

Then after a day, suddenly the site can't be accessed. I also cant SSH to the VPS. After 2 hours, website shows nginx error, but I can ssh. Upon SSH as user jon, I can't access the files inside public_html via ls, cat, nano, etc. When I changed user to root, I can view the files, and indeed owner and permission did not change at all, still jon:www-data and 770. When I did chmod 777 to the files, I can access it again and website is working. When changed back to 770, the problem occurs.

What I did is just removed and recreated public_html and put necessary files from backup in another vps. Changed to 770, and it works.

I am not sure what happened, but it did scared me using OpenVZ.

Comments

  • jarjar Patron Provider, Top Host, Veteran

    Did you check error logs?

  • @jarland said: Did you check error logs?

    I am not very expert bro, I did not. What log should I check?

    I just find it weird i cant access files that I own, and with permission 770.

  • jarjar Patron Provider, Top Host, Veteran

    I'd probably check /var/log/nginx/error.log and see what you get.

  • jarjar Patron Provider, Top Host, Veteran
    edited November 2012

    Also doesn't a website need at least execute on other for web? I should know, but I'm second guessing myself because I've never set a 0 to other on a public site. I would think 771 would be correct.

    Edit: Yes I'm correct, shouldn't second guess my instinct ;)

  • But still, I can't list my files that I own and have permission to?

  • jarjar Patron Provider, Top Host, Veteran

    Actually I'm having to use 775 at least, need read on other. Your ownership doesn't extend to the browser unless you're browsing on the same system.

  • I am logged in SSH bro. Cant perform an ls to the directory.

  • jarjar Patron Provider, Top Host, Veteran

    Right, but your browser doesn't have the same access level as your ssh session. Unless I'm misunderstanding what you're doing. Entirely possible tonight lol ;)

  • browser and nginx aside, its scary why ovz will behave like that. Make me think to just use KVM for things that are serious, and OVZ for personal non-critical use.

  • jarjar Patron Provider, Top Host, Veteran

    I usually don't work with permission problems so it starts to fade from memory, a problem I have a lot. One of the areas me and Ryan split the work. Looks like on my minstall setups I have username:username where you've got username:www-data.

  • serverbearserverbear Member
    edited November 2012

    775 is the right permissions, not sure why you're setting it to 770? I normally chown the entire directory to www-data:www-data.

    What's the output of ls -la in /home/?

  • i will check, thanks for help. but nginx and web hosting aside, it's just crazy why i cant access my files in shell.

  • craigbcraigb Member
    edited November 2012

    Given the problem accessing files from the shell, at first glance it sounded like your UID had somehow been changed in /etc/passwd and your files were still owned by your old UID. But if that was the case, you would see numeric UID in the output of ls instead of jon.

    Try logging in and typing "touch me" and see if the file ownership is the same as your HTML files. Double-check numeric IDs through a "ls -n" - do the old and new files match up?

  • thanks i will try

Sign In or Register to comment.