V
V
Vadim2019-11-29 16:43:31
Apache HTTP Server
Vadim, 2019-11-29 16:43:31

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

1 answer(s)
A
Alexander, 2019-11-29
@UPSA

1. https://httpd.apache.org/docs/current/mod/mod_rewr...
This is a whole module. Can be used in .htaccess
2. Will be sent to host2.someserver.com and no https.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question