My mobile app will be serving images from my Ubuntu VPS.
Basically I have the images organized in a folder \DATA
What happens is, whenever an image is needed from the mobile application, a request comes to my back end, where it fetches the link of the image and sends it back to the user so that the link would open the image on the phone. For example, http://myexamplesite.com/Data/Image001.jpg
The images that I have are in sequential order. (Image001, Image002, Image003, etc).
What I want to achieve is, if someone finds the link http://myexamplesite.com/Data, and tries to access it via the browser, to deny him access. My goal is to make the images accessible only when it comes via a request from the mobile.
I am using Server version: Apache/2.4.18 (Ubuntu 16.04) Server built: 2016-07-14 T12:32:26 MySQL: V5.7
Is such a thing possible on Linux?
You could make your mobile app set a unique 'user-agent' and then block all requests from other browsers. This will work as long as people do not find out what user-agent your app is using. (https://httpd.apache.org/docs/2.4/howto/access.html)
You can also serve the images through a simple PHP/Perl/Python/etc. script that requires you to include a 'key' in order to get the image.
Example: https://your.ubuntu.vps/images.php?id=image3&key=myMobileApp
It is also work mentioning that you should add a 'robots.txt' file that tells the search engines not to index the site. (http://www.robotstxt.org/) and disable browsing of the directory either by creating a blank 'index.html' or in a .htaccess/: