3

I'm a little confused: I'm running an Apache server within XAMPP on my Mac OSX Macbook. I wrote an file upload script and it's working fine. But the uploaded files have as owner "daemon". How can I set me or 'root' as owner? Because now I'm not able to make any changes in the uploaded files...

Many thanks in advance and best regards!

alve89
  • 971
  • 1
  • 9
  • 31

3 Answers3

22

In /Applications/XAMPP/xamppfiles/etc/httpd.conf change

User daemon
Group daemon

to

User YourName
Group YourGroup

That's it!

alve89
  • 971
  • 1
  • 9
  • 31
  • i did this, but i see xamppfiles/phpmyadmin/config.inc.php is still owned by user daemon? I like to edit the file as i am not getting into localhost/phpmyadmin – alex Oct 05 '15 at 19:53
  • 1
    When I change user and group in httpd.conf, phpmyadmin won't run. – Jos Feb 22 '20 at 09:30
  • @Jos Have you found a solution for this ? I'm stuck at the same point... Thanks... – jDelforge Oct 27 '21 at 20:39
2

I recommend using your /home/Sites directory for editing the documents because it will be owned by the user automatically. Then add the user 'daemon' to the specific folder that needs to be writable by apache. sudo chown -R daemon:daemon or add the user to the group sudo usermod -a -G groupname username

Or you can simply give yourself writable access or vice versa: sudo usermod -a -G groupname username

rick
  • 21
  • 1
0

We use the daemon user for security reasons. Setting yourself or root as the user could potentially compromise the security of your site.

Have you tried editors with FTP editing capabilities such as Aptana? This could circumvent the issue.

Javier Salmeron
  • 8,365
  • 2
  • 28
  • 23