• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

Resolved Lots of 404 errors for new WordPress sites

marowi

New Pleskian
Server operating system version
Ubuntu 20.04.4 LTS
Plesk version and microupdate number
Plesk Obsidian Version 18.0.45
Hey guys,

we have been using Plesk for years and it works pretty well until now.

Since a few days we have a lot of 404 errors for new WP sites created with WordPress Toolkit. Even for clean installs without plugins.

The 404 error pages appear in both the frontend and backend of WordPress. After a few attempts to refresh the browser, the page is shown correctly. But after a few more page loads, the 404s reappear. This is not the case with older WP sites that we have created in our Plesk environment.

I have already compared the domain/hosting settings for a working WP site in Plesk and cannot see any difference. We are currently using PHP 7.4.30 FPM-Apache. PHP 8.0.22 did not work either.

We also have permalinks and .htaccess for all sites. For example:

1660304537778.png

There is nothing special. And all domains are secured with Lets encrypt.

We also tried disabling ModSecurity for this new WP site, but that didn't help either. Sometimes we also see the Plesk Web server's default page. As if there is nothing installed on this domain. But that is not the case. After a few F5s, the page is displayed. And then later disappears again. In the WP backend, the page often looks broken because some CSS/JS files are not loading properly because there are 404 errors for that.

Do you have any idea what I can look for or what is happening there?

I would be very grateful for any help.

Best regards
Manuel

Edit: The new WP sites are all created as subdomains. But so are the working ones too.
 
Have you checked the error_log of those websites? That should give you some clues as to why you're getting the 404's.
 
Error logging is enabled:

1660306789910.png
And this is what I got with the command:

Code:
root@plesk:/var/www/vhosts/system/hrn-dev.mr2-media.de/logs# tail -f error_log
[Fri Aug 12 12:34:59.874372 2022] [ssl:warn] [pid 833275:tid 140237193309248] AH01909: hrn-dev.mr2-media.de:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 12 12:34:59.874678 2022] [ssl:warn] [pid 833275:tid 140237193309248] AH01909: hrn-dev.mr2-media.de:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 12 12:37:48.137483 2022] [:error] [pid 561818:tid 140236470327040] [client 178.62.7.249:0] [client 178.62.7.249] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.env" at REQUEST_URI. [file "/etc/apache2/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "120"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "hrn-dev.mr2-media.de"] [uri "/.env"] [unique_id "YvYtfAJPaxjkXlg6Yff1NAAAAEs"]
[Fri Aug 12 12:37:48.137670 2022] [:error] [pid 561818:tid 140236461934336] [client 178.62.7.249:0] [client 178.62.7.249] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.git/" at REQUEST_URI. [file "/etc/apache2/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "120"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "hrn-dev.mr2-media.de"] [uri "/.git/config"] [unique_id "YvYtfAJPaxjkXlg6Yff1NQAAAEw"]
[Fri Aug 12 12:37:48.152341 2022] [proxy_fcgi:error] [pid 561818:tid 140236453541632] [client 178.62.7.249:0] AH01071: Got error 'Primary script unknown'
[Fri Aug 12 12:38:51.627027 2022] [:error] [pid 561817:tid 140236772333312] [client 179.43.155.171:0] [client 179.43.155.171] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.git/" at REQUEST_URI. [file "/etc/apache2/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "120"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "hrn-dev.mr2-media.de"] [uri "/.git/config"] [unique_id "YvYtu@0chLBkYnuNKs0PNQAAAMg"]

Seems like an issue with SSL certificate.
 
fail2ban is enabled, but I can not find my IP in this log file.

Also not in the list of blocked IPs on the Plesk (Fail2Ban) settings page.
 
Is your server IP address in the Fail2ban whitelist? It could the server itself that is getting blocked by Fail2ban.

One last thing you can try is to open the browser console: are there any related errors/warnings when you get the 404 error?
In Firefox: Tools -> Browser Tools -> Webdeveloper Tools -> Console
 
