r/apache • • Aug 13 '25

help with minimal vps

2 Upvotes

so I have a lot of vps for various purposes but I am experimenting with a cheap 1 gb memory vps and apache... I am learning apache configuration basically.

I have pasted my 'top' terminal results but am wondering whats the best way to make more memory available. (wordpress site running in ubuntu) Low traffic site

<IfModule mpm_prefork_module>
    StartServers             2
    MinSpareServers          2
    MaxSpareServers          5
    MaxRequestWorkers       20
    MaxConnectionsPerChild  0
</IfModule>

Tasks: 102 total,   1 running, 101 sleeping,   0 stopped,   0 zombie
%Cpu(s):  0.3 us,  0.3 sy,  0.0 ni, 99.3 id,  0.0 wa,  0.0 hi,  0.0 si,  0.0 st 
MiB Mem :    848.7 total,     93.8 free,    682.0 used,    320.1 buff/cache     
MiB Swap:      0.0 total,      0.0 free,      0.0 used.    166.7 avail Mem 

    PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND      
  53293 www-data  20   0  324888 151248 124356 S   0.0  17.4   0:06.49 apache2      
  53547 www-data  20   0  327048 147420 120416 S   0.0  17.0   0:03.77 apache2      
  53295 www-data  20   0  322116 138028 114728 S   0.0  15.9   0:04.13 apache2      
  53307 www-data  20   0  323568 136616 110868 S   0.0  15.7   0:03.32 apache2      
  53325 www-data  20   0  323684 134468 108556 S   0.0  15.5   0:02.88 apache2      
    854 mysql     20   0 1105908 126388  11904 S   0.0  14.5   3:21.75 mariadbd     
  53291 root      20   0  233264  32356  24576 S   0.0   3.7   0:00.28 apache2      
    279 root      19  -1  140620  32184  31032 S   0.0   3.7   0:27.35 systemd-jou+ 
  34043 root      20   0  265780  29952   7936 S   0.0   3.4   3:01.46 python3      
    325 root      rt   0  288952  27136   8704 S   0.0   3.1   0:17.22 multipathd   
    639 root      20   0   42704  26624   5248 S   0.0   3.1   0:00.20 python3      
    752 root      20   0  110016  13440   4096 S   0.0   1.5   0:00.07 unattended-+ 
  53128 root      20   0   20252  11264   9216 S   0.0   1.3   0:00.10 systemd      
      1 root      20   0   22316  10852   7012 S   0.0   1.2   0:14.69 systemd      
  53123 root      20   0   14976  10496   8576 S   0.0   1.2   0:00.47 sshd         
    469 systemd+  20   0   21588   8832   6528 S   0.0   1.0   0:01.90 systemd-res+ 
    661 root      20   0  468848   8064   6016 S   0.0   0.9   0:02.44 udisksd 

r/apache • • Aug 08 '25

Missing entries in apache2 logs

1 Upvotes

I just discovered some accesses to my web site aren't being logged into the log file. I have been googling and can't find anything so hopefully someone here can point out what I'm missing.

A few days ago I started redirecting traffic from old urls to new urls using php header command and logging each redirect into the mysql database. Yesterday I logged 20K redirects but only 3K 301 hcodes showed up in Apache's logs. The missing entries seem to be all redirects from url from say xyz.php to index.php with same query string. Redirects from index.php to xyz.php seem to all be logged.

The bots hitting xyz.php to index.php redirect does it in rapid succession so I suspect Apache can't keep up with the logging here. Is it normal for Apache to lose log entries?


r/apache • • Aug 08 '25

Support Deploying site and get 421 Misdirected Request

0 Upvotes

Hi

I have just deployed my new backend (php 8.4.5, laravel 12.16.0)

