VM Lamp Stack Magento Error in permissions?

0

Permissions issues are in these folders.

Path "/var/www/hf/app/etc" must be writable.
Path "/var/www/hf/media" must be writable.
Path "/var/www/hf/media/customer" must be writable.
Path "/var/www/hf/media/dhl" must be writable.
Path "/var/www/hf/media/xmlconnect" must be writable.
Path "/var/www/hf/media/xmlconnect/original" must be writable.
Path "/var/www/hf/media/xmlconnect/custom" must be writable.
Path "/var/www/hf/media/xmlconnect/system" must be writable.
Path "/var/www/hf/media/downloadable" must be writable.

But I tried to give the permissions to the magento in the specified folders and it is not working ...

   class magento::magento {

    file { "/var/www/magento":
        ensure => "present",
        owner => "root",
        group => "root",
        mode => "0644",
        source => "puppet:///modules/magento/magento-1.9.1.0.tar.gz",   
        require => Package["apache2", "mysql-server"],          
    }

    exec { "unzip-magento":     
        command => "tar -vzxf /var/www/magento",                
        path => "/bin/",
        require => File["/var/www/magento"],            
    }

    exec { "rename-dir-magento":
        command => "mv magento/ hf/",
        path => "/bin/",
        require => Exec["unzip-magento"],       
    }

    exec { "mv-hf":     
        command => 'mv hf/ /var/www/',
        path => "/bin/",
        require => Exec["rename-dir-magento"],  
        timeout => 90000,
        logoutput => on_failure,        

    }

    # a fuller example, including permissions and ownership
  file { ["/var/www/hf"]:
    ensure  => "directory",
    owner   => "root",
    group   => "root",
    mode    => "0755",
    recurse => "true",
    require => Exec["mv-hf"],
  }

    file { "/var/www/hf/var/":
    ensure  => "directory",
    owner   => "root",
    group   => "root",
    mode    => "0777",
    recurse => "true",
    require => Exec["mv-hf"],
  }

  file { "/var/www/hf/media":
    ensure  => "directory",
    owner   => "root",
    group   => "root",
    mode    => "0777",
    recurse => "true",
    require => Exec["mv-hf"],
  }

  file { "/var/www/hf/media":
    ensure  => "file",
    owner   => "root",
    group   => "root",
    mode    => "0777",
    recurse => "true",
    require => Exec["mv-hf"],
  }
    # permission for media and var directories
  file { ["/var/www/hf/var/cache", "/var/www/hf/var/locks", "/var/www/hf/var/package", "/var/www/hf/var/session"]:
    ensure  => "directory",
    owner   => "root",
    group   => "root",
    mode    => "0667",
    recurse => "true",
    require => File["/var/www/hf/media", "/var/www/hf/var"],
  }

    # permission for media and var directories
  file { ["/var/www/hf/app/etc"]:
    ensure  => "directory",
    owner   => "root",
    group   => "root",
    mode    => "0777",
    recurse => "true",
    require => Exec["mv-hf"],
  }

  file { ["/var/www/hf/app/etc"]:
    ensure  => "file",
    owner   => "root",
    group   => "root",
    mode    => "0777",
    recurse => "true",
    require => Exec["mv-hf"],
  }

}

Here is the complete code: Git repository . If someone can help me because in several attempts I can not find my error.

    
asked by anonymous 16.02.2015 / 01:01

1 answer

0

Here are the steps followed:

- Setting permissions for all directories to stop 775

- Setting permissions for all files to stop 644

- Setting permissions for the / app / etc / var / media folders and all internal files for 777

Just run the command:

sudo find . -type d -exec chmod 755 {} \;
sudo find . -type f -exec chmod 644 {} \;
sudo chmod 777 -R app/etc/;
sudo chmod 777 -R var/;
sudo chmod 777 -R media/;
    
04.07.2015 / 01:42