Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I'm trying to setup symfony on fedora 16 using the documention on the symfony site but getting the following problems (I can't post the link to the page due ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Feb 2012
    Posts
    4

    ACL / file permisions


    Hello,

    I'm trying to setup symfony on fedora 16 using the documention on the symfony site but getting the following problems (I can't post the link to the page due to restrictions on linuxforums.org on new accounts):

    1) Change the permissions of the "app/cache/" directory so that the web server can write into it.
    2) Change the permissions of the "app/logs/" directory so that the web server can write into it.

    I'm trying to follow the directions they have on the page under "Setting up Permissions" to resolve but can't seem to make it work.


    ************************************************** ****
    Setting up Permissions

    One common issue is that the app/cache and app/logs directories must be writable both by the web server and the command line user. On a UNIX system, if your web server user is different from your command line user, you can run the following commands just once in your project to ensure that permissions will be setup properly. Change www-data to your web server user:

    1. Using ACL on a system that supports chmod +a

    Many systems allow you to use the chmod +a command. Try this first, and if you get an error - try the next method:

    rm -rf app/cache/*
    rm -rf app/logs/*

    sudo chmod +a "www-data allow delete,write,append,file_inherit,directory_inherit " app/cache app/logs
    sudo chmod +a "`whoami` allow delete,write,append,file_inherit,directory_inherit " app/cache app/logs

    2. Using Acl on a system that does not support chmod +a

    Some systems don't support chmod +a, but do support another utility called setfacl. You may need to enable ACL support on your partition and install setfacl before using it (as is the case with Ubuntu), like so:

    sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs
    sudo setfacl -dR -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

    3. Without using ACL

    If you don't have access to changing the ACL of the directories, you will need to change the umask so that the cache and log directories will be group-writable or world-writable (depending if the web server user and the command line user are in the same group or not). To achieve this, put the following line at the beginning of the app/console, web/app.php and web/app_dev.php files:

    umask(0002); // This will let the permissions be 0775

    // or

    umask(0000); // This will let the permissions be 0777

    Note that using the ACL is recommended when you have access to them on your server because changing the umask is not thread-safe.
    ************************************************** ****************

    It doesn't appear that fedora 16 allows chmod +a so I tried running:

    sudo setfacl -R -m u:www-data:rwx -m u:`whoami`:rwx app/cache app/logs

    However, I'm getting the following error:

    setfacl: Option -m: Invalid argument near character 3

    Any help is appreciated.

    Thanks in advance.

  2. #2
    Just Joined!
    Join Date
    Feb 2012
    Posts
    4
    not sure why I don't have the www-data user on my installation but I used apache instead. the command below ran without errors:

    sudo setfacl -dR -m u:apache:rwx -m u:`whoami`:rwx app/cache app/logs

    but I'm still getting the same problem:

    1) Change the permissions of the "app/cache/" directory so that the web server can write into it.
    2) Change the permissions of the "app/logs/" directory so that the web server can write into it.

Posting Permissions

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