I have an apache server where, in addition to my application, I have a node.js websocket application. The problem is that any user can read the contents of the file simply by moving it to the URL. I am trying to block direct access to one of the files (I have already managed to lock the node.js folders).
I am changing my configuration file: apache2/apache2.conf . Assuming my file is located in /var/www/server/node_start.js , I tried to do the following:
<Files /var/www/server/node_start.js> Order allow,deny Deny from all </Files> <FilesMatch /var/www/server/node_start.js> Order allow,deny Deny from all </FilesMatch> <Files /server/node_start.js> Order allow,deny Deny from all </Files> <FilesMatch /server/node_start.js> Order allow,deny Deny from all </FilesMatch>
None of this worked out. I looked at other posts, and it looks like I'm doing the same thing as the others. Any idea why I fail?
PS I canβt lock the whole directory because there are many other files that should not be blocked.
source share