Protected directories

7 posts / 0 new
Last post
#1 Sun, 10/13/2013 - 14:30
jarebm

Protected directories

Hello All,

In Virtualmin I am trying to create a protected directory. However, I keep getting the following error: Failed to protect new directory : Failed to open /home/main/domains/test.jarebmorgan.com/public_html/cp/.htaccess for writing : Permission denied at ../web-lib-funcs.pl line 1376.

If anyone knows how to fix this I would appreciate it.

Thanks

Sun, 10/13/2013 - 22:20
andreychek

Howdy,

At what point do you receive that error?

Also, what is the output of this command:

ls -ld /home/main/domains/test.jarebmorgan.com/public_html/cp

Sun, 10/13/2013 - 22:47
jarebm

the ls -ld command displays drwxrwxr-x 3 www-data www-data 4096 Oct 13 15:12 /home/main/domains/test.jarebmorgan.com/public_html/cp

I get the error after clicking on services -> protected directories -> add protection for a new directory -> Select Sub-Directory -input the "cp" without quotes in field -> type message in Authentication realm -> Click create -> Then get error

Thanks for the Help

Sun, 10/13/2013 - 23:39
andreychek

Ah, it looks like the /home/main/domains/test.jarebmorgan.com/public_html/cp directory is owned by the www-data user, rather than the Virtual Server owner.

You would want to change the owner of that directory to be the Virtual Server owner... you can do that with this command:

chmod USERNAME /home/main/domains/test.jarebmorgan.com/public_html/cp

Mon, 10/14/2013 - 07:44
Locutus

Eric meant to say "chown" for the last command he posted, not "chmod". :) chown modifies the owner, chmod the access rights.

(Eric of course knows that, he certainly just mixed the two commands up.)

Mon, 10/14/2013 - 19:14
jarebm

Thanks Everyone,

This solved the issue. Greatly appreciate it.

Mon, 10/14/2013 - 21:28
andreychek

I'm glad Locutus is here to catch my typos, or we'd be working on two problems now :-)

It's good to hear you got it working, thanks for the update!

-Eric

Topic locked