0

I have installed Apache httpd Server on Amazon Linux. The default document location is /var/www/html. However, I would like to share the web server across many users on this server where each user could access their web content via their home folder.

I have accomplished this by adding the following into:

/etc/httpd/conf.d/example.com.conf

<VirtualHost *:8080>
    ServerAdmin example@example.com
    DocumentRoot "/home/example/public_html"
    ServerName example.com
    ServerAlias www.example.org example.org www.example.org
    ErrorLog "logs/example.org_error_log"
    CustomLog "logs/example.org_access_log" common
    <Directory "/home/example/public_html">
        Options -Indexes +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
</VirtualHost>

Apache server is running as user:group = apache:apache.

My user 'example' is part of the apache group.

The /home/example directory has 711 permissions The /home/example/public_html directory has 777 permissions (to make it work)

My problem: I have to assign owner/group/other permissions of 777 to make things work.

  1. This is a security problem as other users would be able to see and modify each other's files. This would need to be separated for security reasons obviously.

  2. I cannot understand why the group permissions don't seem to work. In theory this should from my understanding and experience.

What happens when the permission is not 777?: 1. public_html set to 771 seems to work. However, when installing Moodle the installation complained about write permissions. 2. file permissions set to 660 seem to work. 3. Folder permissions have to have other set to 7 in order to work.

In addition, all files and folders are owned by user:group example:example.

I would expect directory permissions of 771 and file permissions of 660. Is this right?

In addition, when new files are created they are 664 with apache:apache ownership. That should be example:example.

Should I be investigating ACL's?

What am I doing wrong here?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.