Sample Header Ad - 728x90

Why does Apache's mod-rewrite module process some GET requests and not process others?

0 votes
0 answers
318 views
I am trying to get mod_rewrite working. I'm experimenting with a very simple rule: RewriteEngine On RewriteRule ^/one /var/www/html/oldindex.html Here is the complete config file: /etc/apache2/sites-available/govmeeting.org.conf Require all granted ServerName govmeeting.org ServerAlias www.govmeeting.org ServerAdmin webmaster@localhost DocumentRoot /var/www/html LogLevel trace6 rewrite_module:trace8 ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined RewriteEngine On RewriteRule ^/one /var/www/html/oldindex.html I send two requests from the browser for "govmeeting.org/one". "oldindex.html" exists in my DocumentRoot. I see no processing occurring for either in error.log. However, at about the same time, an external request arrived from someone else. That request DOES get processed, but not mine. Below is the error.log and access.log for this time period. Note that the GET at 23:05:45 and 23:07:04 for "/one" is NOT processed. But the GET at 23:07:06 for "//wp-config.php" is processed. I have: Server version: Apache/2.4.41 (Ubuntu) Server built: 2021-10-14T16:24:43. The server is running on a VM in Google Compute Engine. 116.179.32.156 - - [05/Dec/2021:22:41:08 +0000] "GET / HTTP/1.1" 200 8945 "-" "Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36" 67.80.142.21 - - [05/Dec/2021:23:05:45 +0000] "GET /one HTTP/1.1" 404 5729 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" 67.80.142.21 - - [05/Dec/2021:23:06:05 +0000] "-" 408 5213 "-" "-" 67.80.142.21 - - [05/Dec/2021:23:07:04 +0000] "GET /one HTTP/1.1" 404 1079 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/96.0.4664.45 Safari/537.36" 136.144.41.231 - - [05/Dec/2021:23:07:06 +0000] "GET //wp-config.php HTTP/1.1" 404 493 "-" "Mozlila/5.0 (Linux; Android 7.0; SM-G892A Bulid/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Moblie Safari/537.36" 67.80.142.21 - - [05/Dec/2021:23:07:24 +0000] "-" 408 563 "-" "-" 209.17.97.34 - - [05/Dec/2021:23:11:47 +0000] "GET / HTTP/1.1" 200 4153 "-" "Mozilla/5.0 (compatible; Nimbostratus-Bot/v1.3.2; http://cloudsystemnetworks.com) " Here is the part of error.log for that time period: [Sun Dec 05 23:04:26.847532 2021] [mpm_prefork:notice] [pid 17645] AH00163: Apache/2.4.41 (Ubuntu) OpenSSL/1.1.1f configured -- resuming normal operations [Sun Dec 05 23:04:26.847605 2021] [core:notice] [pid 17645] AH00094: Command line: '/usr/sbin/apache2' [Sun Dec 05 23:07:06.213591 2021] [core:trace5] [pid 17650] protocol.c(708): [client 136.144.41.231:35566] Request received from client: GET //wp-config.php HTTP/1.1 [Sun Dec 05 23:07:06.213740 2021] [http:trace4] [pid 17650] http_request.c(436): [client 136.144.41.231:35566] Headers received from client: [Sun Dec 05 23:07:06.213747 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Host: govmeeting.org [Sun Dec 05 23:07:06.213751 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] User-Agent: Mozlila/5.0 (Linux; Android 7.0; SM-G892A Bulid/NRD90M; wv) AppleWebKit/537.36 (KHTML, like Gecko) Version/4.0 Chrome/60.0.3112.107 Moblie Safari/537.36 [Sun Dec 05 23:07:06.213755 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Accept-Encoding: gzip, deflate [Sun Dec 05 23:07:06.213759 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8 [Sun Dec 05 23:07:06.213763 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Connection: keep-alive [Sun Dec 05 23:07:06.213766 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Cache-Control: max-age=0 [Sun Dec 05 23:07:06.213770 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Upgrade-Insecure-Requests: 1 [Sun Dec 05 23:07:06.213773 2021] [http:trace4] [pid 17650] http_request.c(439): [client 136.144.41.231:35566] Accept-Language: en-US,en;q=0.9,fr;q=0.8 [Sun Dec 05 23:07:06.213803 2021] [rewrite:trace2] [pid 17650] mod_rewrite.c(483): [client 136.144.41.231:35566] 136.144.41.231 - - [govmeeting.org/sid#7fafa63c3810][rid#7fafa64820a0/initial] init rewrite engine with requested uri /wp-config.php [Sun Dec 05 23:07:06.213809 2021] [rewrite:trace3] [pid 17650] mod_rewrite.c(483): [client 136.144.41.231:35566] 136.144.41.231 - - [govmeeting.org/sid#7fafa63c3810][rid#7fafa64820a0/initial] applying pattern '^/one' to uri '/wp-config.php' [Sun Dec 05 23:07:06.213821 2021] [rewrite:trace1] [pid 17650] mod_rewrite.c(483): [client 136.144.41.231:35566] 136.144.41.231 - - [govmeeting.org/sid#7fafa63c3810][rid#7fafa64820a0/initial] pass through /wp-config.php [Sun Dec 05 23:07:06.213922 2021] [authz_core:debug] [pid 17650] mod_authz_core.c(817): [client 136.144.41.231:35566] AH01626: authorization result of Require all granted: granted [Sun Dec 05 23:07:06.213929 2021] [authz_core:debug] [pid 17650] mod_authz_core.c(817): [client 136.144.41.231:35566] AH01626: authorization result of : granted [Sun Dec 05 23:07:06.213933 2021] [core:trace3] [pid 17650] request.c(310): [client 136.144.41.231:35566] request authorized without authentication by access_checker_ex hook: /wp-config.php [Sun Dec 05 23:07:06.214003 2021] [php7:error] [pid 17650] [client 136.144.41.231:35566] script '/var/www/html/wp-config.php' not found or unable to stat [Sun Dec 05 23:07:06.214051 2021] [http:trace3] [pid 17650] http_filters.c(1125): [client 136.144.41.231:35566] Response sent with status 404, headers: [Sun Dec 05 23:07:06.214070 2021] [http:trace5] [pid 17650] http_filters.c(1134): [client 136.144.41.231:35566] Date: Sun, 05 Dec 2021 23:07:06 GMT [Sun Dec 05 23:07:06.214074 2021] [http:trace5] [pid 17650] http_filters.c(1137): [client 136.144.41.231:35566] Server: Apache/2.4.41 (Ubuntu) [Sun Dec 05 23:07:06.214077 2021] [http:trace4] [pid 17650] http_filters.c(955): [client 136.144.41.231:35566] Content-Length: 276 [Sun Dec 05 23:07:06.214084 2021] [http:trace4] [pid 17650] http_filters.c(955): [client 136.144.41.231:35566] Keep-Alive: timeout=5, max=100 [Sun Dec 05 23:07:06.214087 2021] [http:trace4] [pid 17650] http_filters.c(955): [client 136.144.41.231:35566] Connection: Keep-Alive [Sun Dec 05 23:07:06.214090 2021] [http:trace4] [pid 17650] http_filters.c(955): [client 136.144.41.231:35566] Content-Type: text/html; charset=iso-8859-1 [Sun Dec 05 23:07:06.214111 2021] [core:trace6] [pid 17650] core_filters.c(519): [client 136.144.41.231:35566] will flush because of FLUSH bucket [Sun Dec 05 23:07:06.313890 2021] [core:trace6] [pid 17650] core_filters.c(519): [client 136.144.41.231:35566] will flush because of FLUSH bucket
Asked by John Pankowicz (1429 rep)
Dec 6, 2021, 12:15 AM
Last activity: Dec 6, 2021, 03:00 AM