I have added my IP (ipv4 and ipv6) to the whitelist now. And the server IPs are also added by default.

If the backend is broken, it looks like here:
1660310967665.png

But sometimes there is also only a blank 404 page:
1660311014797.png

It is the same in Firefox and on my colleague's computer.
 
The thing is, I'm working on other projects/subdomains on our server with absolutely no issues.

But the last two WP instances created this month are making these 404 errors.
 
Just tried it for the latest two WP instances:

1660313346868.png

This weekend I will try to install a new WP site without using WordPress Toolkit. I can not imagine it makes a difference. But maybe it's worth a try.
 
I have just installed a fresh WP instance without WordPress Toolkit and it's the same issue. Constantly 404 errors.
 
This is from the logs:

Code:
root@plesk:/var/www/vhosts/system/hrn2-dev.mr2-media.de/logs# tail -f error_log
[Fri Aug 12 16:37:06.882983 2022] [ssl:warn] [pid 833275:tid 140237193309248] AH01909: hrn2-dev.mr2-media.de:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 12 16:37:06.883443 2022] [ssl:warn] [pid 833275:tid 140237193309248] AH01909: hrn2-dev.mr2-media.de:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 12 16:38:49.469559 2022] [:error] [pid 586346:tid 140236646508288] [client 194.233.164.30:0] [client 194.233.164.30] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.git/" at REQUEST_URI. [file "/etc/apache2/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "120"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "hrn2-dev.mr2-media.de"] [uri "/.git/config"] [unique_id "YvZl@S8BBYDkM39xtl4lgwAAAMU"]
[Fri Aug 12 16:38:49.473670 2022] [authz_core:error] [pid 586361:tid 140235690198784] [client 194.233.164.30:0] AH01630: client denied by server configuration: /var/www/vhosts/mr2-media.de/hrn2-dev.mr2-media.de/server-status
[Fri Aug 12 16:38:49.479773 2022] [proxy_fcgi:error] [pid 586361:tid 140235673413376] [client 194.233.164.30:0] AH01071: Got error 'Primary script unknown'
[Fri Aug 12 16:39:38.467651 2022] [:error] [pid 586361:tid 140236772333312] [client 179.43.155.171:0] [client 179.43.155.171] ModSecurity: Access denied with code 403 (phase 1). Matched phrase "/.git/" at REQUEST_URI. [file "/etc/apache2/modsecurity.d/rules/comodo_free/02_Global_Generic.conf"] [line "120"] [id "210492"] [rev "3"] [severity "CRITICAL"] [tag "CWAF"] [tag "Generic"] [hostname "hrn2-dev.mr2-media.de"] [uri "/.git/config"] [unique_id "YvZmKveWa6DEcQzkgGDmpAAAAEY"]
[Fri Aug 12 17:57:49.916617 2022] [autoindex:error] [pid 587059:tid 140236886726400] [client 2a02:8109:a4c0:c7e:5c63:7f14:6219:8ffe:0] AH01276: Cannot serve directory /var/www/vhosts/mr2-media.de/hrn2-dev.mr2-media.de/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.shtml) found, and server-generated directory index forbidden by Options directive, referer: https://plesk.mr2-media.de/
[Fri Aug 12 17:57:52.004163 2022] [autoindex:error] [pid 587059:tid 140236705191680] [client 2a02:8109:a4c0:c7e:5c63:7f14:6219:8ffe:0] AH01276: Cannot serve directory /var/www/vhosts/mr2-media.de/hrn2-dev.mr2-media.de/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.shtml) found, and server-generated directory index forbidden by Options directive, referer: https://plesk.mr2-media.de/
[Fri Aug 12 17:57:52.548428 2022] [autoindex:error] [pid 587059:tid 140236738762496] [client 2a02:8109:a4c0:c7e:5c63:7f14:6219:8ffe:0] AH01276: Cannot serve directory /var/www/vhosts/mr2-media.de/hrn2-dev.mr2-media.de/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.shtml) found, and server-generated directory index forbidden by Options directive, referer: https://plesk.mr2-media.de/
[Fri Aug 12 17:57:55.280164 2022] [autoindex:error] [pid 587059:tid 140236638050048] [client 2a02:8109:a4c0:c7e:5c63:7f14:6219:8ffe:0] AH01276: Cannot serve directory /var/www/vhosts/mr2-media.de/hrn2-dev.mr2-media.de/: No matching DirectoryIndex (index.html,index.cgi,index.pl,index.php,index.xhtml,index.htm,index.shtml) found, and server-generated directory index forbidden by Options directive, referer: https://plesk.mr2-media.de/
 
