You are not logged in.

#1 2013-09-04 23:30:32

subraizada3
Member
Registered: 2013-06-02
Posts: 90

Making /srv/http writable by user

I want my user (sub) to be able to write to /srv/http. If I cd /srv and then chmod u+rw http, it complains that I do not have the right to do that operation. However, if I use sudo, then the root user is doing chmod so it still doesn't work. How do I make the directory writable by my user?

Offline

#2 2013-09-04 23:41:02

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,700
Website

Re: Making /srv/http writable by user

Make a subdirectory in there and make your user own it?


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#3 2013-09-05 00:06:40

progandy
Member
Registered: 2012-05-17
Posts: 5,280

Re: Making /srv/http writable by user

add your user to the http group?


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#4 2013-09-05 01:39:32

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 20,354

Re: Making /srv/http writable by user

progandy wrote:

add your user to the http group?

.... Then log out, and back in.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#5 2013-09-05 02:05:44

ralvez
Member
From: Canada
Registered: 2005-12-06
Posts: 1,718
Website

Re: Making /srv/http writable by user

You can take a look here: LAMP for more information.
Read the Apache "User Directories".

R.

Offline

#6 2013-09-05 02:51:39

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Making /srv/http writable by user

subraizada3 wrote:

However, if I use sudo, then the root user is doing chmod so it still doesn't work.

Wait, what?

Offline

#7 2013-09-07 19:04:12

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Making /srv/http writable by user

fukawi2 wrote:
subraizada3 wrote:

However, if I use sudo, then the root user is doing chmod so it still doesn't work.

Wait, what?

Yes, that's right, it's still owned by root and not by sub (OP's user name). A chown could change that.

A much better approach would be the User Directories approach mentioned by ralvez (if you use apache), though. This gives you a special directory in your home dir (usually ~/public_html) that can be reached via http://localhost/~$USER (http://localhost/~sub in you case).

Edit: typo

Last edited by cookies (2013-09-07 19:04:30)

Offline

#8 2013-09-08 11:19:49

fukawi2
Ex-Administratorino
From: .vic.au
Registered: 2007-09-28
Posts: 6,231
Website

Re: Making /srv/http writable by user

cookies wrote:

Yes, that's right, it's still owned by root and not by sub (OP's user name). A chown could change that.

I don't understand how root could not chmod it as the OP says, or am I reading it wrong?

Offline

#9 2013-09-08 16:10:01

cookies
Member
Registered: 2013-01-17
Posts: 253

Re: Making /srv/http writable by user

fukawi2 wrote:
cookies wrote:

Yes, that's right, it's still owned by root and not by sub (OP's user name). A chown could change that.

I don't understand how root could not chmod it as the OP says, or am I reading it wrong?

chmod as root did work, but since the directory in question is still owned by root, OP would still have to be root to write to it.

Offline

Board footer

Powered by FluxBB