You are not logged in.

#1 2011-01-24 02:36:07

empthollow
Member
Registered: 2009-09-26
Posts: 168

Permissions on web server files

I recently had to reinstall and I copied all the files from my web server but I screwed up the owner and permissions.  I was wondering if anyone could offer me some tips on what the default owner:user and read/write permissions should be.  I understand certain files need modified permissions, but while I know how to write a web site and setup apache, I'm not sure what permissions should look like.  Thanks.


--empthollow
Check out my Arch based live distro http://fluxcapacity.99k.org

Offline

#2 2011-01-26 11:47:29

otterfox
Member
Registered: 2010-08-05
Posts: 21

Re: Permissions on web server files

In archlinux you generally have the owner and group both set to http. Everything should be given the least permissions needed...the googles turned up this:
  # find /usr/local/apache -type d | xargs chmod 755
  # find /usr/local/apache -type f | xargs chmod 644
So, directories should be set to 755 and files to 644 I'm guessing. But I'd do a bit more googling, because I thought you'd only want to have read permissions, so have the files owned by someone other than http and set the group to http and set 755 or 655 permissions. It's also a good idea to restrict directories within /srv/http/ that you don't want everyone poking through (.git directories come to mind).


<insert hardware wankery>

Offline

Board footer

Powered by FluxBB