Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi all! We have been experiencing an issue on site where threads have been missing the latest postings. The platform host Vanilla are working on this issue. A workaround that has been used by some is to navigate back from 1 to 10+ pages to re-sync the thread and this will then show the latest posts. Thanks, Mike.
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

What permissions does FF need?

  • 01-07-2008 8:43pm
    #1
    Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭


    I have a web app that creates a temporary text file using the php fopen function. This seems to work fine in Windows and on my prod server, but Ubuntu has issues with it, giving me a permission denied error even though the user I'm logged in as can create folders and files in the particular folder. Do I need to set up permissions for FF or a group or something? Sorry if this is a noob question, but I can't get Google to return meaningful results for what I'm asking.


Comments

  • Registered Users, Registered Users 2 Posts: 2,534 ✭✭✭FruitLover


    What's FF?

    AFAIK PHP is run by the web server (probably apache?), so whatever user you're running apache (or whatever) under (common ones would be www-data, nobody, www) will need write access.


  • Closed Accounts Posts: 1,152 ✭✭✭sound_wave


    FruitLover wrote: »
    What's FF?

    FireFox I think.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    FruitLover wrote: »
    What's FF?

    AFAIK PHP is run by the web server (probably apache?), so whatever user you're running apache (or whatever) under (common ones would be www-data, nobody, www) will need write access.

    Sorry, yes, FF is Firefox. How do I determine what user I'm running Apache under? And once I've determined that, how would I give that user write access - I'm guessing I would have to set up a group, assign the user to that group and then change the folder permissions to give that group the ability to create files?


  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    corblimey wrote: »
    Sorry, yes, FF is Firefox. How do I determine what user I'm running Apache under? And once I've determined that, how would I give that user write access - I'm guessing I would have to set up a group, assign the user to that group and then change the folder permissions to give that group the ability to create files?

    Apache on Ubuntu would be running as a user called www-data and there is also a group called www-data.

    What directory are you trying to create this temporary text file in?

    E.g. if it's in /var/www/<myfolder> you'll do something like the following from the command line:

    chown -R <your_username> /var/www/<myfolder>
    chgrp -R www-data /var/www/<myfolder>
    chmod -R 660 /var/www/<myfolder>/*.*

    The above will change the file ownership on all the files in that directory to your user name and the group to www-data. The chmod bit will give read-write access to you, read-write access to apache, and no access to anyone else. If you've got php files in the folder you'll need to make them executable by apache.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    rmacm wrote: »
    chown -R <your_username> /var/www/<myfolder>
    chgrp -R www-data /var/www/<myfolder>
    chmod -R 660 /var/www/<myfolder>/*.*
    That doesn't appear to have worked. If I check the permissions on the folder, I can see that group www-data has list, create/delete, no access and that I'm the owner with the same permissions. But I still can't create a file in the folder from firefox?


  • Advertisement
  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    Firefox isn't the problem here, it in itself doesn't need permissions for a server side script to work. Do you get any error from your application e.g. debugging output?


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Well just the standard error message. Basically, what I'm trying to do is to create a file in a folder hanging off the main app folder. When I do this, I get:
    Warning: failed to open stream: Permission denied in {file} on {line}
    
    Is this anything like the problem you can sometimes have on Windows servers where the anonymous internet user (IUSER) has to be given certain permissions in IIS in order to function correctly for uploads, etc?


  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    An obvious question but just in case you haven't checked does the sub folder have the correct permissions and ownership?

    Afraid I can't answer the question on IIS, not much experience with it.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    rmacm wrote: »
    An obvious question but just in case you haven't checked does the sub folder have the correct permissions and ownership?
    Well, that's the folder that I chmod'ed and chgrp'd as per your instructions up above.


  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    Can you do an ls -al from the terminal in the directory where your files are and post the output up here?


  • Advertisement
  • Registered Users, Registered Users 2 Posts: 2,534 ✭✭✭FruitLover


    Also check the 'user' and 'group' parameters in your Apache config (assuming you're running Apache). This will probably be in /etc/apache/httpd.conf or /etc/apache2/apache2.conf


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    rmacm wrote: »
    Can you do an ls -al from the terminal in the directory where your files are and post the output up here?
    From terminal, I can't even cd into that folder! It gives me permission denied. I can still get to it through Nautilus though?
    FruitLover wrote: »
    Also check the 'user' and 'group' parameters in your Apache config (assuming you're running Apache). This will probably be in /etc/apache/httpd.conf or /etc/apache2/apache2.conf
    apache2.conf shows my group and user to be www-data.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Been messing around a bit myself. Since I was overwriting an existing file, I thought the 'no access' bit in the properties might have been causing an issue, so I set it back to 'Create and delete' for both owner and www-data group. This seems to have worked, I can now write a file in that folder from firefox. When I view the file's properties, the owner is www-data which means that I as a normal user can't do anything to it, but I think that's okay (and it makes sense).

    So I think it's just the rights that were applied when I did this:
    chown -R <your_username> /var/www/<myfolder>
    chgrp -R www-data /var/www/<myfolder>
    chmod -R 660 /var/www/<myfolder>/*.*
    
    resulting in no access for owner and group. I don't know much about this, but 660 implies read+write for both owner and group, so where is the 'no access' coming from?


  • Closed Accounts Posts: 2,039 ✭✭✭rmacm


    corblimey wrote: »
    I don't know much about this, but 660 implies read+write for both owner and group, so where is the 'no access' coming from?

    The no access is coming from the 0 part of the 660. Each number represents a different thing. The first number is the permissions for the owner, the second are group permissions and then the last number is for everyone else.

    So in the case of 660 both the owner and members of the group the file belongs to have read/write permissions and then everyone else has no access to the file.


  • Registered Users, Registered Users 2 Posts: 4,475 ✭✭✭corblimey


    Right, but even with 660, both the owner and the group had no access? Bbefore I changed it, the permissions dialog showed
    list, create/delete, no access
    for both owner and group.


Advertisement