404 Error on my websites

I have 10 wordpress hosted on my server. some of them are working properly. But when I visited o few of websites it gives me 404 error.

I checked file permissions
I checked .htaccess file
I started OLS for a few times
I deleted domain and rerecreated it again

But nothing changed. What should I do to rerun theese sites?

I was working properly last week. I didn’t understand what changed.

Thank you.

Did you try fix permissions from file manager?

I have a similar problem here, it started suddenly after I deleted a bunch of additional domains from a suspended Website.

1- All the Websites’ main domain all seem to work fine. .htaccess is effective and the website displays. The problem is with only some add-on domains of some websites. Mostly all of the add-on domains are merely aliases (shared document root) for working WordPress multisite installs.

2- Those faulty add-on domains fail to use their proper SSL certificate and issue a 404 error (OpenLiteSpeed page) (both on http:// and https://).

3- All the faulty domain use the same SSL from one of the main domains (which happens to match OLS’s Listener default SSL certificate as set for all VH Mappings) in place of their ones.

4- I have one Website which works on the main domain and some add-on domains, but not for other add-on domains.

5- This might be a clue : the add-on domains that work are the oldest ones. From the moment one domain fails, all the following domains in List Domain (that where added after that one) also fail.

6- On one Website, I tried deleting all add-on domains and re-creating them, but then LetsEncrypt SSL issuance fails and falls back to self-signed cert, and the domain still shows a 404 error.

7- All domains’ (faulty or not) .htaccess, vHost Conf and SSL certificate and permissions seem correct in Manage Website view.

8- I compared settings in OLS WebAdmin between working vHost and faulty vHost and couldn’t find any significant difference. I also compared the SSL Listener’s Virtual Host Mapping but they all use virtually the same settings. (That’s where I saw that they are all set with the SSL certificate that shows on faulty domains in place of their own).

It seems to me the issue is related to OpenLiteSpeed recognizing the domains and passing control to the appropriate Virtual Host. The fact that older add-on domains still work and everything else fails at one point might indicate something (point #5).

Questions:

Q1. This host is still running CyberPanel v. 2.0.3. Would updating CyberPanel help, or only make things worse?

Q2. Current version of openlitespeed package is 1.7.11-1+focal. Should I roll back to a previous version?

This is some serious issue, and I have A LOT of sites experiencing some serious downtime right now. Any help would be MUCH appreciated.

@usmannasir This is a quite serious reliance issue! I’m frantically looking for a fix right now!

Reviewing my installation notes, turns out it’s NOT THE FIRST TIME I experience the very same issue with this host. Last time I managed to fix things by DELETING ALL CHILD DOMAINS and recreating them all (and re-issuing every certificate!).

Considering I got some 85 child domains configured, that’s not very convenient! :scream: Especially since I need to configure each vHost individually to enable the WordFence firewall… At least none of my child domains has mail accounts attached – that would drive me REALLY NUTS!

But… Would that work this time??

@halityilmaz I think I found the root of the problem. Did you recently DELETE a website that had CHILD DOMAINS?

Ok. So you have some random domains that are not working anymore (.htaccess ignored / wrong SSL certificate / 404 error)?

Here’s how to spot the problem and fix it:

  • Login to the OLS WebAdmin console on https://<cp_hostname_or_ip>:7080 (see how to activate at the bottom)

  • On the dashboard, below the Live Feeds, you’ll see a Listeners and a Virtual Hosts tabs

  • The latter shows the number of vHosts that are up (green) and down (red)

  • Review the hosts that are not running in the Virtual Hosts tab. This will include any domain associated to a suspended Website (which is normal).

  • Spot any host that shouldn’t be there (eg. the associated Website has been recently deleted)

  • You can check if a host is defined in CP by searching in the Websites > List Websites view and in Websites > List Child Domains.

  • You can also check if a failing host has a proper Domain Mapping in the Webadmin Listeners view (Default + SSL listeners).

  • If a host is present in the Webadmin but is not present in CP or has no Domain Mapping, that’s probably the source of the problem.

  • Go to Virtual Hosts, spot the “rogue” hosts and delete them.

  • Restart OpenLiteSpeed and enjoy your day.

That’s how I finally fixed my case. It took me about 10 hours to figure it out, but hey, now I know!

(If after that you still have domains that are down (and shouldn’t be), then you should check the presence of their conf files and the proper permissions for their public folder.)

Explanation:
Notice that when such a host goes rogue (eg. child domain whose website has been deleted), LiteSpeed fails to load its configuration files, and all the following hosts (eg. those that were defined after it) will fail to properly load. Hence resulting in seemingly random domains going down.

While OLS in such state, you’ll be unsuccessful in creating new domains or Child Domains and issuing SSL certificates for them. Chances are you will feel rather unsatisfied.

@usmannasir My problem most probably started when I deleted an old website and CP (then 2.0.3) failed to properly suppress the vHosts in OLS. That sounds like a bug. The Listeners’ Domain Mapping where gone, but a couple rogue Virtual Hosts were dangling there, causing me headaches and many domains some major down time.

Was this fixed in 2.1?

To enable Webadmin console on port 7080:

  • Go to security/firewall and open console port 7080 (TCP)
  • Define the console password with cd /usr/local/lsws/admin/misc and ./admpass.sh
1 Like

I am reading your posts thoroughly to check if I can produce a fix.

@biguenique

May I ask that the add-on domains you mentioned are created as child domains or alias domain?

@usmannasir They were child domains, all pointing to the main website domain public_html (WP Multisite)

@biguenique

If you are still facing this issue, can you create ticket with us and share ticket id here. I will need to diagnose.

Hello, this is my first post. I just created an account to thank you :pray:.
You saved me not only hours but days!
Based on your description I understood how the same problem occurred in my server.

I have a main wordpress site with 10 domain aliases. I needed to restore a backup, but it wouldn’t restore unless I deleted the website in Cyberpanel. After I restored the website and added new alias, I had 404 on some of my alias domain. Thanks to your instructions I found that in “Webadmin console” → Listeners → General, not all alias domains from Cyberpanel where present. After adding them manually, the problem was solved.

1 Like

I’m really glad my previous experience with a similar problem has been useful to you! I spent a lot of time figuring out what the problem was, so sharing the solution when I found it felt like a duty towards the community.