Crap, really screwed something up, all my virtualmin servers are GONE - sorta emergency here

Virtualmin->System Settings->Re-check Configuration

{someday you will have to tell me where you get all your patience from)

The status of your system is being checked to ensure that all enabled features are available and properly configured …

Your system has 5.54 GiB of memory, which is at or above the Virtualmin recommended minimum of 1 GiB

Apache is installed

Apache supports HTTP/2 on your system

CGI scripts cannot be executed on this system!

The following PHP execution modes are available : fpm

The following PHP-FPM versions are available : 7.4.33 (php-fpm)

Apache is configured to host SSL websites

MariaDB 10.5.28 is installed and running

Using network interface ens3 for virtual IPs

Default IPv4 address for virtual servers is 162.220.165.228

Default IP address is set to 162.220.165.228, which matches the detected external address

Disk quotas have been disabled in the module configuration

Shell for FTP users is not included in /etc/shells, which may prevent FTP access

All commands needed to create and restore backups are installed

Resource limits are supported and configured correctly

The selected package management and update systems are installed

Chroot jails are available

The Virtualmin repository is configured correctly

… your system is ready for use by Virtualmin

OK, re-read my comments above about how to restore the Apache web server configuration for a domain.

And, there’s a post with a screenshot about how to restore the Virtualmin metadata on the one that is missing. This is the same as the “–fix” feature when restoring on the command line.

Screenshot of what I’m talking about with regard to restoring just the VirtualHosts for a domain:

again, mush brain - where is ‘restore’…?

redone:
deleted pic

Yes. You also need to give it a backup file to restore from, of course.

Yes. You also need to give it a backup file to restore from, of course.

and I take it those are the three files?

virtualminBackup.info
virtualminBackup.dom
virtualminBackup

??

one of the websites is now showing:

Index of /

so I guess this is progress of some kind…

So, figure out why restoring the Apache VirtualHost didn’t fix it before proceeding to the next. There’s something else we don’t understand about your situation, I guess.

I guess you now have two VirtualHosts in httpd.conf for this domain? (80 and 443)

Do they point where you would expect? /home/domainname/public_html

And, are there files in that location? Particularly an index.html or other valid index file.

sorry I have not restored anything yet - I want to make sure I don’t make yet another mistake.

OK, I’ve got to go to bed, I’m exhausted and it’s 3AM.

Our docs for Backups and Restores are here: How to Backup Virtual Servers | Virtualmin — Open Source Web Hosting Control Panel

I think you’re using a multifile format, so I think you have to point to a directory with those files, rather than the individual file.

It will show you what can be restored before doing it. You don’t have to be afraid of this form. It will ask for confirmation before doing anything.

ok joe THANK YOU SO MUCH – i will try this. thanks again.

restarted the thread here: Virtualmin does not seem to control httpd.conf anymore

joe - for some bizarre reason, there is virtually nothing in the backups:

 ls  -l /home/mark/virtualmin-restore
total 12
-rw-rw-r-- 1 mark mark 367 Feb  7 03:52 virtualminBackup
-rw-rw-r-- 1 mark mark   5 Feb  7 03:52 virtualminBackup.dom
-rw-rw-r-- 1 mark mark  44 Feb  7 03:52 virtualminBackup.info

this command was used to create the files:
/usr/sbin/virtualmin backup-domain --virtualmin config --dest ${BACKUPDIR}/virtualminBackup

this is looking increasingly hopeless… so i have started in on rebuilding a new server from scratch.

Joe - if you have anything else I might want to try, pls let me know.

i figure this missing ‘system information’ is a serious situation as well:

Oh, wait. You’re only backing up the Virtualmin configuration? Why would you just backup the Virtualmin configuration? That doesn’t make sense. If you’re going to the trouble to make backups, why not backup the whole domain? I didn’t notice that was what you were doing before, I kind of glanced over it and thought, “OK, good, Virtualmin backups exist, we’re fine.” I can’t figure out why you’d go to the trouble to make backups without backing up everything, though.

If you have all the user data, it continues to not be a big deal. You’ve messed up Virtualmin and Webmin a bunch (in ways I still don’t quite grok), but your user data is the most important thing.

That’s definitely not a serious situation. I don’t know what’s wrong there, but I wouldn’t call not seeing system information serious. If everything else is working, it’s probably related to the TLS certificate situation and will be fixed by getting TLS certs renewed/replaced in the right places (I’m guessing that section of the page does a web request, and for whatever reason it’s failing, and TLS certs seems like a likely cause). You can check by opening the Web Developer console and watching the network tab while loading the page. I’m guessing there will be some errors.

I would recommend you add VirtualHosts (basic ones), for each of the domains you deleted. It doesn’t have to be perfect, you can just copy a basic one, just point at the domain home in /home/domainname/public_html. You’ll then be able to import that domain into Virtualmin using the Add Servers->Import Virtual Server form. Make sure to associate it with the existing user. You do not want to create your virtual servers again. You want to import them, that will keep the data, and probably bring most things back into line.

Maybe start with something like this for the VirtualHost for a domain (you must change all mentions of domain.tld to your domain name, and all mentions of domain to your domain user:

<VirtualHost 162.220.165.228:80>
    ServerName domain.tld
    ServerAlias www.domain.tld

    DocumentRoot /home/domain/public_html

    ErrorLog /var/log/domain/domain.com_error_log
    CustomLog /var/log/domain/domain.com_access_log combined
 
    ScriptAlias /cgi-bin/ /home/domain/cgi-bin/
 
    DirectoryIndex index.php index.php4 index.php5 index.htm index.html
 
    <Directory /home/domain/public_html>
        Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
        allow from all
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
        Require all granted
    </Directory>

    <Directory /home/domain/cgi-bin>
        allow from all
        AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch
        Require all granted
    </Directory>

    RewriteEngine on
    RewriteCond %{HTTP_HOST} =webmail.domain.com
    RewriteRule ^(?!/.well-known)(.*) https://domain.com:20000/ [R]
    RewriteCond %{HTTP_HOST} =admin.domain.com
    RewriteRule ^(?!/.well-known)(.*) https://domain.com:10000/ [R]
</VirtualHost>

That’s for a domain that doesn’t have a Virtualmin user. It’s not clear to me if you’re only missing VirtualHosts for some users. For those, you should be able to select the domain, Edit Virtual Server and disable the Apache/Apache SSL Website feature and then re-enable it to regenerate the VirtualHosts.

We were trying to restore from backups because backups would have had your proxy rules and whatever other customizations you had. But, Virtualmin will generate sensible VirtualHosts for your domains based on the configuration for the domain, if you still have Virtualmin users for most of your domains. (And the steps above will create a Virtualmin user for the one that’s missing.)