Passing environment variables to httpd in centos 7

In my previous Centos 6.10 server , I have been able to pass some environment variables to httpd by adding to /etc/sysconfig/httpd . ~/.envvars .envvars content is export MY_PASSWORD=’somepassword’ and then in http.conf SetEnv MY_PASSWORD ${MY_PASSWORD} and easily accessing the variable in php trough $_SERVER[‘MY_PASSWORD’] but after upgrading to Centos 7.7 this stopped working, in…

Deny access to “bat” files in Apache

I want to deny direct access to some sensitive files in my root application (e.g: log,sh, ini …etc). and for this reasons I have used the following directive in my main .htaccess: <FilesMatch “\.(htaccess|htpasswd|ini|log|sh|inc|bak|md|txt|lock|phar|bat)$|action.bat|composer.json|VERSION.*”> Require all denied </FilesMatch> the wierd thing is that it work perfectly fo all files listed in the FileMatch except files…

Nginx – enable download of multimedia file instead of streaming?

I am trying to enable multimedia (Mp3 and Mp4) file downloads on my newly setupped nginx/1.17.6 using HTTP2 server but the file started streaming instead of downloading. Here is my nginx.conf file: user www-data; worker_processes auto; error_log /var/log/nginx/error.log; pid /var/run/nginx.pid; worker_rlimit_nofile 4096; events { worker_connections 4096; multi_accept on; # essential for linux, optmized to serve…