Hey guys,

we have been using Plesk for years and it works pretty well until now.

Since a few days we have a lot of 404 errors for new WP sites created with WordPress Toolkit. Even for clean installs without plugins.

The 404 error pages appear in both the frontend and backend of WordPress. After a few attempts to refresh the browser, the page is shown correctly. But after a few more page loads, the 404s reappear. This is not the case with older WP sites that we have created in our Plesk environment.

I have already compared the domain/hosting settings for a working WP site in Plesk and cannot see any difference. We are currently using PHP 7.4.30 FPM-Apache. PHP 8.0.22 did not work either.

We also have permalinks and .htaccess for all sites. For example:

View attachment 21381

There is nothing special. And all domains are secured with Lets encrypt.

We also tried disabling ModSecurity for this new WP site, but that didn't help either. Sometimes we also see the Plesk Web server's default page. As if there is nothing installed on this domain. But that is not the case. After a few F5s, the page is displayed. And then later disappears again. In the WP backend, the page often looks broken because some CSS/JS files are not loading properly because there are 404 errors for that.

Do you have any idea what I can look for or what is happening there?

I would be very grateful for any help.

Best regards
Manuel

Edit: The new WP sites are all created as subdomains. But so are the working ones too.
  • Clear the browser cache and cookies.
  • Set your permalinks.
  • Make a default. htaccess file.
  • Set up a 301 redirect.
  • Disable plugins and themes.
  • Change and update the WordPress URL in the database.
  • Fix the error on local servers.
 
Sorry for bumping this solved post but I just had the same exact issue. I have a server with 20 domains and a few subdomains. I noticed something was wrong when creating a new WordPress site a little while ago but the site was only a coming soon page so I didn't think much of it.

Recently I started a staging site for a client and noticed it was 404 on almost every 3 to 5 requests. Then I checked back on the old coming soon page and realized it was doing the same thing. The strange part about it all is that all of the other websites on the server ran just fine. Also nothing would show up on the Apache or nginx logs for those sites with the 404 errors.

Luckily it was an easy fix as the OP discovered to just restart the server. I'm sure the issue will be hard to recreate but should probably be noted by the Plesk development team.
 
The problem seems to be gone after I restarted the server. Sometimes the solution is so simple...
Bumping the issue (again).

This is not a joke: Have you (actually) tried turning it off and on again?

It happened on my server a few months ago, and I managed to fix it (after hours of searching and trying out all kinds of weird things). I totally forgot how I fixed the issue with 404s popping up randomly until the issue occurred again a couple of days ago:

- Adding a new subdomain and installing WordPress - no problemo (from what it seems)
- Logging in to the new subdomain hosted Wp - slight problemo (about 2/3 of all requests result in 404s)
- Looking through logs and error files - nothing to see here...
- Trying to crawl the new site. Inconsistency in which requests result in 404s
- Pulling out hair in frustration
- Finding this post again. Yay!
- Restarting the server. :cool:

- Bliss! Things are up and running smooth again!

@marowi was right.
 
Hello there,
Been pulling my hair off for a few days as I was having the exact same problem on a new WP site (only difference is it wasn't created with WP Toolkit) but not with older sites on the same server.
Restarting the server solved the problem (how did I not think of that first!)
Thanks for this thread!
 
Back
Top