Strange one with an old virtual server

I have had an server (server02.servermanagement.com)i ran several websites on. It has had an quite old virtualmin software running. It was that version, which used the first server (123.com) as standard website. Lateron i moved this one together with others to another server (server04.servermanagement.com is the servers FQDN, there is no virtualmin virtual server for this one), Unfortunately, it still keeps this behaviour, so if i want to access the website of server04.servermanagement.com, it shows me the 123.com website, what ever i put in the /var/www/html folder won't be shown, because 123.com interferes with that.

server02.servermanagment.com has been upgraded over time. I remember, that there was an option somewhere for standard webpage, but i cannot find it anymore.

Server04.servermanagement.com is also running on current webmin/virtualmin combo.

So, what are my options?

Thanks and best

Status: 
Active

Comments

Howdy -- if Apache ever isn't sure what website to show, it will show the default website for that IP address.

The default website is typically the first website that's defined within it.

On your servers running Virtualmin, you can configure the default website by going into Server Configuration -> Website Options, and setting the default website there.

On servers not running Virtualmin, you would just need to re-order which website shows up first in the Apache configuration.

my virtualminserver is server04.servermanagement.com, with a /var/www/html folder which should be the standard website. in virtualmin i have example1.com, example2.com, example3.com. butterfly1.com etc. example1.com is the standardwebsite for the ip, but i don't see, how i could manage that to have my /var/www/html folder as standardwebsite. I could, of course, create a virtualserver with server04.server-management.com, but this would confuse virtualmin and webmin i think.

So how could i overrule the setting for example1.com and set the /var/www/html as standard server? Then i could setup phpmyadmin, roundcube etc. as standard applications for all server users, and having to maintain it only once.

Also, since the domainname server04.server-management.com is generic, it wouldnt be a problem for different users.

Thanks and best

There isn't really a way to use /var/www/html as a DocumentRoot on a Virtualmin system, unfortunately.

Things are setup so that websites are run out of /home.

If you'd like to setup phpMyAdmin for all your users -- what I'd suggest is creating a Virtual Server for that, which all your users can access, and then install the phpMyAdmin and RoundCube Install Scripts into that particular Virtual Server.

Well, what really confuses me, is, that with server02.servermanagment.com it is working. i.e. i have virtualmin installed, latest version and can use server02.servermanagment.com as standard website, with server04 it is not possible, due to that example1.com domain, which has the flag set as standard website.

After poking around some time, I think i got it: I couldnt find a according setting in /etc/webmin/virtualserver/domains/12385686 (the domain in question) and i couldn't also find the setting in virtualmins own setting, but looking into the apache default file, i saw, that example1.com's .conf file in sites-available is being named 0-example1.com.conf. So if i rename this to example1.com.conf, create a new symlink for the /etc/apache2/sites-enabled link, it would work, correct? i could instead rename the 000-default.conf to 0-00-default.conf and change the symlink too, in order to achieve this.

What i am wondering about: If you happen by chance to set one Domain as the default domain for that ip, you won't ever be able to set it back to nil. This is a radiobutton, which can only change setting, when you define another domain as default ip. Since my example1.com happens to have this flag, i won't get around easily. My server02 runs happily and i can use the apache default setting for serving https://server02.servermanagement/webmail and others.

On server04 it serves instead https://example1.com/index.php

So could you perhaps change that feature, so one can disable this function for one website, without having to set another as standard website?

Just make that radio button changeable again, to be able to deactivate this. Unfortunately, if you have had this on one server, and move that virtual server, you also move that setting to the other server, where you don't want to have this setting.

Or is there a specific reason for not allowing changing this setting? Does Virtualmin need to have a default website within its ecosystem besides the standard server default? I am pretty sure, that this was set automatically, when i setup that virtualmin server 3 yrs ago. In the meanwhile, it is an option, which i do not use on any installation since then.

Thank you very much.

I went the second way, to rename the 000-default to 0-00-default and changed the symlinks target and name. After restarting apache, it did finally work out and i can use my server04.servermanagement.com website by placing things in /var/www/htmlfolder.

If you would support Scriptinstallations in that directory in Webmin; this would make life easier ;-)

I am still wondering about this setting in virtualmin, and would like to remove that for that specific domain, so i won't move that feature around, as i am in the process of sorting out all domains and distribute them on different servers...

Unfortunately, Virtualmin only supports script installations in /home (and websites in general), due to the way suexec works.

The suexec program is configured to run programs out of /home.

As far as the default website feature -- some website has to be the default domain. With the way Apache works, there isn't a way to unset the default domain.

Since the default domain is all about which one shows up first alphabetically, the only way to make a domain not the default is to promote another domain ahead of it as the default.

In your case, it sounds like your trying to make a VirtualHost that's not managed by Virtualmin into the default domain. To do that, you'd have to re-order things outside of Virtualmin for that to work.

Does the default domain have to reside within virtualmin or could it be just the 000-default, for the linuxserver's own FQDN? In my case, by renaming the 000-default to 0-00-default, apache sees now the server04 FQDN, where virtualmin sits on top as the default domain, and this seems to work.

Concerning Script Installers. I know, that suexec would interfere, but i thought it might be possible, putting this into webmin. I also have two servers which only run webmin, no virtualmin, and i could have made good use of scriptinstallers there two.

In my point of view i have to types of virtual hosts: the systems virtualhost (000-default), which i can access via /var/www/html and the virtualmintype virtual hosts. I think both can coexist, because i had other virtualminservers, where this was running for quite a long time.

Can you see any drawbacks on that one?

Thanks and best

Unfortunately, Script Installers aren't likely to become part of Webmin, as they rely on features of Virtualmin to work.

For example, Webmin doesn't have a concept of the "MySQL Database", doesn't understand how to handle different PHP versions and their requirements, or how to install dependencies.

There also wouldn't be a standard, secure environment that it can expect. Unless suexec is configured, mod_php would be required, and mod_php has security issues when running in a multi-user environment. For example, if someone were to breach your /var/www/html sites (which I believe are running mod_php), they could potentially trick Apache into seeing data from sites in /home.

If we add all the features to Webmin necessary for script installers to work, what we'd eventually have is a product resembling Virtualmin :-)

I know this isn't ideal and may be a decent amount of work -- but if you have a server running Virtualmin, our recommendation is to import your various websites into Virtualmin, and host them out of /home.

If you can't do that, you're likely to run into some limitations with that setup, and your ability to manage those sites. As well as the potential security issues mentioned above. Those security issues may be low-risk though, depending on your environment.

But as you're seeing, it can work -- it just comes with some limitations.

i have all my domains in virtualmin, besides server04.servermanagement.com, which is the domain of the underlying linux server. If i want to use that domain as central point for services like phpmyadmin and the like, would i have to setup server04.servermanagement.com as a virtualserver in virtualmin? I don't want virtualmin and webmin to be confused ;-)

Best & thank you

Yeah we'd recommend using Virtualmin for that domain as well.

You might consider not enabling the mail for domain feature if you don't need it, but you should otherwise not see any sorts of problems using that domain name as a Virtual Server in Virtualmin.

I did not want to interrupt, but did you say that We can add server's hostname as virtualmin server ? If thats possible, its really great

Sure... we've occasionally seen trouble with email delivery when doing that, so you may want to disable the Mail for Domain feature when doing so. But that problem doesn't occur all the time and may not be an issue at all. You could always just try it and see what happens :-)

i will setup my server04.servermanagement.com within virtualmin and disable email and check it out ;-.)

Thanks and best