I created 5 websites and added LE SSL to all: everything works.
Then I followed the same procedure for mysite.com mysite.com has no files, just SFTP access (which works fine) + CFlare DNS pointing to the VPS. (no proxy, SSL: flexible, purged Cache)
I uploaded index.html and tried to reach it | got 404
I checked OLS VirtualHost and it looks like my other (working) websites (attached)
I’ve seen the following posts, and restarted the VPS.
I deleted and recreated mysite.com
I restarted OLS | nothing worked.
systemctl restart lsws
Looking at the /error.log below it seems the OLS Listener does not exist.
But OLS Panel says the Listeners are on SSL + Unsecure , so mysite.com should be served. (attached)
cat: /home/mysite.com/public_html/.htaccess: No such file or directory
Why the 404 page return Apache 404 when OLS is supposed to run ? Apparently Apache is not running on my server.
> httpd -v
> Command 'httpd' not found
But, if I search for it, I get lots of files, and the Apache 404 is triggered only for mysite.com
If I type a non-existent url for any of my other domains, I get a OLS 404 (not Apache)
Eventually I found the problem, it was a CyPanel BUG.
Initially reported by @vpsingh 6mo ago, I hope someone will look into it . Perhaps Syed, @josephgodwinke@die2mrw007 …
After struggling for a week , here is my understanding of the issue , and my workaround to fix it in 2 mins - hopefully without breaking anything else.
Although OLS is the HTTP server, Apache2 is also installed by CyPanel. mysite.com, was in fact served by Apache2 (which is just Apache for Ubuntu), though OLS is installed and running. That’s why I got the Apache2 404
Check this out via SSH:
apache2 -v ** Server version: Apache/2.4.52 (Ubuntu)
grep -r Listen /etc/apache2/* // List Apache2 active ports
Now, open /etc/apache2/apache2.conf and comment the line below:
#Include ports.conf ** This prevent Apache2 to listen to any ports (80, 443)
Restart Apache2, Done!
Finally my index.html was served by OLS.
Thanks.