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)

Filter by
Sorted by
Tagged with
279 votes
7 answers
678k views

command for checking Apache configuration

I'm looking for a command that checks the validity of the config files in Apache server on both Debian and RHEL distros. I need to do this prior to restart, so there will be no downtime.
Sigtran's user avatar
  • 2,893
63 votes
4 answers
55k views

Purpose of Debian "sites-available" and "sites-enabled" directories?

Can anyone tell me—in a nutshell—what the purpose of these two directories are in Debian? /etc/apache2/sites-enabled /etc/apache2/sites-available I notice that diffing sites-available/000-default ...
aaaidan's user avatar
  • 732
44 votes
2 answers
37k views

Does Apache Webserver use log4j (CVE-2021-44228)?

Does the apache webserver (apache2) use log4j? I have Apache2 2.4.38 (debian) installed on Raspberry Pi OS (64bit) and found some strange records in my log regarding CVE-2021-44228 from kryptoslogic-...
gilex's user avatar
  • 523
25 votes
3 answers
9k views

Stop Apache gracefully

Is there a way to stop the Apache server without terminating executing requests, basically a way to tell it - don't accept any more connections and shut down when you finish your current ones?
php_nub_qq's user avatar
18 votes
5 answers
27k views

WSGI : Truncated or oversized response headers received from daemon process

System Configuration : Apache2, Django 1.10, Python 3, Ubuntu 16.04 LTS Django debug=True. /var/log/apache2/error.log [52:53.057967] [wsgi:error] [pid 4303] [client 1.1.1.22:24409] Timeout when ...
Suraj's user avatar
  • 449
14 votes
2 answers
11k views

Apache2: sites-enabled vs conf-enabled?

What is the difference between conf-enabled and sites-enabled (or conf-available and sites-available if you want to think of it that way)? When should a file go in one but not the other? Are they read ...
stone.212's user avatar
  • 277
14 votes
1 answer
4k views

Why does my Let's Encrypt certificate contain references to Cloudflare?

I own a website that uses a Let's Encrypt certificate. It's not behind Cloudflare, it's hosted at OVH and I'm accepting direct traffic from it. Now, I set up an apache2 webserver and used certbot to ...
lolc's user avatar
  • 153
13 votes
2 answers
11k views

apache2: Saves files on /tmp in a 'system-private-[hash]' instead of just saving folders as defined in the code

For some reason, when I try to save a file (generated by PHP under /www/appname/module) - it is saved under /tmp/systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-9h6i08 and when ...
Rick Sanchez's user avatar
12 votes
1 answer
19k views

Simple reverse proxy with Traefik

I'm currently using Apache as proxy for my LXD containers, using this kind of settings: <VirtualHost *:80> ServerName example.com ProxyRequests off ProxyPass / http://10.0.0.142/ ...
lepe's user avatar
  • 469
12 votes
1 answer
58k views

What is the difference between HTTP_HOST and HTTPS_HOST in apache .htaccess files?

I'm editing an .htaccess file.. In RewriteCondition for RewriteRules, HTTPS_HOST seems to only match urls that are accessed via https:// protocol (ssl). I saw in docs somewhere that it's a T/F ...
SherylHohman's user avatar
11 votes
2 answers
3k views

Does AWS offer a way to route HTTPS traffic to two different EC2 instances based on directory path?

I was wondering if the following is possible with AWS offerings? https://www.example.com/a/ -> served by Apache on EC2 Instance A https://www.example.com/b/ -> served by Apache on EC2 Instance B To ...
Joseph Shih's user avatar
11 votes
2 answers
454 views

Changing A record and CNAME records

Currently I'm using a LAMP configuration for both my landing page page, for the web app, and for the APIs. Now I'd like to split these things across multiple Virtual Servers (VS). I'm unsure of the ...
don's user avatar
  • 215
10 votes
1 answer
6k views

How can I forward requests from my web server?

This is a Canonical Question about reverse proxies, how they work and how they are configured. How can I serve requests from a service on a different port or from a different server with the same ...
Gerald Schneider's user avatar
10 votes
1 answer
10k views

Trying to get 100% in ssllabs.com key exchange

I wanted to know what steps are needed to get 100% on every category in ssllabs.com. I am aware that this could lead to problems in older systems, but I dont care. My letsencrypt.org certificate ...
feedc0de's user avatar
  • 269
10 votes
2 answers
15k views

What is the difference between default-ssl.conf and what is 000-default-le-ssl.conf?

default-ssl.conf is quite self-explanatory. I assume it's for default values that would be used when no vhost or other config overrides it. But what exactly is 000-default-le-ssl.conf file? Why is it ...
DominicM's user avatar
  • 251
8 votes
3 answers
24k views

"No space left on device: AH00023: Couldn't create the mpm-accept mutex" when restarting httpd

My server sometimes gets filled up with connections in apache stuck in a "Sending Reply" state, requiring me to restart apache. Most of the time this works, but sometimes I will get this ...
user548654's user avatar
8 votes
1 answer
14k views

Reason for "Gateway Timeout" (mod_wsgi)

I get "Gateway Timeout" 504: The gateway did not receive a timely response from the upstream server or application. I use apache with mod_wsgi Version 4.4.8. In the apache error log I see: ...
guettli's user avatar
  • 3,703
8 votes
1 answer
3k views

"systemctl start service" when service already started

I, what happen's precisely when you run systemctl start apache2 (or other service) while service already started ? Can it cause trouble to start several hundred times a day apache2 service? (to ...
user2267379's user avatar
7 votes
1 answer
2k views

Apache2 access.log has multiple lines that say "combine"

I'm running an Apache2 webserver on Ubuntu 20.04.2 LTS. I noticed that my access.log has several lines that simply say combine on them, with no information about the request or anything else. There ...
Noah Broyles's user avatar
7 votes
4 answers
5k views

How to migrate letsencrypt renewal from apache2 to nginx

I inherited a very new magento configuration from a previous employee (who left for another job) where I currently work. The original Magento was set up with v2.1.8 but I have had to update/upgrade ...
Scott's user avatar
  • 173
7 votes
3 answers
11k views

Reconfiguring PHP 5.6 to run on MacOS 10.13 High Sierra

I need to get PHP 5.6 running on a Mac that had to be updated to 10.13. So I reinstalled 5.6, verified its location, and added it to httpd.conf: LoadModule php5_module libexec/apache2/libphp5.so ......
CaymanCarver's user avatar
7 votes
2 answers
3k views

Apache's htcacheclean doesn't scale: How to tame a huge Apache disk_cache?

We have an Apache setup with a huge disk_cache (>500.000 entries, >50 GB disk space used). The cache grows by 16 GB every day. My problem is that the cache seems to be growing nearly as fast as it's ...
flight's user avatar
  • 394
7 votes
2 answers
9k views

Apache Virtual Hosts - Map different paths of the same domain (or IP) to different sites

I'm running Apache/2.4.29 (Ubuntu). I have only one domain name. I would like to map different sites to different paths after the domain name. For example: mydomain.com/test001 maps to /var/www/...
Roger 71's user avatar
  • 121
7 votes
3 answers
5k views

How can I remove IP addresses from log files after some time

I have an apache/nginx/whatever web server which logs client IP addresses to the access logs. Now these log files are rotated via logrotate. I want to keep the IP addresses for some days, then after ...
Michael Siebert's user avatar
7 votes
3 answers
4k views

Nginx 444 error eqivalent in Apache?

Is there any way to produce same Nginx 444 error in apache. Nginx 444--> Connection Closed Without Response. I like this error since if anyone tries to CURL he gets an empty response, but not so ...
Amanat's user avatar
  • 87
6 votes
2 answers
5k views

.htaccess - Exclude folder from basic auth protection

I have a website where no one is allowed to enter without entering the basic auth credentials. However, I need the media folder to be accessible by everyone, because we are using a third party ...
Black's user avatar
  • 491
6 votes
2 answers
6k views

Changing default Apache log permissions

For some development servers, I want to make all the Apache log files accessible via the web so developers can more easily debug. I've figured out how to modify the Apache site config to make the ...
Cerin's user avatar
  • 3,620
6 votes
2 answers
14k views

Redirect all urls to the root except /wp-admin and wp-json

I try to redirect all urls to the root except for the wordpress administration and the wordpress REST API. I have these rules in my .htaccess: <IfModule mod_rewrite.c> RewriteEngine On ...
Quentin Brosse's user avatar
6 votes
1 answer
7k views

How to have apache handle .well-known/acme-challenge and still have / passed to wsgi

In order to support automatic LetsEncrypt certificate renewal certbot uses the --apache handler. e.g. certbot renew --apache This handler installs a temporary VirtualHost for */.well-known/acme-...
Jay M's user avatar
  • 378
6 votes
2 answers
10k views

Unable to limit Apache server-status page to localhost

I am using Apache 2.4.18 on Ubuntu. I want to allow reading server status only from localhost. In /etc/apache2/mods-enabled/status.conf I have: <Location /server-status> SetHandler ...
Madoc Comadrin's user avatar
6 votes
1 answer
3k views

Virtual host not working AWS apache

I have following virtual host ( in apache2.conf file ) to load all subdomain from a single directory on AWS <VirtualHost *:80> DocumentRoot /var/www/html ServerName mydevsite.com ...
Vikram's user avatar
  • 167
6 votes
1 answer
6k views

Apache's mod_rewrite and PHP's REQUEST_URI variable

I have an issue with Apache passing to the PHP $_SERVER['REQUEST_URI'] variable the URL after it has been rewritten rather than the original one requested. I am doing this rewriting because I had a ...
Mg512's user avatar
  • 61
6 votes
1 answer
6k views

How to make mod_wsgi use Python 3.9?

I originally had Python 3.6 installed and working well with WSGI and Apache2 on my Linux server. Then I created a Flask app that had a dependency needing Python 3.7. I've successfully (and I think) ...
ThatCoolCoder's user avatar
5 votes
1 answer
4k views

Accidentally deleted /tmp/systemd-private-015eb2a30-apache2.service-9h6i

I accidentally deleted systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-9h6i08 from my /tmp folder: sudo rm -R /tmp/systemd-private-015eb2e9f67b4eef862c68e99fe0ba30-apache2.service-...
mah. nah.'s user avatar
5 votes
4 answers
4k views

Apache: Return static string for location

For a .well-known path, I want to return a static JSON file/string. With nginx, this seems to be possible without creating that file by specifying the content in the configuration file: location /....
anonymus1994.1's user avatar
5 votes
1 answer
6k views

Warning: DocumentRoot does not exist... But it does

I'm trying to host 3 sites with Apache in Ubuntu 20.04 but when I try connecting to them I get Not Found. The requested URL was not found on this server. This is my virtual host file <VirtualHost ...
Nico Nico Pizza's user avatar
5 votes
4 answers
30k views

Enable cross origin for subdomain

I have 2 subdomains, av.xyz.example and video.xyz.example. I want to enable CORS for video.xyz.example on av.xyz.example. I have added the following code snippet in the apache configuration file of ...
Rick Roy's user avatar
  • 247
5 votes
2 answers
3k views

Apache2 mod_substitute not working in <Location>

I have a working Reverse Proxy that is active only on a specific Location in my site, in this case for example: www.example.com/reverseproxy/site1 I am reverse proxying site1. I want to replace some ...
Paul_Rent's user avatar
5 votes
3 answers
1k views

apache2 sends corrupt responses when using a cifs-share

I have a problem with a ubuntu-instance (Ubuntu 20.04.1 LTS) and apache2 (Apache/2.4.41 (Ubuntu)). One virtual-host is serving some html-files and documents from a mounted cifs-share. The cifs-share ...
cklm's user avatar
  • 183
5 votes
3 answers
8k views

What is a good way to detect DoS and DDoS in Fail2Ban?

I am configuring Fail2Ban on my Ubuntu web server to prevent it from being a victim of DoS / DDoS. I don't want to use Cloudflare because I have to route my DNS over and use their SSl cert. ...
John Doe's user avatar
  • 343
5 votes
2 answers
10k views

Apache - Allow access to globally aliased directory without auth

I got a virtualhost, which has some access restrictions configured like this: <Location "/"> AuthType Basic AuthName "Restricted Content" AuthUserFile /var/www/domain/htdocs/....
Zulakis's user avatar
  • 4,213
5 votes
2 answers
6k views

debugging stuck apache/php thread on production server

I have a linux system with apache httpd and PHP which is loaded using LoadModule php5_module /usr/lib/apache2/modules/libphp5.so. I've enabled the mod_status module of apache and I see a particular ...
cherouvim's user avatar
  • 804
5 votes
1 answer
31k views

warning: /usr/lib/postfix/smtpd: bad command startup -- throttling

today i set up a mailserver with a german tutorial from here: Now i'm done and need help with my issues. Sry for bad english - i hope my informations help u to help me ^^ mail.log: Nov 18 16:30:00 ...
user avatar
5 votes
0 answers
186 views

Does the default Apache build not have PIE (position independent executable)?

I just built Apache from source, not something I usually do, and noticed that one of the build options was: --enable-pie This builds httpd as a Position Independent Executable which as I understand ...
Tyler Durden's user avatar
4 votes
2 answers
1k views

Can I use apache2 and memcache in same server?

I am really new to server development. I have a server (Server version: Apache/2.4.41 (Ubuntu)) for Django and it's running on apache2. I want to use Memcache for a large queryset. I just wanna use ...
Murat Demir's user avatar
4 votes
3 answers
25k views

apache multiviews, how to disable it

I have a OS X Snow Leropard Server running and I want to disable multivewis from Apache. I could add Options -MultiViews to each .htacces file I have, but I guess there must be a global option. ...
user avatar
4 votes
3 answers
5k views

Apache RewriteMap with URLs containing space doesn't work

I am actually using a RewriteMap directive inside my vhost to redirect a list of 800 URLs. It works quiet well: RewriteEngine On RewriteMap redirects dbm=db:/data/apps/project/current/configuration/...
COil's user avatar
  • 207
4 votes
1 answer
3k views

Is Apache with mod_http2 vulnerable to Http/2 Rapid Reset CVE-2023-44487

I can't find anything about this on the apache site, so I've disabled http/2 as a precaution. Any information how to secure Apache2 against this?
craigmj's user avatar
  • 143
4 votes
1 answer
12k views

Why is $_SERVER['HTTP_HOST'] sometimes example.com and sometimes example.com:443?

This is an Ubuntu server running PHP 7 on Apache, with a website which enforces TLS (using the standard port). To my understanding, https://example.com and https://example.com:443 are exactly ...
TRiG's user avatar
  • 1,181
4 votes
2 answers
2k views

How do I distribute HTTP traffic to the closest server?

This is kind of a two part question. So I have a DigitalOcean Droplet in Toronto with a lamp stack on it (with a website of course). I want to be create a snapshot of that droplet and deploy a clone ...
Kipplex-Chase's user avatar

1
2 3 4 5
36