How can I create read-only read access for users on an Apache server?

I have a website with lots of photo pages. So that users can upload groups of photos without having to save them separately, I want to create a read-only FTP user that will be public.

Through the control panel for the host, I can create “regular” FTP user accounts, but they have write access, which is unacceptable.

Since there are several domains and subdomains hosted on the same server . I do not want to use anonymous FTP. A read-only account should be limited to a specific directory / subdirectories .

If possible, I would also like to know how to exclude certain directories from read-only FTP access that I give to this new user.

I scanned the entire server to find where the user account information is stored to no avail. In particular, I looked in httpd.conf and found LoadModule proxy_ftp_module modules / mod_proxy_ftp.so , but I don’t know how to work with it (or even if it’s relevant).

+3
source share
1 answer

, FTP - . zip , HTTP Apache. , , , , HTTP.

zip

<Directory /var/www/photos/>
    Order allow,deny
    Allow from all
    Options Indexes
</Directory>

# your file system is off limits 
<Directory />
    Options None
    AllowOverride None
    Order deny,allow
    Deny from all
</Directory>

DocumentRoot /var/www/

# the rest of your content.
<Directory /var/www/>
    <LimitExcept GET POST>
        deny from all
    </LimitExcept>

    Order allow,deny
    Allow from all
    Options None
</Directory>
0

Source: https://habr.com/ru/post/1765058/


All Articles