Default Virtual Servers Apache/ @ var/www/* making set up impossible.

Putting this in newbies section because after weeks of messing about and reading and reading, I do not know how to proceed. I will outline my exact specs as best I can - some will be relevant others may not, but just know I had all of this set up in a half hour the last time I did it (server company went under and backups were not existent (my fault as much as anyone.)

OK, running Proxmox and OpenVZ containers currently, but will surely be changing that to KYM with Cloudmin later, but that is not the trouble.

2 Identical Installs of CentOS 6.7 in containers one running Virtualmin Pro (the one doing the work) and a second running GPL really just for DNS.

Containers have separate IP’s, but leave on the same Proxmox bridge, Currently I have only a single WAN IP available.

OK, I know all about BIND - (no I don’t or I would not be here, but have hundreds of hours reading and doing.) Note this procedure seemed intuitive and automatic when it was done before. And there are way too many posts that suggest opposite solutions / or outdated material.

Hopefully me describing the goal here and then adding what I know will make this a post some kind person will assist with.

I am not running a real data-center or hosting anything but my own projects at this time, but I am essentially trying to set it up that way. Security and “opinions” might change if every domain looked like it was a host itself. (lol, blame that hosting company, not me. :wink: )

So, I have two VM’s with FQDN’s of for example:

Those FQDN’s are what Virtualmin/Webmin is installed on in CentOS 6.7 Final.

Objective, serve all of my sites using and as DNS - all of that I basically know how to do without issue as well as creating custom virtual servers. Where I am getting stopped before even starting is the two default Virtual Hosts located at var/www/. port 80 and 443.

Those two virtual servers being in that location, and ending up the default domains, or if I change them, they are missing all of the goodies a person needs to actually host from there. Because of this, it gives one the desire to try deleting them entirely, but you cannot and I suppose should not do that. I am quite OK with having the FQDN’s of * served from there if need be. For me, since this is my project I am serving, it would be great to actually serve from there instead of home/domainname/public_html - only because I am the sole user and the 4 or 5 domains I am hosting, when placed in the home directory makes for a PITA - either having to log in with each domain’s username and PW for SSH, or throw scripts to chown the files to their proper user if I use any other account - in the end this is a bad practice - Virtualmin has files that are not supposed to be owned by the domain username and problems can occur.

From reading the official position is to use the home folder(s) - that I can deal with and won’t fight, while it would be better to not have to fight permissions.

Anyhow, all of this garbage because I am burned out after hours and hours of reading, trying, restoring punching stuff and what I see in the end is the default virtual server(s) 80/443 mess everything up. They do not allow me to have a “real” virtual server of my hostname as the DNS does not like how things are and as mentioned above, I am not seeing that these default virtual servers have even a portion of the things required to run a real website. I have tried everything I know to - the only thing not available was to delete them both and work with what I understand BIND wise, but the port 80 is not deletable. What all of this distils to is that I cannot set up anything really as those virtual servers must be taking the into some DNS record(s) and making it so I cannot create a “full featured” one as one would normally do with Virtualmin.

The only thing I can remember from my prior set-up was I think I actually changed the location and directories for those default domains to the home directory, but either something has changed, or I am just hallucinating things now.

I would appreciate help. I guarantee this is covered somewhere, but after more than a week of finding nothing that really applies, or better yet nothing that works I have no choice but to ask. I know this post is horrific. Please ask questions, I most likely will have answers, I am just so burned out, I cannot think intelligently about this anymore, so my apologies.


What distro/version is it that you’re using there?

It may just be a matter of tweaking or removing the existing default VirtualHost config… but this here may help as well:

Right out of the gate, thanks andreychek I was ready to explode and wrote World’s worst post. The Disro is mentioned, no? Regardless, both identical servers are running CentOS 6.7 Final.

VM #1 -Virtualmin A --> (Webmin: 1.770) (Virtualmin: 4.18 Pro)
VM #2 -Virtualmin B --> (Webmin: 1.770) (Virtualmin: 4.18 (GPL)

Now they are in Proxmox OpenVZ containers for now which is a Debian distro, but that has no bearing on anything - save maybe getting traffic through, which it accomplishes that.

Allow me to read through your link. Thanks for humoring (and helping me) - feeling really stupid as I have had no such issues prior.

This might be going somewhere. Enter CMD:
grep -i ‘<virtualhost’ /etc/httpd/conf/httpd.conf
I recieve:
grep -i ‘<virtualhost’ /etc/httpd/conf/httpd.conf

ports, in addition to the default. See also the

definition. These values also provide defaults for

any containers you may define later in the file.

All of these directives may appear inside containers,

If you do not specify an ErrorLog directive within a

logged here. If you do define an error logfile for a

If you do not define any access logfiles within a

define per- access logfiles, transactions will be

#<VirtualHost *:80>

Do keep in mind there are no Virtual Servers created now but the Apache port:80 and :443 Default Virtual Servers exists as they should from the standard install on the machine yet; as I am trying to figure out how to host (don’t care where, var/www or home/user/etc - using the tld just so it works. The issue in the end is always the same, - my two systems have FQDN’s of: and - that all works out in the Virtualmin install, but for some reason I have no way of host the tld - that being “” the “cool*” and “cooler” only exist now as the container for the Virtualmin system. I cannot find a good way to make the tld on one of the systems behave like a normal server.

In a nutshell, I want the default server of my tld to actually be able to work as a site. As it stands, if my IP was and I typed that is, I DO go to the tld, but it is Apache stuff, not a full working Virtualmin virtual server install. Hope this helps, off for a nap.

i can no longer think about this. I need rest - will revisit this tomorrow (today, it is 4:57AM…

Sorry, I scanned through your post right before commented to double-check that you hadn’t included the distro, but I apparently overlooked it :slight_smile:

I didn’t completely understand what you were after, upon reading your initial post, but your followup comments have me thinking that at the moment, maybe you’re just after setting up a default website?

What you could do there, if you wanted, is create a new Virtual Server – and you can name it anything at all, it doesn’t have to be a real domain name. You could call it “default.tld” if you wanted.

Then, give that newly created domain some sort of generic website.

After that, go into Server Configuration -> Website Options, and make it the default website for the IP address.

Then, no matter what domain name a person browses to, if it points to your server but isn’t configured in Apache, it will be given this default site. Also, if someone browses to your IP address, they will see that as well.

Is that what you are after?


I didn’t completely understand what you were after, upon reading your initial post, but your followup comments have me thinking that at the moment, maybe you’re just after setting up a default website?
Yes and I am sorry I was too burned out to write simply that; I have a week of reading experimenting and hair-pulling wrapped up in this.
What you could do there, if you wanted, is create a new Virtual Server – and you can name it anything at all, it doesn’t have to be a real domain name. You could call it “default.tld” if you wanted.
Does this mean I can name it with the same domain name as the two installs are using in subdomain form for Virtualmin/Webmin? - this has/is the entire problem. -> I have, - and you are saying I can name a site - I just want to be straight on this, as that is what I am failing with.
I see your answer and am familiar with how to do just that, but that surely sounds sort of convoluted to me. So if I were going to use Cloudmin, Webmin and Virtualmin as my datacenter’s end to end solution for a paid hosting business, this would be what one would do? (In order to have this software accessible as a subdomain of one’s hosting companies’ domain - and still be able to host the system for people to purchase space at the top domain?) One’s “” hosting businesses’ main sales site would have to be sort of jammed in there like this? Don’t take offense, I am just asking.
I guess this has been such a difficult thing for me it would seem is that I used subdomains of something I wanted to host as well for the Virtualmin OS’s and Virtual/Webmin installs. Do you have future recommendations on how to set up from a fresh install as far as pre-planed DNS and directory structure?
I am a bit surprised there is so little about this documented, be it in the forums (which there could be, the forums return lots of unrelated results) the wiki and Google but also, I would think this would be something mentioned in the documentation from the word go.
I thank you for your answer and I can proceed that way, but would be interested to hear any other options - and/or how I should approach this same issue, but AT INSTALL time. Thanks Eric.


Well, I don’t mean to make it sound confusing or convoluted. I think I tried to make my description of how to do that too generic, and in doing so may have made it seem odd.

What many people do there is they make their default Virtual Server named after their company name.

So if your hosting is “Go Mommy’s Hosting”, we’d create a Virtual Server named “”, and then we’d set it up to be the default for that IP address.

And then we’d give it a nice website that we want people to see.

Any Virtual Server, or Sub-Server, can be selected as the default.

Once a Virtual Server or Sub-Server is the default, it is what people will see when a user browses to the IP address of your server, or if they go to any domain name that resolves to your server’s IP, but hasn’t yet been configured.

Do I understand correctly what you are after? And if so, does the above do what you want?

Also, it sounds like you have some questions about how to go about setting up new servers – I’m not sure I understood what you’re looking for there though. I’m happy to help, though it may be easiest to ask that in a new Forum thread so that we don’t mix up the topics here, as I get confused easily :slight_smile:


Yikes, my apologies, I was NOT trying to give you a hard time! Yes, you hit the nail on the head. And that is exactly what I am trying to do. I continue to have issues with DNS and errors that are terminal as far as trying to “tweak” settings to get things to go for the mock hosting company “”. What was (has been) done first was to setup Virtualmin @ and By using that sort of structure when I first set the fresh install of CentOS’s FQDN’s for each instance, and then agreeing with the installer to use those subdomains, I believe it is that which is making this break now. There are “some” records just for that I would guess. I should look at the named file first off…

I just restored the un-goofed with VM’s again that should be unmodified except for user(s) and maybe a few other irrelevant settings and I will document the steps and unless it miraculously works, then I can give you real data on what I am failing at. I cannot do it now as frankly after the millionth time of doing just what you posted above (which is logical and how I have been trying to do this all along) and without writing things down, I can’t remember the processes I have tried before getting “failure X, Y, Z…” I am going to say it is likely what is often not working is setting up DNS as all of my “clients” for my non-existent hosting company will use and for DNS. I am thinking perhaps that portion of the process is what I am doing wrong or overlooking. Allow me to do some testing and give you real errors or failure points - as “this thing’s broke, can you fix it?” is NOT the way to solve problems by wasting your time; so I am sorry about that, I am just burned out.

OK Eric, I found the root cause in my troubles and will very specifically comment on them at the end of the thread as perhaps others will run into the same thing.

The question I have now - uh… wait… Nope, it was not due to being cached.

OK, so I am now at the point when I create the new “” site, there is something I still have wrong. It installs everything to the home folder. When I check Virtualmin>Server Configuration>Website Options, it indicates -> “Default website for IP address? Yes” Which is curious as just below that it shows the two fields, access and error logs pointing to the var/www/* directories and indeed still typing my external address into a browser sends me to var/www instead of /home/hostmommy/public_html/ as it should. Ironically it says on the same page at the bottom, Website Documents Sub-Directory = public_html - this seems odd for as you know the apache default server it is sending browsers to, that folder does not exist, it uses just “html”

I know I have to be one setting off on something. The issue I can expound on once this is working has to do with the native hosts file. At any rate, is it possible that this is an issue between my internal address(es) (one for each OS/instance, although I am only going to host on one of the two…) as far as why it is setting everything up perfectly, but still somehow stuck in "go to apache world @ var/www/ deal?

Could my internal IP settings be what needs changed at this point for Apache to send one to the right place? Thank you for your patience. The only fringe benefit of spending a couple weeks on something like this is I have read hundreds of posts, all of the documentation and the wikis, so I know a whole lot about other bugs I have encountered in this process. I am sure I cannot see the forest for the trees in front of me at this point. Thank you for your time and patience Sir.