Questions tagged [apache-2.4]
Version 2.4 of 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)
6,037
questions
0
votes
1
answer
109
views
Rewrite urls only for certain folder and remove parts of the url in Apache
I have an old project in PHP which I'm trying to modernize. The routing of the old project is just files on the server which you'd access via the url.
So for example a file placed in folder/subfolder/...
0
votes
0
answers
178
views
Two Virtual Hosts with to disntinct PHP configurations via PHP-FPM on Ubuntu and Apache
I have to Virtual Hosts on Ubuntu 20.04. One host is test instance and one is production (I know it would be better to have it separate). Now I need to run different php config for test vhost than for ...
0
votes
1
answer
161
views
Why rotatelogs from apache produce files smaller than specified max size?
I use the following rotatelogs command from Apache :
/usr/sbin/rotatelogs /var/log/somelogfile 1GB
If I send 1GB of content to it (for testing), it produces the following files :
somelogfile....
0
votes
0
answers
157
views
Apache 2.4.53 Getting AH00027: No authentication done but request not allowed without authentication for /CN=XXXX. Authentication not configured?
We have an Apache 2.4.53 and when they try to access it we are seeing a 500 error, and the following in the error_log file:
[Thu Jan 25 23:56:22.600893 2024] [core:error] [pid 24313:tid ...
0
votes
0
answers
41
views
HTTP to HTTP Apache2 Rewrite not being used
I want all traffic sent on HTTP redirected to port 443.
I curently have a Rewrite rule set up for port 80 in the sites-available apache2 directory but when I go to that address on that port it still ...
0
votes
0
answers
43
views
Convert auth config from apache http server 2.2 to apache 2.4
I have the following apache 2.2 configuration and need to transform it to apache 2.4.
<Location />
Order Deny,Allow
Deny From Env=TEST
Allow From Env=LOCAL
Allow ...
0
votes
1
answer
45
views
apache - Require HTTP basic auth on ScriptAlias Location
I have a ScriptAlias configured like so:
<VirtualHost *:443>
ScriptAlias /path/ "/path/to/bin/cgi"
</VirtualHost>
I want to use Apache to put a basic auth wall in front of ...
0
votes
0
answers
190
views
Getting 404 error for apache `/server-status`
I was told that there's a way to enable a url called http://<your host>/server-status and that this page would show you some operational metrics of the apache service. But every time I visit ...
1
vote
1
answer
124
views
Apache2 ForensicLog timestamp
I'm using apache2 with ForensicLog enabled by this directive below.
ForensicLog ${APACHE_LOG_DIR}/mysite.com.forensic.log
When I check the "mysite.com.forensic.log" file there is no ...
0
votes
0
answers
548
views
htaccess to stop Host Header Injection
I have one application hosted on XAMPP, my application url is https://abc.example.com/pps/prd/, i have htaccess file at pps/prd/, with following code to stop Host header injection
RewriteEngine On
...
0
votes
0
answers
184
views
Apache: "mpm_worker:error scoreboard is full, not at MaxRequestWorkers"
My enviroment:
Server with 4 OCPU and 16GB ram hosted on Oracle Cloud;
PHP-FPM 7.4.33 Server;
Apache/2.4.52 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2;
Ubuntu 22.04.3;
On this host I have 10 virtual ...
1
vote
2
answers
187
views
Django app hosted in Apache running on Windows - service won't start
I've found many similar articles with similar issues, and a couple of them concluded the Apache service just cannot be run at all for my situation. However I did get the service to run -- only it ...
0
votes
1
answer
354
views
PHP curl_init(), curl_exec() work from the command line but fail when browsed/accessed from a webserver
The following PHP script (when not anonymized) runs successfully at the commandline. It uses curl_init() and curl_exec() to retrieve JSON-formatted data, converts the result into an associative array, ...
1
vote
1
answer
107
views
httpd crash with ssl_io_filter_cleanup () from /usr/lib64/httpd/modules/mod_ssl.so
version: httpd-2.4.54-1.el8.x86_64
Core generated when i do httpd condrestart for a task and also i can see some ssl_error_logs which is related to the core file pid.
gdb logs:
Core was generated by `/...
0
votes
1
answer
113
views
Apache LogFormat: what does %f mean?
I have checked the apache logformat from - https://httpd.apache.org/docs/2.4/mod/mod_log_config.html
I am not able to understand what does "%f" parameter mean in apache log format. The ...
0
votes
0
answers
73
views
Apache custom rewrite rule, using code
I would like to have Apache handle some custom URL rewrite code that I have. This code rewrites the following urls:
https://www.example.com/request?data=SOMEDATABLOB
into urls pointing to PHP pages. ...
0
votes
1
answer
43
views
Single domain, two webservers running on different ports, two different SSL issuers possible?
Short, Can a domain have multiple SSL issuers installed on different servers ?
Long ,
I have a domain.
example.com
Its running on two different servers , two different websites, two different ports , ...
5
votes
2
answers
1k
views
Thousands of incoming HEAD requests - best way to handle with EC2?
I had unusually high https traffic recently from a couple of IP address with agents masquerading as Windows clients. I blocked the range via 'deny' inside of .htaccess (Apache 2.4)
I'm still getting ...
0
votes
1
answer
114
views
Gzip is enabled in developers tools but not working in Google Chrome light house
Here is the website is am working on
Website: https://www.mayfairparking.co.uk
gzip is enabled and chrome shows in developer tools which is fine and as per my expectations but when i test on light ...
0
votes
1
answer
404
views
Need to allow only specific file extensions via Apache config
I'm struggling with allowing only specific file extensions via Apache (2.4.58).
I'm doing this in httpd.conf.
The problem is if I deny all files at first either like that:
<Files *>
Require ...
0
votes
1
answer
51
views
Content negotiation, send webp request to Symfony when webp file does not exist
On Apache Httpd 2.4, I know that from a .htaccess file I can do this
RewriteCond %{HTTP_ACCEPT} image/webp
RewriteCond %{DOCUMENT_ROOT}/$1.webp -f
RewriteRule (.+)\.jpg$ $1.webp [T=image/webp]
in ...
0
votes
0
answers
85
views
Apache2 do not use dash as character representing null, but just empty string
I defined a custom log for my Apache server, where I log some headers. I've noticed that Apache instead of just using an empty string, it logs non-existent values as "-" dash. I understand ...
2
votes
0
answers
251
views
Default <files ".ht*"> doesn't work, but <files '^.ht'> does
I was able to download my .htaccess file despite httpd.conf contains the following lines.
<Files ".ht*">
Require all denied
</Files>
When I changed it to this, it works as ...
0
votes
0
answers
387
views
AH01382: Request header read timeout -> locate slow-served resources
The log files of some low-use apache web servers are polluted by lines like:
[reqtimeout:info] [pid 995890:tid 140198394422976] [client 37.103.75.185:49577] AH01382: Request header read timeout
VM is ...
2
votes
1
answer
130
views
Why does apachectl stop take a very long time to finish?
I have a freshly installed CentOS 9 with Apache, and found that apachectl stop take very long to finish (as in always 1m30s).
I don't really have any clue where to look, I don't see any CPU bound ...
0
votes
1
answer
193
views
mod_expires ignores webp and avif expiry/cache settings
I spent an hour or so diagnosing this problem today, and thought the solution might be helpful to others.
Apache's response headers were giving webp and avif files the default expiration (60 seconds), ...
0
votes
1
answer
124
views
How can I identify why my apache server getting killed once in every few days?
I have an Ubuntu 22.04 lts vps (Contabo) with apache installed. Basic install, nothing really edited or configured.
Every few day, the apache gets killed by the OOM killer and I don't know what ...
0
votes
0
answers
23
views
Apache httpd: interaction of If and Require directives
What exactly can you put inside an <If> directive, and how does it affect any enclosed Require statements?
The test config below is intended to serve two files (/var/www/data/foo.txt and /var/...
0
votes
0
answers
180
views
Is there a Apache module can fully log HTTP requests, in a non processed way?
I'm looking for an Apache module that is able to log the RAW content of HTTP requests, unprocessed. Here is one example :
POST https://foobar/ HTTP/1.1
Host: foorbar
Connection: keep-alive
Content-...
0
votes
0
answers
112
views
/~ URL pages will not load, but full path /.../..../ will load - security issu
I am pretty new to Apache - New sys admin that inherited a broken server and I've been slowly making it work.
We have the default directory that is hosting staff webpages and is working normally.
The ...
0
votes
1
answer
129
views
Application actions based on URL
I am sorry if this question was already asked, but I do not know how to frame it differently - none of my searches found something that answers this.
I am currently using Windows 11 and XAMPP, with ...
0
votes
1
answer
92
views
Apache Bad Request (400) and time shift in logfile
My web server utilizes Apache and Django for its web service. Occasionally, the web service produces a "Bad Request (400)" error. After reviewing the error log, I noticed that there is a 6-...
0
votes
2
answers
284
views
configuring SSL for two different applications on same server: web server and python
I want to run SSL for web server https://www.domainname.com on port 443 and python REST api server https://mgmt.domainname.com with Flask. I have configured Apache SSL and it is running on 443. I ran ...
1
vote
0
answers
55
views
Apache: require with satisfy, and v2.5 compatibility
I want to protect an entire server with Require valid-user, but I want to allow certain resources to be accessible without a login. For the sake of argument, say that files A, B, and C should be ...
0
votes
1
answer
56
views
Virtual Host SSL and nonSSL with Proxy
I have 1 nonSSL server and many SSL with Proxy in Apache.
Configuration SSL server:
<VirtualHost *:443>
ServerName test.com
ServerAdmin [email protected]
ErrorLog ${...
0
votes
2
answers
436
views
Mitigation of a Slow Loris Attack (slow HTTP request DDoS)
I am being targeted by a slow loris attack for several weeks now (during the worst period of the year [black friday / cyber monday]).
This is an advanced DDoS attack where I get a lot of slow HTTP ...
0
votes
0
answers
158
views
How Do You Block & Unblock Internet Sites in Apache?
How do you block all internet sites and only let some sites through in Apache Proxy?
I want to block all sites except some (e.g. updatemicrosoft.com, .windowsupdate.com , google.it etc.)
I have ...
0
votes
0
answers
197
views
Wordpress site on localhost WAMP "This site can´t be reached this connection was reset ERR_CONNECTION_RESET"
I've been working on a WordPress site on localhost using WAMP. My site was slow and I saw that it would get faster if I unchecked the cgi Apache module. Now, none of my local WordPress sites load ...
0
votes
1
answer
97
views
Very low resource usage on Openlitespeed (LOMP) on Ubuntu 22.04
I have been testing a custom PHP script on LOMP (Ubuntu 22.04) running on VirtualBox (2GB/2Core). First, I tried Apache and upon benchmarking the script, it could complete 10K requests in ~36s - ab ...
0
votes
1
answer
51
views
Access Forbidden 403 no search permission for the directory
I installed the Apache server on Manjaro (no tag for it, Arch is the closest). It works well. I added a virtualhost and tried to set directory permissions with chmod, but no luck. I got 403 error when ...
0
votes
1
answer
221
views
Apache + PHP with mod_php No timeout
I am actually working on Apache server 2.4 with PHP 8.2 (mod_php) & debian 11.2
Recently I sent a HTTP Request with more than 100 seconds without a timeout. This request executed a large MySQL ...
0
votes
1
answer
182
views
Use ProxyPass only if remote address is in subnet
I have a php application running with a mostly default config that lives in var/www/html/app:
<VirtualHost *:443>
ServerName myhost.com
DocumentRoot /var/www/html
<Directory "...
0
votes
2
answers
593
views
Trying to update the httpd version on AWS Linux - Yum says no update?
Im trying to upgrade the httpd version on my amazon EC2 instance because our security team asked me to do so.
Can anyone advise the easiest way to upgrade the httpd module?
I was told I needed to ...
0
votes
0
answers
76
views
In what order does Apache evaluate `RedirectRule` when provided by virtual host, directory context and .htaccess?
I have several RewriteRule inside <VirtualHost>, inside the <Directory> directive which belongs to the web root of said <VirtualHost> and inside .htaccess of that directory.
Question:...
0
votes
0
answers
374
views
CentOS - Apache MaxRequestWorkers issue
I've had a problem with Apache since this morning, I can no longer access the websites.
I get the error: server reached MaxRequestWorkers setting, consider raising the MaxRequestWorkers setting
I'm ...
0
votes
1
answer
124
views
Get Apache to serve example.com from a directory and all subdomains *.example.com to be ProxyPass / http://localhost:8050
Running Apache 2.4.58
I need to get Apache to serve example.com from a directory and all subdomains *.example.com to be ProxyPass / http://localhost:8050 (so they can be served from another web server ...
0
votes
2
answers
470
views
IF statement based on comparison with %{REQUEST_URI} in .htaccess doesn't work
I'm trying to send a custom header for pages that start with /test-live/
The code I tried:
<If "%{REQUEST_URI} =~ m#^/test-live/#">
Header always set X-Frame-Options "...
0
votes
2
answers
234
views
websockets apache2 not working
I'm busy with implementing websockets on our reverse proxy (apache2) we redirect our traffic to tomcat with a proxypass but it's not working we get an 403 (forbidden in our logs)
apache vhost file:
&...
0
votes
3
answers
426
views
Apache redirect http://%{HTTP_HOST}:%{SERVER_PORT}/%{REQUEST_URI} to https://%{HTTP_HOST}%{REQUEST_URI}
I am attempting to redirect
<VirtualHost *:5555>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{SERVER_PORT} =5555
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=...
0
votes
1
answer
104
views
Weird 301-redirect to http from https only happening with CF as proxy on /wp-admin on www subdomain
I have a wordpress blog on an EC2 instance on AWS using the AMI image aws-marketplace/bitnami-wordpress-6.3.2-6-r09-linux-debian-11-x86_64-hvm-ebs-nami-7d426cb7-9522-4dd7-a56b-55dd8cc1c8d0
In ...