Issues Disabling Apache After Failed Installation on Virtualmin
Hi,
I attempted to install Apache2 alongside Nginx on my server, but the setup didn’t work as expected. Now, I want to fully disable Apache and revert back to using only Nginx, but I’m facing issues with Apache not being fully disabled in Virtualmin. Here’s what I’ve done so far:
Disabled Apache:
For Debian:
systemctl disable --now apache2
For RHEL:
systemctl disable --now httpd
Disabled Apache as a Virtualmin feature:
virtualmin set-global-feature --disable-feature web --disable-feature ssl
Reconfigured Virtualmin for Nginx:
virtualmin-config-system -i Nginx
Despite these steps, Apache still seems to linger in Virtualmin and is not showing up under “Unused Modules” like it did previously. Is there something I’m missing or another step required to completely remove Apache from Virtualmin’s configuration?
What do you intend to use with Virtualmin - Apache or Nginx? You can’t use both.
I suggest you kill your existing install of Virtualmin (which you have FUBARed) and start again with a freshly installed OS and install Virtualmin with the Nginx option.
Why should I reinstall everything if Nginx is working fine?
My main concern is losing all my data. While I have backups, they aren’t complete backups of the whole Virtualmin server—just partial backups of my old server. Running a full migration again would be a hassle.
I don’t see how Send would depend on Apache (nowhere is it listed as a dependency on that page, and they seem to provide a Docker image, as well). Why was Apache in the picture at all, if you’re happy with nginx?
You probably need to uninstall the Apache package. Webmin, and thus Virtualmin, detect Apache based on the existence of files found in the package. If you have those files, it’ll think that’s the web server you want to use (Apache is the default, so it’s checked for first, if it’s found, nginx is probably never considered an option).
You can also try Re-check Configuration. I’ve never tried converting a system from Apache to nginx, or switching back and forth, and it’s not a supported path. It’s bound to be pretty messy.
I did not convert anything; I simply followed the steps in the Send deployment documentation. When that didn’t work, I tried the additional steps I provided:
I thought this might also help revert the changes made by Apache.
I’d recommend you just search for information about configuring that application with nginx. I don’t have any experience with it, so I can’t help, but I can assure you that nginx can also proxy to web applications. I am unaware of any features unique to Apache in this area.
I am not aware of similar tools. But, I’ve told you that Send can run under nginx (I’m about 97.4% sure of it). I dunno what else to say about it.
I don’t need to send large files to random people often (at my day job, I use Google Drive for sharing with others in the company, because that’s what the company uses). And, because most everything I work on is Open Source, I can share anything I work on for Virtualmin by just posting it on a web server or checking it into github. The purpose of Send is not a use case I often have.
It is a mess (but can be done). I have done it on a VM running an older version of Webmin/Virtualmin.
It was hard work! and is one of the reasons I would avoid Apache like a plague!
The problem (as Joe has already pointed to is that Webmin/Virtualmin due to its history and some folk still believe in Apache grabs Apache in preference unless nginx is forced on it at the point of installation withe the LEMP option. (I wish it would be a either/or question during setup)
You need to remove all traces of Apache and rebuild much of anything already loaded and put bluntly you might as well start over with a clean OS + nginx install then reload + test each site from good backups.
As I mentioned earlier, I’m really nervous and scared about having to re-install everything. I had to apply some manual fixes and patches to get the system running smoothly, such as increasing the swap file size and installing drivers for my GPU (I have an AMD Ryzen 3 PRO 2200G with Radeon Vega Graphics, 4 cores). These tweaks helped reduce the load on Kworker. Right now, I’m creating a full backup locally on a separate internal drive and also on a File Server. I already have incremental backups, but for some reason, they seem to fail (the data and file sizes appear to be correct).
Can someone provide a step-by-step guide to fix the issues I’ve caused and successfully restore any backups? I really want to avoid spending another week setting everything up again.
For example, one thing I’m nervous about is if I revert a backup that contains the Virtualmin configuration—will restoring it cause the same issue again, and what are the contents of its “config” is it server related, machine or maybe both?
Did you try what I suggested? I think you’re making this more complicated than it is.
Obviously, you should make sure you have good backups before making dramatic changes (ideally you’d have backups from before you did the dramatic step of switching to Apache).
So, do you mean I should run sudo apt remove apache2 webmin virtualmin and then reinstall everything? Or what exactly do you mean by the steps provided? Just to clarify, I’m new to virtualmin and I’ve read that re-running the installer is not recommended…
No! Where do you see me suggest uninstalling Virtualmin or Webmin!? That’s always a terrible idea. Very, very, destructive.
I said, “You probably need to uninstall Apache.” That’s it. That’s the step. That’s the thing to do to make Virtualmin stop thinking Apache is your webserver.
Again, already covered in the post. “Re-check configuration” is probably necessary to detect a change in services available. This is always needed when you change something out from under Virtualmin (like adding/removing PHP versions).
I’m guessing, though. If that doesn’t detect the change, there probably is a configuration variable, and I’ll have to dig into the Webmin config when I have more time to find it (or you can look for it…in /etc/webmin/virtual-server).