VM Lamp Stack Magento Error in permissions?

Asked

Viewed 50 times

0

The permissions problems 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.

However I tried to give the permissions to the folder specified 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 full code.: git repository. If anyone can help me because in several attempts I can not locate my mistake.

1 answer

0

Here are the steps followed:

- Setting permissions for all directories to stop 775

- Setting permissions of all files to stop 644

- Setting permissions for app/etc/, var/ and 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/;
  • Opa, Rafael Corrêa Gomes. Thanks for the contribution, however, I would not like to see a manual intervention. Because in parallel tests I made ssh the permissions changes and as your examples. It’s OK. But what I’m doing ( was ) is trying to automate the whole process. Since I already have Vms ready for this use. I’m looking to know better in do it myself.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.