问题
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!
回答1:
In /Applications/XAMPP/xamppfiles/etc/httpd.conf change
User daemon
Group daemon
to
User YourName
Group YourGroup
That's it!
回答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
回答3:
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.
来源:https://stackoverflow.com/questions/25821536/xampp-on-mac-osx-why-running-as-daemon