Wildhoney / Magento-on-Angular

Angular.js application using Magento as the backend API
361 stars 120 forks source link

Permission denied #90

Closed georgschlenkhoff closed 9 years ago

georgschlenkhoff commented 9 years ago

I've followed installation instructions and also set up folders in apache as instructed on Preferred Folder Structure and Config. What works: (i) Magento is up and running and (ii) I can also see the moa frontend.

Here my config.json (note: I'm using a Vagrant machine as you can see):

{
    "socket": {
        "port": 8888, 
        "host": "http://petite-cat-xxxx.vagrantshare.com/moa/store"
    },
    "magento": {
        "path": "/var/www/magento",
        "host": "http://petite-cat-xxxx.vagrantshare.com/magento",
        "store": 0
    },
    "api": {
        "host": "http://petite-cat-xxxx.vagrantshare.com/moa/api/public",
        "provider": "magento"
    }
}

But now I've two issues!

FIRST (showstopping) ISSUE - permission denied

If I do a node node/server.js the applicaiton does not start up. If I visit the endpoint /moa/api/public on the server I do see:

Error in exception handler: The stream or file "/vagrant/moa/api/app/storage/logs/log-apache2handler-2015-01-22.txt" could not be opened: failed to open stream: Permission denied in /vagrant/moa/api/vendor/monolog/monolog/src/Monolog/Handler/StreamHandler.php:84

apache's directory /var/www belongs to root. That's why I've tried to chown -R root: /vagrant/moa (which I've linked to /var/www/moa), but that does not work (since maybe it's an NTFS issue).

I feel so close to see your great stuff performing, but now I am totally stucked!! Please help.

SECOND (minor) ISSUE - subdomains

I am not so sure of how to set up the file /etc/apache2/sites-enabled/default.conf to get subdomains working. That is my try so far, but it's not working:

NameVirtualHost *:8080
Listen 8080
<VirtualHost *:80>
  DocumentRoot "/var/www/magento"
  ServerName  magento.petite-cat-xxxx.vagrantshare.com
  <Directory "/var/www/magento">
    AllowOverride All
  </Directory>
</VirtualHost>
<VirtualHost *:80>
  DocumentRoot "/var/www/moa/api/public"
  ServerName api.petite-cat-xxxx.vagrantshare.com
  <Directory "/var/www/moa/api/public">
    AllowOverride All
  </Directory>
</VirtualHost>
<VirtualHost *:8888>
  DocumentRoot "/var/www/moa/store"
  ServerName www.petite-cat-xxxx.vagrantshare.com
  <Directory "/var/www/moa/store">
    AllowOverride All
  </Directory>
</VirtualHost>

It would be really great if someone could help!

aonic commented 9 years ago

You need to give write permissions to the web server for /vagrant/moa/api/app/storage/logs/

aonic commented 9 years ago
Laravel may require one set of permissions to be configured: folders within `app/storage` require write access by the web server.