I messed up my server bigtime. Need help with permissions and groups

edited January 2007 in Science & Tech
I am desperate for some quick help. I am fairly new at being a webmaster and I seem to have done something where every site except one is getting 'permission denied'.

I am on a dedicated virtual with mediatemple, running apache and centos
I was trying to do something and I did this:

I created a group called joomla

then

chown -R apache:joomla /var/www/vhosts
chown -R hersheysquirt:joomla /var/www/vhosts
umask 002

now... the only website viewable is the one that is belongs to the user "hersheysquirt" and none of hte other websites assigned to other users work. they all say "forbidden: you dont have permission......."

is there any way to reverse what i just did?

Comments

  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2007
    chown -R apache /var/www/vhosts

    That will give apache control over the vhosts folder again, which will fix your sites.

    now, what were you trying to do in the first place?
  • edited January 2007
    chown -R apache /var/www/vhosts

    That will give apache control over the vhosts folder again, which will fix your sites.

    now, what were you trying to do in the first place?

    thanks. what i did was chown -R username:apache /var/www/vhosts for each username i had created

    when I did it with just "apache" then I had no access through FTP when logged in as a user, but by assigning the username to apache it opened the sites up and gave ftp access.

    This is what I am trying to do.

    This is a newly provisioned dedicated virtual. I have created clients as if I was offering hosting. I then installed Joomla! The first problem I ran into was when I uploaded all the files through a username, not admin in ftp.... All the directories and files were "unwritable" when Joomla! was trying to install. I had to manually chmod to 757 in order for Joomla! using 'apache' could write to directories that were created by a user.

    Then the opposite would happen if I installed a template for example, through teh Joomla admin panel, it was being assigned ownership under 'apache' so if i logged into ftp as a user, i was getting 'permission denied' unless i logged in as root at again changed the permission to 757.

    Basically it was a pain in the ass to install anything because the program is installing as apache giving no one else access to it unless i set 757.

    hope that makes sense

    thanks for the response
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2007
    First of all, do NOT change ANYTHING to 757... That last "7" gives the world write access to your box. PHP code is notoriously insecure and all it's going to take is some hong kong script kiddie to bang a malformed URL into your script and your box is pwned and serving as an IRC eggdrop box or something.

    Joomla (and all other php scripts) run as apache. All you need to do is make apache able to write to whatever folder and that will solve your application problems.

    Make the user the owner of the folder/files, and the group set to apache, and you should be okay. The permissions should be 775 - the owner has 7, the group has 7, but the world only has read and execute.
  • edited January 2007
    First of all, do NOT change ANYTHING to 757... That last "7" gives the world write access to your box. PHP code is notoriously insecure and all it's going to take is some hong kong script kiddie to bang a malformed URL into your script and your box is pwned and serving as an IRC eggdrop box or something.

    Joomla (and all other php scripts) run as apache. All you need to do is make apache able to write to whatever folder and that will solve your application problems.

    Make the user the owner of the folder/files, and the group set to apache, and you should be okay. The permissions should be 775 - the owner has 7, the group has 7, but the world only has read and execute.


    thank you so much. that is pretty much what I had just done and hoped it was correct

    chown -R username:apache /var/www/vhosts/domainnamecom

    and it fixed everything. now I just need to chmod the directories now to 775 and I should be ok right?

    thanks again
  • primesuspectprimesuspect Beepin n' Boopin Detroit, MI Icrontian
    edited January 2007
    should be. :)
Sign In or Register to comment.