HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   General (http://www.howtoforge.com/forums/forumdisplay.php?f=15)
-   -   File Permissions messed up (http://www.howtoforge.com/forums/showthread.php?t=28130)

kextra1 25th October 2008 04:59

File Permissions messed up
 
Hey guys,

I really messed up my file permissions.

Can anybody please post the results of

ls -al /var/www

So that I know that I've changed them back correctly.


Thanks for any help anyone can provide

till 25th October 2008 12:26

ISPConfig should be able to fix the folder permissions. Run the following sql command in the database:

update isp_isp_web set status = 'u' WHERE status = '';

Then edite one site in the ispconfig interface, e.g. change the quota value and click on save.

kextra1 25th October 2008 18:51

What I did
 
Thanks for your response Till,

I had been ill for a few days and I dont know what I was thinking when I messed up the permissions. This is what I did, I noticed that one of my domains had the groups all set too nobody. I never fooled around with getting suPHP working so I do remember changing some files and directories to www-data a long time ago.

I went to /var/www and did this.

server:/var/www#chgrp -R web10 web10/

I don't know what I was thinking. Anyways, it changed all the directories and everything to the nobody group and www-data user.

I should have used:

chown -R user:group directory

but i wasnt thinking and it changed everything in the /var/www directory to the nobody group and the www-data user.

Anyways I fixed the permissions manually. It also changed the permissions of my symlinks though.

...so I used:

chown -h www.websitename.com

on all the symlinks. I also chgrp'd the directories:

apache-default
sharedip
localhost
webalizer

to the root group which i was only guessing was correct.

Also, all the www.websitename.com symlinks belong to the user:

www-data

which im not sure is correct or not. I appreciate all your help btw.

I'm kinda nervous to do anything quickly now, as i dont want to mess anything else up.

When you mentioned to:

update isp_isp_web set status = 'u' WHERE status = '';

Should I do this within phpmyadmin in ispconfigdb?

Thanks again for your help.

kextra1 25th October 2008 19:17

Okay - Still one thing
 
Okay, I followed your instructions:

mysql -uroot -ppassword

use ispconfigdb

update isp_isp_web set status = 'u' WHERE status = '';

..then I logged into ispconfig and changed the quota...it appears it took, but it also took before i sent the sql command. I haven't really noticed any changes.

I checked the permmissions in /var/www/www.testsite.com

They still show up as the group being nobody.

ls -al

webadmin as the user
nobody as the group

I can't believe i've done so much damage with one lowsy command. chown -R web10 web10 in the /var/www directory :(

Also, when i create a new domain, phptmp shows up as the user www-data instead of the domainadmin user...and i dont think it's sending the welcome email.

Any advice would be appreciated! Thanks a million again.

kextra1

kextra1 25th October 2008 21:08

Permissions now
 
Okay, I went though by hand and changed the permissions back to as normal as I could.

I created a test domain and here is the output

auatest@chronikal:/var/www/web81$ ls -al
total 44
drwxr-xr-x 9 jakemoti web81 4096 2008-10-25 13:58 .
drwxr-xr-x 28 root root 4096 2008-10-25 12:51 ..
drwxrwxr-x 2 jakemoti web81 4096 2008-10-25 12:51 cgi-bin
-rw------- 1 jakemoti web81 24 2008-10-25 13:58 .forward
drwxrwxr-x 3 jakemoti web81 4096 2008-10-25 12:51 ftp
drwxr-xr-x 2 jakemoti web81 4096 2008-10-25 12:51 log
lrwxrwxrwx 1 root root 36 2008-10-25 13:58 Maildir -> /var/www/web81/user/jakemoti/Maildir
drwxrwxrwx 2 jakemoti web81 4096 2008-10-25 12:51 phptmp
-rw-r--r-- 1 root root 450 2008-10-25 13:58 .procmailrc
lrwxrwxrwx 1 root root 43 2008-10-25 13:58 .spamassassin -> /var/www/web81/user/jakemoti/.spamassassin/
drwxr-xr-x 2 jakemoti web81 4096 2008-10-25 12:51 ssl
drwxr-xr-x 4 jakemoti web81 4096 2008-10-25 13:53 user
lrwxrwxrwx 1 root root 44 2008-10-25 13:58 .vacation.cache -> /var/www/web81/user/jakemoti/.vacation.cache
drwxrwxr-x 3 jakemoti web81 4096 2008-10-25 12:51 web
auatest@chronikal:/var/www/web81$

Which I thought seems okay. The only thing is, I've noticed there is no:

.htpasswd

The symbolic link file in /var/www is listed as:

lrwxrwxrwx 1 www-data web81 14 2008-10-25 12:51 www.auamoti.com -> /var/www/web81

I thought the .htpasswd file should have been created when the domain was created.

Any Idea's?

Thanks,

kextra1


All times are GMT +2. The time now is 08:59.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.