How to use WD My Cloud for image hosting?

Hi. I want to store some images on my WD My Cloud that can be accessible globally via http://. I have followed this thread for a solution: LINK.

I have created a file named: _ example.conf _ and in it some _ VirtualHost _ tags. The problem is that after reloading apache it gives me error that:

Listen cannot occur within <VirtualHost>

or after deleting _ Listen _

<VirtualHost> cannot occur within <VirtualHost>

It seams that the files in  etc/apache2/sites-enabled are somehow treated like scripts that are executed inside  VirtualHost  tag.

After removing  VirtualHost  tags and _ Listen  from  example.conf  _apache reloads correctly. Soon after I try to access the location remotely via http:// it request username and password. By default config, site shows this info:

Forbidden
You don't have permission to access /UI on this server.

 How can make it work without messing up the /UI ?

You’re hitting the docroot of port 80 that’s why you ended up with /UI/ after being redirected. And the /UI/ is only accessible via local subnet. Create a new path within your docroot e.g. /images/ and access this directly instead.

For the example.conf, use a different port i.e. 8080, place it in the ./conf.d/ instead of ./sites-*/.

1 Like

Thank you Nazar78!

but what about safety?

<Directory /folder path>
    Options +Indexes
    Require all granted
</Directory>

Is that save for all other files on drive to have this tiny gate open worldwide?

Only relevant files and subdirs in this /img/ path of yours are accessible worldwide. Unless you have symlinks in this path pointing outside of docroot.

I don’t have any symlinks. Thank you for your help :slight_smile: