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)
1,794
questions
286
votes
7
answers
736k
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.
63
votes
4
answers
56k
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 ...
44
votes
2
answers
38k
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-...
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?
19
votes
6
answers
29k
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 ...
17
votes
2
answers
12k
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 ...
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 ...
13
votes
2
answers
13k
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 ...
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/ ...
12
votes
1
answer
63k
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 ...
11
votes
2
answers
4k
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 ...
11
votes
2
answers
518
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 ...
10
votes
1
answer
7k
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 ...
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 ...
10
votes
3
answers
18k
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 ...
9
votes
2
answers
10k
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/...
8
votes
3
answers
27k
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 ...
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:
...
8
votes
1
answer
4k
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 ...
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 ...
7
votes
4
answers
6k
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 ...
7
votes
2
answers
15k
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
...
7
votes
1
answer
8k
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-...
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
......
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 ...
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 ...
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 ...
6
votes
4
answers
5k
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 /....
6
votes
2
answers
7k
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 ...
6
votes
2
answers
8k
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 ...
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 ...
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
...
6
votes
1
answer
7k
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 ...
6
votes
1
answer
7k
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) ...
5
votes
1
answer
5k
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-...
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 ...
5
votes
4
answers
35k
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 ...
5
votes
2
answers
4k
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 ...
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 ...
5
votes
3
answers
9k
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.
...
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/....
5
votes
1
answer
18k
views
How can I disable TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384 cipher in Apache2?
In SSL labs, I got that I'm using this "weak cipher":
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384
Now in Apache, this is the set of suites I have enabled:
SSLCipherSuite ECDHE-ECDSA-AES256-GCM-SHA384:...
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 ...
5
votes
1
answer
34k
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 ...
5
votes
0
answers
192
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 ...
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 ...
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. ...
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/...
4
votes
1
answer
4k
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?
4
votes
1
answer
635
views
Is there a way to share or reuse Apache configurations
I have the following directory structure on my Apache server
/var/www/domain.com/
index.html
site-1/
site-2/
.
.
.
site-N/
Each site uses the following configuration file, ...