0

I am using XAMP on mine MAC System (OS: macOS High Sierra) and I follow the steps: I have permissions issue but i can't understand why ..

  1. I have default configuration on mine XAMP in httpd.conf file for :

<IfModule unixd_module>
      User daemon
      Group daemon
  </IfModule>
  1. I have a laravel project in mine htdocs directory:

    /Applications/XAMPP/xamppfiles/htdocs/sites have the 2 sites:

drwxrwxr-x  5 daemon  daemon  160 Dec  2 07:11 beinstyle
drwxrwxr-x  5 daemon  daemon  160 Dec  2 07:10 conlineltd

In that sites directories i have logs directory:

drwxrwxr-x   2 daemon  daemon   64 Nov 29 18:26 logs
  1. I made the virtual hosts:

httpd.conf configuration for:
Listen 80
Listen 8080

# Virtual hosts
Include etc/extra/httpd-vhosts.conf // included

httpd-vhosts.conf
<VirtualHost *:8080>
    ServerAdmin conlineltd.com
    DocumentRoot "/Applications/XAMPP/htdocs/sites/conlineltd/project/public"
    DirectoryIndex index.php
    ServerName conlineltd.com
    ServerAlias www.conlineltd.com
    ErrorLog "/Applications/XAMPP/htdocs/sites/conlineltd/logs/"
    CustomLog "/Applications/XAMPP/htdocs/sites/conlineltd/logs/" common
</VirtualHost>

<VirtualHost *:8080>
    ServerAdmin beinstyle.com
    DocumentRoot "/Applications/XAMPP/htdocs/sites/beinstyle/project/public"
    DirectoryIndex index.php
    ServerName beinstyle.com
    ServerAlias www.beinstyle.com
    ErrorLog "/Applications/XAMPP/htdocs/sites/beinstyle/logs/"
    CustomLog "/Applications/XAMPP/htdocs/sites/beinstyle/logs/" common
</VirtualHost>

I run the following commands:

`sudo dseditgroup -o checkmember -m macbook daemon` after checking the command return yes!

 sudo dseditgroup -o edit -a macbook -t user daemon

Error logs from apache:

(21)Is a directory: AH00091: httpd: could not open error log file /Applications/XAMPP/htdocs/sites/beinstyle/logs/. AH00015: Unable to open logs

Mine system logged user is macbook do i need to add him to a daemon group ?

I am new to the permissions topic on linux systems and maybe i miss something simple here , Please need your help !!

Maks.Burkov
  • 586
  • 3
  • 12
  • 24
  • If the user macbook aint part of group daemon that user does not have write access to the _logs_ folder. _drwxrwxr-x_ indicates that the user daemon and users from same group has rwx, and other groups/users in the system has r-x, read and execute. – mattias Dec 02 '17 at 10:39
  • I added the macbook to group and checked if the user is there . The code above . But i still stuck with that problem . – Maks.Burkov Dec 02 '17 at 11:44
  • If you, as the _macbook_ user `$ cd /Applications/XAMPP/htdocs/sites/beinstyle/logs/` and try `$ touch test.txt`, what happens? – mattias Dec 02 '17 at 14:47
  • -rw-r--r-- 1 macbook daemon 0 Dec 3 00:34 file.txt File was created i got this result! – Maks.Burkov Dec 02 '17 at 22:35
  • What happens if you chmod the log directory to 777? `chmod 777 /Applications/XAMPP/htdocs/sites/beinstyle/logs/`. Mind you, it might not be clever to keep it 777. – mattias Dec 03 '17 at 00:05
  • Yes i know and i don't want to do it ! I want to give the ownership only to apache! But i got the error above so ... – Maks.Burkov Dec 03 '17 at 01:37
  • Are you sure it's the `macbook` user that runs the Apache daemon? Default seems to be _www, https://serverfault.com/questions/152175/apache-runs-as-which-user-group-under-os-x-10-6 & https://stackoverflow.com/questions/2001881/correct-owner-group-permissions-for-apache-2-site-files-folders-under-mac-os-x – mattias Dec 03 '17 at 09:53
  • Yes i am talking about XAMP and not built in web server .. – Maks.Burkov Dec 03 '17 at 14:01

0 Answers0