Questions tagged [apache2]

The Apache HTTPd Server. When asking questions about virtualhosts, please include the output of the following command: "apache2ctl -S" (or "httpd -S" depending on your OS)

The Apache HTTP Server is a popular Open Source Web server. This tag should be used for general questions about Apache HTTPd.

Although there is large degree of commonality between the different versions in the 2.x branches, please consider using the Apache-2.2 or Apache-2.4 tags instead for more specific Apache HTTP Server related questions.

Documentation for all major versions is both comprehensive and has a high degree of accuracy.


1741 questions
2
votes
1 answer

Apache GZIP for images - any reason?

JPEG, GIF, PNG and WEBP images are already compressed. Is there any reason to serve them up using GZIP compression, regardless of whether or not the client says it may accept GZIP compression? curl -H "Accept-Encoding: gzip" -I ^ …
Lumi
  • 199
  • 2
  • 8
2
votes
0 answers

Apache creates ~3x as many threads as MaxRequestWorkers

I'm hosting a non-profit community wiki for the upcoming video game Baldur's Gate 3. Since it looks like the game is likely to have millions of players, we started worrying about server capacity. I'm on Apache 2.4.57 (latest stable), using the…
TaylanKammer
  • 141
  • 5
2
votes
1 answer

.htaccess return error if no RewriteRule meets the request

I'm trying my hands on writing a simple REST API and am currently trying to properly configure my .htaccess file. What I'd like to achieve is the following: have RewriteRules to direct requests towards the actual RestController catch all requests…
traxx2012
  • 123
  • 4
2
votes
3 answers

Apache on debian don't redirect http to https correctly

Debian 11 config file: /etc/apache2/sites-enabled/000-default.conf RewriteEngine On RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} ServerName…
Ishayahu
  • 187
  • 1
  • 2
  • 11
2
votes
1 answer

apache2.4 (debian11): access of /.htm or /.html sites lead to 403 (and not 404)

If I install apache2 on debian 11 and access one of the following urls: http://localhost/.htm http://localhost/.html I don't get the expected HTTP status-code 404, I get a HTTP-status code 403 instead! However, if I access the url…
byteunit
  • 123
  • 4
2
votes
0 answers

Why are tmp files in /var/tmp/systemd-private-* excluded from automatic deletion?

I'm running a CGI application on an Apache instance, and lately I've been noticing errors like the following, which appear to be causing some issues: ERR012: Unable to create temporary file "/var/tmp/023711.000001.tmp": File exists (This is the…
DMJ
  • 171
  • 1
  • 6
2
votes
1 answer

Is it possible to install and use Dokku on a server that already has Apache2 configured with VirtualHosts running?

Posted this on StackOverflow, but realized it probably belongs here: I have a Ubuntu (now upgrading it to 22.04) server that runs several virtual hosts with php applications. I'd like to run a couple of node applications (I am converting the old php…
2
votes
1 answer

Redirect part of a URL parameter to the URL-Path

I used a module that created links like this: https://example.com/login?create_account=1&back=https://example.com/product/2164/?ets_rv_add_review=1 I need to redirect them to: https://example.com/product/2164/ There are hundreds of these links. I…
Ehsanai
  • 21
  • 2
2
votes
1 answer

apache 2.4.54 (httpd) require not ip not blocking ip addresses

So I am running apache 2.4.54 on a redhat centos 7 machine. I am using the below configuration to run my django application with mod_wsgi: # create new #LoadModule wsgi_module modules/mod_wsgi.so LoadModule wsgi_module…
Shmack
  • 131
  • 6
2
votes
1 answer

How can Apache log whether requests are using HTTP2 or not, in a manner that can't be easily spoofed by the client?

According to this, including %H in your LogFormat is supposed to log the HTTP protocol version, however, it appears to be unreliable. As an example, one can telnet to port 80 of the web server and issue a GET / HTTP/2.0, which will cause Apache to…
Displayname71
  • 109
  • 1
  • 7
2
votes
1 answer

Get Url Parameter from Request and store it in variable in apache config

In my apache config, I want to allow access only when a specific url parameter matches a specific cookie. I imagine a solution looking similar to this (in pseudocode): param = get_url_parameter_with_a_specific_name_from_request if…
Lokomotywa
  • 131
  • 5
2
votes
2 answers

Redirect to other server and domain if file not found

I have migrated from Apache to Nginx so I want to set all rules in Nginx. Goal: Redirect a URL to another domain with the same filename if that file is not found on the requested server. Example If a user open https://www.example.com/data/1.jpg then…
Shubham Panchal
  • 51
  • 1
  • 2
  • 7
2
votes
1 answer

What is this possible Apache exploit, and am I affected?

I had this warning in my daily logwatch digest this morning: A total of 1 possible successful probes were detected (the following URLs contain strings that match one or more of a listing of strings that indicate a possible exploit): …
Darren
  • 331
  • 3
  • 4
  • 13
2
votes
2 answers

.htaccess redirect sub-folders to the correspondent index.php

How can I redirect each request for a subfolder to the index.php in the same folder myserver.com/folder/subfolder1/test redirected to folder/subfolder1/index.php myserver.com/folder/subfolder2/test redirected to …
biltheone
  • 21
  • 1
  • 2
2
votes
1 answer

Why is apache -X stuck in a pselec6() NULL loop?

version 2.4 pselect6(0, NULL, NULL, NULL, {tv_sec=0, tv_nsec=100000000}, NULL) = 0 (Timeout) Repeats forever using strace. Only one httpd process enabled.