Virtual Machine Apache config

centos 8

i have webmin and virtual min install on my server iknow you can install cloudmin to manage KVM

the problem i have is that i cant install cloudmin on censo 8 say Error: Unable to find a match: kvm qemu
i already have virtual machine manager with some machines

just cant seem to figure out how to add the kvm to apache virtual hosts what virtualmin made httpd conf
all websites can be accessed from outside my network but the virtual machines can not

I think you’re very confused about how all these pieces fit together. KVM and Apache are wholly unrelated. You don’t “add KVM to Apache”. That doesn’t even make sense.

The package name you need to install on CentOS is qemu-kvm. But, it has literally nothing to do with Apache, and we don’t recommend running Cloudmin on the same machine as Virtualmin (it’s possible and we do it on our development systems, but they’re wildly different use cases…it makes much more sense to run Cloudmin on the hardware, and Virtualmin on the VMs that Cloudmin creates). Running both on the same machine (with Virtualmin not being in VMs) is going to make your life more difficult than it needs to be.

1 Like

yeah man totally confushed lol ive probbly done this all backwards lol dreading starting fresh as my Virtualmin Virtual Servers is over 20 domains all working great aprt from a couple https redirect errors

my qemu/kvm connection details on my host machine

network a6b87436-6e3e-48e3-95e4-7b26dd1a4b30

that creates a virtual machine on my network giving me the ip address of 192.168.0.33 for domain3

can i not add this to the httpd below that virtalmin created

ie

SuexecUserGroup "#1029" "#1024" ??????????? ServerName domain3.co.uk ServerAlias www.domain3.co.uk ServerAlias mail.domain3.co.uk ServerAlias webmail.domain3.co.uk ServerAlias admin.domain3.co.uk DocumentRoot /home/domain3/public_html ErrorLog /var/log/virtualmin/domain3.co.uk_error_log ?????????????????????? not through virtualmin CustomLog /var/log/virtualmin/domain3.co.uk_access_log combined ???????????????????? ScriptAlias /cgi-bin/ /home/domain3/cgi-bin/ ScriptAlias /awstats/ /home/domain3/cgi-bin/ DirectoryIndex index.php index.php4 index.php5 index.htm index.html Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch ....... ....

this is my httpd conf on my host machine that virtualmin created

SuexecUserGroup "#1029" "#1024" ServerName domain1.co.uk ServerAlias www.domain1.co.uk ServerAlias mail.domain1.co.uk ServerAlias webmail.domain1.co.uk ServerAlias admin.domain1.co.uk DocumentRoot /home/domain1/public_html ErrorLog /var/log/virtualmin/domain1.co.uk_error_log CustomLog /var/log/virtualmin/domain1.co.uk_access_log combined ScriptAlias /cgi-bin/ /home/domain1/cgi-bin/ ScriptAlias /awstats/ /home/domain1/cgi-bin/ DirectoryIndex index.php index.php4 index.php5 index.htm index.html Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksI$ Require all granted allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksI$ Require all granted RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.domain1.co.uk RewriteRule ^(?!/.well-known)(.*) https://domain1.co.uk:20000/ [R] RewriteCond %{HTTP_HOST} =admin.domain1.co.uk RewriteRule ^(?!/.well-known)(.*) https://domain1.co.uk:10000/ [R] RemoveHandler .php RemoveHandler .php7.2 SetHandler proxy:fcgi://localhost:8014 AuthName "domain1.co.uk statistics" AuthType Basic AuthUserFile /home/domain1/.awstats-htpasswd require valid-user SSLEngine on SSLCertificateFile /home/domain1/ssl.cert SSLCertificateKeyFile /home/domain1/ssl.key SSLProtocol all -SSLv2 -SSLv3 -TLSv1 -TLSv1.1 SuexecUserGroup "#1028" "#1023" ServerName domain2.co.uk ServerAlias www.domain2.co.uk ServerAlias mail.domain2.co.uk ServerAlias webmail.domain2.co.uk ServerAlias admin.domain2.co.uk DocumentRoot /home/domain2/public_html ErrorLog /var/log/virtualmin/domain2.co.uk_error_log CustomLog /var/log/virtualmin/domain2.co.uk_access_log combined ScriptAlias /cgi-bin/ /home/domain2/cgi-bin/ ScriptAlias /awstats/ /home/domain2/cgi-bin/ DirectoryIndex index.php index.php4 index.php5 index.htm index.html Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksI$ Require all granted allow from all AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksI$ Require all granted RewriteEngine on RewriteCond %{HTTP_HOST} =webmail.domain2.co.uk RewriteRule ^(?!/.well-known)(.*) https://domain2.co.uk:20000/ [R] RewriteCond %{HTTP_HOST} =admin.domain2.co.uk RewriteRule ^(?!/.well-known)(.*) https://domain2.co.uk:10000/ [R] RemoveHandler .php RemoveHandler .php7.2 SetHandler proxy:fcgi://localhost:8013 AuthName "domain2.co.uk statistics" AuthType Basic AuthUserFile /home/domain2/.awstats-htpasswd require valid-user SSLEngine on SSLCertificateFile /home/domain2/ssl.cert SSLCertificateKeyFile /home/domain2/ssl.key

how do add the qemu/kvm machines to this/ example /

thank you for your quick reply

Wrap your config files in triple backticks (```) so they’re readable.

You need to proxy to any apps running in VMs or containers or app servers. So, you need a pair of ProxyPass and ProxyPassReverse (or ProxyPassMatch if doing anything fancy). Reverse Proxy Guide - Apache HTTP Server Version 2.4

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.