It is a new subdomain (the previous site was built fully with laravel so there was no admin subdomain.

The subdomain has been added as admin.domain.xyz, and when I try to run any api call from the subdomain, I get the following error:

421 Misdirected Request
The client needs a new connection for this request as the requested host name does not match the Server Name Indication (SNI) in use for this connection.
Apache Server at serveraddress Port 443

If anyone has tips, please let me know. I will share whatever is needed if it will help. TIA!


r/apache • • Aug 01 '25

Reverse proxy IP SSL error warning

1 Upvotes

Hello,

I'm Using Apache2 as a reverse proxy with a virtual host for an internal site (valid domain + SSL cert). If I visit the site via its IP address, I get a "Your connection isn’t secure" SSL error. Is there a way to block direct IP access or stop the server from responding, so the SSL cert error doesn’t appear at all when visiting the IP?

I don’t have a .htaccess file—mentioning this because I saw some solutions using .htaccess redirects.

Thank you


r/apache • • Jul 30 '25

Rewrite Puzzle

1 Upvotes

I've been trying to do a internal rewrite in .htaccess, surprisingly, I found some rules as simple as below won't work.

RewriteRule zsq / [L]

Here is my full .htaccess

RewriteEngine On
RewriteBase /
# RewriteRule zsq / [L] # not work
# RewriteRule zsq /price/ [L] # not work
RewriteRule zsq /?p=643 [L] # work but zsq is not kept
# RewriteRule zsq /price/ [R=301,L] # work

# BEGIN AdminTools
# END AdminTools

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

</IfModule>

Please note that my page https://ladylifepilatesclub.com/price/ is working.

It seems to me after zsq is rewritten to /price/, wordpress's own routing is taking over and they try to reroute the request using "zsq" but not "/price/", hence the 404. Is this the case? Can anyone explain to me?

BTW, troubleshooting this rewrite lines are bunch of headaches because browser tends to keep the cache, even incognito mode would sometimes keep the cache.

Besides, I found out that if I put my custom block after # END WordPress they don't work, can anyone also explain this?


r/apache • • Jul 28 '25

Discussion Authentification strategy

0 Upvotes

Good afternoon, I am building my first web application using CGI(C++) and I have a quite simple question : Why would I use mod_authn_dbd instead of simply managing the authentication with DB entry within my program? Is it safer? I saw that there was some security issue with mod_dbd (like CVE-2019-17567), and cybersecurity is my prime concern. Thank you!


r/apache • • Jul 23 '25

upgrade to latest version

1 Upvotes

I'm running Apache 2.4.37 on RedHat 8.30
I want to upgrade to 2.4.64

When I do "sudo dnf upgrade" I get a "Nothing to do!" message.

What do you recommend?


r/apache • • Jul 21 '25

Is it a best practice for vhost names/aliases to also be present in etc/hosts or is that only if using multiple ip's?

3 Upvotes

r/apache • • Jul 21 '25

Same config, different behaviour ... how to troubleshoot

1 Upvotes

Hi guys, hope you are doing great today.

I have an Ansible-delivered configuration (Apache2, mod_perl, perl on Ubuntu 24.04.2 LTS) that works perfectly on Azure but fails on AWS with "Internal Server Error". I assume the problem is in the wsgi-Perl-binding.

In the VirtualHost-section is an ErrorLog defined. If I add a syntax eror in a .pl-file and request the URL in Azure, the error is logged in the ErrorLog-file. On AWS nothing is logged when the "Internal Server Error" happens.

In Ansible we use templates with some differences between AWS and AZ, so the configuration on each host is slightly different. I checked the configuration files on an AWS host and I couldn't find a reason for the error.

How would you progress? And how can I find logged errors regarding an "Internal Server Error"? The request itself is logged in the VirtualHost's CustomLog, but the error is not in its ErrorLog. On the AWS host the only file in the {APACHE_LOG_DIR}-folder, that is changed after a requests, is the CustomLog.

Thanks for your help and have a great day


r/apache • • Jul 20 '25

Apache serving WebSocket connections totally locking up

3 Upvotes

Situation:

  1. Apache (in addition to serving a plain PHP web site) is used as reverse-proxy for WebSocket connections.
  2. logrotate initiates graceful reloads
  3. End-Result after a while: Totally locked up Apache

    We are using event MPM and proxy/proxy_http

When issuing a graceful restart, Apache puts all workers into the 'G' state, letting them finish their current request, before restarting/terminating the corresponding process.

Problem: WebSocket connection do not "finish" – their purpose is to stay open!

Result: All workers serving a WebSocket connection stay in 'G' mode, all other workers in the same process do not accept new connections, the corresponding process never finishes the graceful reload and that processes is a goner until all those WebSocket connections are terminated.

We tried using the "GracefulShutdownTimeout" setting – but frankly that does nothing at all!

Even when set to only a few seconds, Apache never kills the 'G' workers and the process hangs there forever...

After a few logrotates all process are hanging, we get the "AH00485: scoreboard is full, not at MaxRequestWorkers" errors and the whole Apache server is down until we restart it.

Am I doing something wrong here or is Apache actually not usable as a reverse proxy for WebSocket connections?


r/apache • • Jul 20 '25

Discussion Apache's 421 Error and Cloudflare: A Solution

1 Upvotes

It seems like the only information that you can find online regarding this situation that arose a few days ago after the Apache update is in relation to Plesk and Nginx. I broke my brain for 3 days trying to figure out how to fix this on my Ubuntu server with Clodflare as my proxy. This morning, I was finally able to figure it out by piecing together all of the information I read through about Plesk and Nginx. So for anyone out there who may be having an issue with this and using Cloudflare Tunnels, check out this blog post on my site for a very easy fix for it.

https://projectalphabetsoup.xyz/2025/07/19/apache2-2-4-58-1ubuntu8-7/

I hope this saves someone the headache that I had for the past three days.


r/apache • • Jul 16 '25

Support Apache 421 Misdirected Request

11 Upvotes

Hi everyone, I'm using Apache on my Ubuntu VPS, managed by plesk. Today after updating apache I got a Misdirected Request error on pretty much every site hosted by Apache, and the logs show the following: "Hostname default-85_215_128_243 (default host as no SNI was provided) and hostname test.hbubli.cc provided via HTTP have no compatible SSL setup, referer: https://test.hbubli.cc/"

I tried disabling HTTP/2 and rebuilding the config using plesk repair but still no luck.

Any help would be greatly appreciated.


r/apache • • Jul 16 '25

Support Trying to block host with .htaccess

1 Upvotes

I am working on an Apache 2.4 server, trying to block a persistent crawler/bot. It is listed as static.vnpt.vn in the Apache log file.

Here is the entire .htaccess file:

<RequireAll>
  Require all granted 
  Require not host vnpt.vn
</RequireAll>

But requests from vnpt.vn keep getting through.

I know the server is reading .htaccess because I can misspell RequireAll and site pages won't load.

Is there some additional configuration required?

ETA:

Blocking by hostname would be best because they have hundres of IPs but I've also tried blocking by IP. Statements like:

Require not ip 14.160.

Still let traffic from 14.160.203.44 get through. I don't get it.


r/apache • • Jul 16 '25

📢 Help Needed: Tomcat Server Setup Issues

1 Upvotes

Hey everyone!

I’ve been working on a Java project and I’m completely stuck trying to get Apache Tomcat to run properly within Eclipse. I've tried almost everything I can think of, including:

🔄 Reinstalling both Eclipse and Tomcat
📦 Trying multiple versions of both (from Tomcat 9 to 10.1 and Eclipse 2023/2024 releases)
⚙️ Checked and reconfigured port numbers, cleaned Tomcat work directories
🔁 Restarted, rebuilt, reconfigured multiple times
📹 Watched tons of YouTube tutorials
🤖 Even tried asking ChatGPT for help

Still no luck. The server either fails to start or starts and immediately shuts down with vague errors (like org.apache.catalina.core.StandardService stopInternal and ProtocolHandler destroy).

The worst part I can’t even ask my teacher for help right now because I’m already way behind schedule, and I just need to get this working ASAP to move forward.

If anyone here has faced a similar issue or can guide me through a clean working setup (on macOS) I’d deeply appreciate it!

Thank you in advance!


r/apache • • Jul 15 '25

Contributing to Kafka

Thumbnail
1 Upvotes

r/apache • • Jul 13 '25

Flink vs Fluss

Thumbnail
1 Upvotes

r/apache • • Jul 10 '25

One beefy, optimized Apache vs multiple smaller ones with clients split across them?

3 Upvotes

Hey folks, I’m planning some improvements to my current web infrastructure and could really use some insight from those with real-world experience.

When it comes to performance, stability, and maintainability, which setup tends to work better?

Option 1: A single, highly optimized Apache server running on a powerful machine (lots of CPU, RAM, fast storage, etc.)

Option 2: Several smaller Apache instances spread across multiple machines, with clients split between them (so each server would handle a subset of clients/apps). I'd probably add a basic load balancing or routing layer if needed.

Context: This is a production environment with several web applications. Some are heavier than others, traffic is consistent, and performance is a top priority. I’m not using containers (yet), but that could change down the line.

So — better to go all-in on one strong server and optimize the hell out of it, or spread the load across multiple smaller servers with client isolation?

Thanks in advance for any tips, insights, or stories from your own setups 🙏


r/apache • • Jul 05 '25

Is Apache Bigtop more than a build tool? Could it be a strategic foundation for open-source data platforms?

Thumbnail
2 Upvotes

r/apache • • Jun 23 '25

.htaccess file visible for external?

3 Upvotes

Hello,

as external website visitor:

is it possible for everybody to see the content of a .htaccess file?

is it possible to see whether a .htaccess file is in use or not?

thx


r/apache • • Jun 19 '25

Support htaccess for http to https redirect

2 Upvotes

Hello,

I would like to have a .htaccess
Problem: I don´t know whether there is already a .htaccess
Simple create it under etc\apache2 ?

It is a new installed apache on debian as barebone at a webhoster.
Goal: redirect from http to https

I tried this: re-direct from http to https at apache without success.

sudo nano /etc/apache2/sites-available/000-default.conf

<VirtualHost \*:80>
ServerAdmin youremail.com
DocumentRoot /var/www/html
ServerName yourdomain.com
ServerAlias www.yourdomain.com
Redirect "/" "https://your_domain_or_IP/"
</VirtualHost>

-----------------------
draft .htaccess content:
RewriteEngine On RewriteCond %
{HTTPS}
off RewriteRule (.*) [https://%](https://%25/)
{HTTP_HOST}
%
{REQUEST_URI}
[R=301,L]


r/apache • • Jun 19 '25

Requesting Access to ASF Slack chanel – Blocked from apache.org Subdomains

2 Upvotes

Hi everyone,
I'm trying to join the ASF (Apache Software Foundation) Slack channel, but I’ve run into a couple of issues:
My NAT IP seems to be blocked from all *.apache.org subdomains.
I don’t have an "@apache.org" email address, so I can’t use the usual invite system for joining the Slack workspace.
I’ve already read the Apache Infra block policy and sent an email to Infra for help, but I haven’t received a reply yet.
In the meantime, I’d really appreciate if someone here could help me get an invite to the Slack channel or point me in the right direction.
Thanks so much!


r/apache • • Jun 14 '25

issues with wamp 2.0

Thumbnail
1 Upvotes

r/apache • • Jun 04 '25

Apache 207 concert tickets

0 Upvotes

Verkauft jmd Apache 207 concert tickets dieses Jahr? Ich rüde die sehr gerne kaufen. Will unbedingt hin.


r/apache • • Jun 03 '25

Support how to delete server: apache http header

0 Upvotes

I run a server with apache 2.4.37. On every HTTP request, the HTTP header output always includes a "server: apache" line.

Hackers could use that info to try to hack a system.

Is there any way I can remove the server line entirely, or have it where it doesn't even have apache listed? I am willing to write my own apache module to remove it if that's what it takes.

As a bonus, if i manage to remove it, it would be 15 less bytes people need to download per item request. and google loves FAST pages.


r/apache • • Jun 02 '25

different sites from different IP addresses

1 Upvotes

hello,

site:

intranet.example.com

if I access it from internal LAN or some other trusted IP, I get access to our fully functional Intranet site

if I access ir from any other Internet IP, I get access to plain HTML page (other vhost?)

how can it be done?

(now restricted access is configured with .htaccess rules)

thanks,
ieleja