Answer the question
In order to leave comments, you need to log in
How to understand the working of the following Apache configuration?
Good to all,
there is a server left by the former administrator on our Ubuntu, two virtual hosts, each in its own config. For a host on port 80, the configuration is...
"VirtualHost *:80>"
ServerName host1.someserver.com ServerAdmin
[email protected]
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR} /access.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =host2.someserver.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,QSA,R=permanent]
"/VirtualHost>"
Everything works.. but I want to understand...
1) Where do these variables %{SERVER_NAME} and %{REQUEST_URI} ... etc come from here? Are these the standard variable names in Apache's conf or are they predefined somewhere?
2) Does it mean that all requests on port 80 will be sent to the server host2.someserver.com ? Or just https requests?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question