Change Apache owner on Synology

I am doing some web development on my Synology server and I found out that files created by Apache have the owner nobody from the group nobody. This causes the issue that files uploaded by apache ownership are locked from editing through guest or other accounts.

To solve this I could do the following when I need to edit files locally:

chown -R guest:users * //editable through guest account
chown -R nobody:nobody * //reset owner after edit (default apache owner)

However I hate doing this kind of thing because it seems counter productive. Instead I have changed the Apache configuration files making its default user {sh}guest:users{/sh}. The configuration files reside in the following folder: {sh}usr/syno/apache/conf{/sh}.  You can reach it by logging in through telnet as root.

Afterwards you are able to edit the configuration file httpd.conf-sys with the following command:

vi http.conf-sys

apache-change-user-sysFind the text listed in the picture to the left (user and group already changed). Then type [sh inline=”true”]/a[/sh] to get into the edit mode of the editor and adjust the user and group. To save the adjustments type {sh}:w{/sh} and the changed will be saved.

When done editing dont forget to {sh}chown -R guest:users *{/sh} your web folder and {sh}reboot{/sh} the Synology.

Leave a Reply

Your email address will not be published. Required fields are marked *