Results 1 to 5 of 5

Thread: access to /srv/www/htdocs

  1. #1
    stpra123 NNTP User

    Default access to /srv/www/htdocs

    Hi,

    I am a linux novice so please bear w/ me. I just installed openSUSE and don't quite understand permissions. I installed apache2 and website is up and running fine. However, in order to edit any files for the website I have to give root permission. How can I add a user to the group that can have write permission? I've done the whole chmod'ing thing but to no avail. (i gave all files/folders in the www directory group and owner read/write permission). Perhaps the user isn't a member of the group? how do I change that? Do I do that w/ Yast? While I'm here, how do I get it so that my keyboard doesn't randomly switch to hebrew (or, what am I doing wrong that makes it switch)?

  2. #2

    Default Re: access to /srv/www/htdocs

    -----BEGIN PGP SIGNED MESSAGE-----
    Hash: SHA1

    What I typically do is make the directory holding my web files owned by me
    and then have all the files in there owned by my user (as I create/modify
    them). I also set them to have a group of 'www' with just read rights to
    the files which means Apache has access. I typically deny all other
    rights to the files so others cannot see in them in case I have passwords
    or something in there.

    You could also add your user to the 'www' group and use that to give write
    permissions but keep in mind that the web server will then also have write
    permissions to the files which is typically a bad idea since a malicious
    user could potentially add their own code to the file via the web server
    and then have the web server run that code and do malicious things.

    Good luck.





    stpra123 wrote:
    > Hi,
    >
    > I am a linux novice so please bear w/ me. I just installed openSUSE and
    > don't quite understand permissions. I installed apache2 and website is
    > up and running fine. However, in order to edit any files for the website
    > I have to give root permission. How can I add a user to the group that
    > can have write permission? I've done the whole chmod'ing thing but to no
    > avail. (i gave all files/folders in the www directory group and owner
    > read/write permission). Perhaps the user isn't a member of the group?
    > how do I change that? Do I do that w/ Yast? While I'm here, how do I get
    > it so that my keyboard doesn't randomly switch to hebrew (or, what am I
    > doing wrong that makes it switch)?
    >
    >

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v2.0.9 (GNU/Linux)
    Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

    iQIcBAEBAgAGBQJKCOY7AAoJEF+XTK08PnB5j7AP/1zyQUdU77+KSmHdfRX9Wf4R
    gWYQLQF/6QV35i+Vx3rvXGEj3sVKSmkRE/tmdfXSmX6Povev19ectxITnuz0XhJJ
    Val2d0AlX2HZz830eVoevcEKJaxcctEUdv0fF0qTdnfVocMafOliB1jAX7Dj5JyF
    IHs9VwCgiPZuYfzgZe9LpV4nKs2dUJ+/NIx4plmoPurj8qv/hWpQRVmkwJD2x3z8
    Q673Vc7NqA1310d5bKp2l9GsbEHn7Zhtp5F95ITlLrGVjSedJyFRe0v+gxAn4VE6
    Aw2Y43wBxzA2jJMhPNZF6/DGxi8G3aJWbTDFTcS7H7+gl53reqCf5QsgXlhKn/5Q
    Gzlgf+9JtYDyrNDYO0Hy81789MRmWCCRA9kCz+NsewCRvkLD9AgRsWmdJacGbVjw
    wZEeJSv/HkIPYO3vG04vdONh4Ns7jaLubcXc6PoUDDReOEVb+KtVJHJU0Mp0RulK
    LLHh9EaRg3SRN4TCdH0wmuiRUB6ywcvqqhbZ0g0gPeTgrsSSNWJ8E/qnRSMRbndE
    cNJJeG8Rbzc0l/592VogzLQp5UA8Ferz39QhDZx8mqZylYVnB8p7XteDfFDhPEJp
    v2u7tRkj4YhUuc/SFai8EKR44IoKldiNekiGvImuYO1vvoI86/+AGM5hgCWsVuJo
    PG6GE+TXP1VX+jt+aSr8
    =SdMd
    -----END PGP SIGNATURE-----

  3. #3
    Join Date
    Jun 2008
    Location
    UTC+10
    Posts
    9,686
    Blog Entries
    4

    Default Re: access to /srv/www/htdocs

    Simply change the ownership of /srv/www/htdocs to the user that will be doing the edit. If a group of people will be doing edits, then create a new group, change the directory to be owned by that group with chgrp and put those users in the group, then use chmod to allow group write on the directory.

    You might want to read up on how Unix permissions work, search for "rute user tutorial" for an excellent online book about Unix/Linux fundamentals.

  4. #4
    lavi_musiclife NNTP User

    Default Re: access to /srv/www/htdocs

    Hello,
    but how to see how many groups exits in my system??
    i have two accounts on my opensuse 11.2 one is root and second is harleen.

    i want to access /srv/www/htdocs through harleen.

    thanks
    Harlin

  5. #5
    Join Date
    Jun 2008
    Location
    /dev/swat
    Posts
    1,181

    Default Re: access to /srv/www/htdocs

    Quote Originally Posted by lavi_musiclife View Post
    Hello,
    but how to see how many groups exits in my system??
    i have two accounts on my opensuse 11.2 one is root and second is harleen.

    i want to access /srv/www/htdocs through harleen.

    thanks
    Harlin
    Become su in terminal and type this:

    Code:
    chown harleen /srv/www/htdocs
    Linux[openSUSE, KDE], PHP, MySQL, Wordpress, Tech News, etc :
    http://anl4u.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •