tee empty file
use ifne
grep -ri website /etc/apache2 | ifne tee /tmp/outout.log
rm also can help:
grep -ri website /etc/apache2 > /tmp/outout.log ; [[ $? -ne 0 ]] && 'rm' -f /tmp/outout.log
tee empty file
use ifne
grep -ri website /etc/apache2 | ifne tee /tmp/outout.log
rm also can help:
grep -ri website /etc/apache2 > /tmp/outout.log ; [[ $? -ne 0 ]] && 'rm' -f /tmp/outout.log
ServerName testdomain.com
ServerAlias *.testdomain.com
RewriteEngine on
RewriteMap lowercase int:tolower
RewriteCond ${lowercase:%{SERVER_NAME}} ^[a-z0-9-]+\.testdomain\.com$
RewriteRule ^(.+) ${lowercase:%{SERVER_NAME}}$1 [C]
RewriteRule ^([a-z0-9-]+)\.testdomain\.com/(.*) /var/www/vhost/testdomain.com/httpdocs/$1/$2
LogLevel alert rewrite:trace6
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/\.well\-known/acme\-challenge/
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
a2enmod proxy
apt install apache2 php7.4-fpm
a2enconf php7.4-fpm
a2enmod proxy proxy_fcgi
cat /etc/apache2/conf-enabled/php7.4-fpm.conf # Redirect to local php-fpm if mod_php is not available <IfModule !mod_php7.c> <IfModule proxy_fcgi_module> # Enable http authorization headers <IfModule setenvif_module> SetEnvIfNoCase ^Authorization$ "(.+)" HTTP_AUTHORIZATION=$1 </IfModule> <FilesMatch ".+\.ph(ar|p|tml)$"> SetHandler "proxy:unix:/run/php/php7.4-fpm.sock|fcgi://localhost" </FilesMatch> <FilesMatch ".+\.phps$"> # Deny access to raw php sources by default # To re-enable it's recommended to enable access to the files # only in specific virtual host or directory Require all denied </FilesMatch> # Deny access to files without filename (e.g. '.php') <FilesMatch "^\.ph(ar|p|ps|tml)$"> Require all denied </FilesMatch> </IfModule> </IfModule>
File not found.
This error message means there are no such file.
a2enmod actions
LoadModule remoteip_module modules/mod_remoteip.so
RemoteIPHeader X-Forwarded-For
RemoteIPInternalProxy 192.168.0.0/16
if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
ERR_SSL_PROTOCOL_ERROR
NameVirtualHost have wrong IP address
Apache Require IP address
Require ip 10.1.2.3
Require ip 10.1.2.1 10.1.2.2
Require ip 10.1.0.0/24
ss -lti '( sport = :http )' | grep unacked
If its fine, you should not see any unacked values
yum install ea-apache24-mod_env
.htaccess: Invalid command ‘SetEnv’, perhaps misspelled or defined by a module not included in the server configuration, referer:
Unknown Reason The server encountered an internal error or misconfiguration and was unable to complete your request
You should try use: ProxyErrorOverride off