Find the answer to your Linux question:
Page 1 of 2 1 2 LastLast
Results 1 to 10 of 19
hi just installed mint. love it. not sure where to put this as it is a ditro wide issue, but just so we know what one i have, i posted ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10

    apache var/www permissions


    hi just installed mint. love it.

    not sure where to put this as it is a ditro wide issue, but just so we know what one i have, i posted it here

    i do a lot of php programing so of course the first thing i wanted to do was get apache and php installed

    worked great! got the WORKS page when running local host and php info showed up as it is supposed to.

    now the problem is that
    /etc/httpd folder does not exist???

    and when i open my editor - the other thing i wnated to do was copy my projects over to the /var/www folder. that gives me a permission error.

    so
    1. where could the /etc/httpd fold have been placed? and how can i retrieve/ move it etc..
    2. how do i fix the permissions? i currently set the var folder to 755

    this is one thing i remembered fromdays old about linux, very "permission" oriented, so am nost used to it. /sigh

    thank you for any help

  2. #2
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    You'll have to look around in /etc if its not in /etc/httpd/. Could be /etc/apache or /etc/apache2 or something similar.

    Regarding the permissions, 755 should be fine for /var but you're trying to get to /var/www. What are the permissions on that directory?

  3. #3
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10
    hi thanks for the quick response
    all i am trying to do is work in www so just need to be able to save files and create folders as needed (w/o being constantly being a root users)

    ps
    how do you check the permissions? in windows you just do attr or dir.. if i do "ls" it just gets a list of whats there

  4. $spacer_open
    $spacer_close
  5. #4
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10
    ok first found the apache2 folder.
    puzzle: doesnt look anything like my windows apache, my httpd.conf file is emply there is no conf folder. is this a bar bones

    ref.
    howtoforge.com/ubuntu_lamp_for_newbies

  6. #5
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    To check permissions on /var/www you'd issue:

    Code:
    ls -ld /var/www/
    If you want to work inside /var/www you'd need to have appropriate permissions on the /var/www directory as well.

  7. #6
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    I think it will require an httpd.conf to start correctly but I've never experimented with that.

    What user are you trying to view the directory as?

    I find it unlikely that apache would start without any httpd.conf. How did you install apache? From source, or from a dpkg/rpm?

  8. #7
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10
    Quote Originally Posted by hunter_thom View Post
    I think it will require an httpd.conf to start correctly but I've never experimented with that.

    What user are you trying to view the directory as?

    I find it unlikely that apache would start without any httpd.conf. How did you install apache? From source, or from a dpkg/rpm?
    hi

    just apt-get install apache2

    and not sure of user (im new on this but learn fast) its not root. when I boot and log in, that is it.

    but ya i made a page with gedit (i think as root) and test.php and it works just fine

  9. #8
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10
    Quote Originally Posted by hunter_thom View Post
    To check permissions on /var/www you'd issue:

    Code:
    ls -ld /var/www/
    If you want to work inside /var/www you'd need to have appropriate permissions on the /var/www directory as well.

    Code:
    drwxr-xr-x 2 root root 4096 2011-04-29 09:50 /var/www

  10. #9
    Just Joined!
    Join Date
    Apr 2011
    Posts
    10
    here is an option i tried but it is not working so not sure if i am missing something. i

    mkdir ~/public_html
    sudo ln -s ~public_html /var/www/$USER

    then made a test.php in public_html.

    did not work..so is the $USER a var that i should fill in my name?
    i figure this way i can edit files and create folders w/o having to be root


    EDIT:
    the link worked the $USER = equals my username
    Code:
    localhost/klyxmaster/test.php
    works
    and i can edit

    but still any info you can give on the permission would great for future reference
    Last edited by klyxmaster; 04-29-2011 at 04:38 PM.

  11. #10
    Just Joined! hunter_thom's Avatar
    Join Date
    Apr 2010
    Posts
    89
    $USER is the username. If youre logged in as root is will be root.

    Try:

    Code:
    whoami
    to identify the username.

    To write files to /var/www as a user other than root, the permissions are missing.

    Do you want a user to write files there or root? If a user, you have a few options:

    1. Add the user to a group (called www for example), change the group owner of the directory to www (or whatever) and set the permissions to 775 on /var/www.
    a. This is done by:
    Code:
    groupadd www
    chown -R :www /var/www
    chmod -R 775 /var/www
    2. Allow all users to edit files here. This is done by:
    Code:
    chmod -R 777 /var/www/
    There are definitely other ways but these are two quick ways that come to mind.

    Is this a box that will be used for development or are you using this also for production or actually serving up the PHP scripts?

Page 1 of 2 1 2 LastLast

Posting Permissions

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