Primary domain for VPS (/var/www/html vs. /home)

Hi,

I wanted to ask why when creating virtual servers in Virtualmin their files are created in root/home directory? At first when there were no virtual servers created I tested everything accesing vps via IP address and files were served from root/var/www/html directory. Now if I access IP I see one of the added domain served from /home/somedomain.com directory.

I want to transfer my (primary) example.com domain (I used this domain name when ordering VPS) from shared hosting to this vps but I want to do it without any problems and delays. At first I assumed that I need to copy all files from example.com to /var/www/html directory in VPS and change nameservers to point to it, but will it work like that or do I have to create new virtual server for example.com?

“Primary domain” in a virtual hosting context is sort of nonsensical. Apache has two modes of operation, with regard to virtual hosting, and when you enabled name-based virtual hosting, the notion of a “primary” or “default” website no longer has meaning to Apache.

It’s sounding like you don’t want this particular site to be controlled by Virtualmin (why not?), which means it doesn’t matter where you put it. You can configure it to be anywhere you want, but you do need to know that suexec will only execute stuff in one directory (and if it is configured for Virtualmin use, that one directory will be /home). If you aren’t using suexec for that site, then it doesn’t matter.

At first I assumed that I need to copy all files from example.com to /var/www/html directory in VPS and change nameservers to point to it, but will it work like that or do I have to create new virtual server for example.com?

Your way sounds complicated, to me. :wink:

Creating a new virtual server in Virtualmin, and then copying the data into /home/example/public_html seems way simpler, but I don’t really know what you’re doing.

You definitely need Apache to know about your website…in a virtual hosting context there is no longer a single default website document root. Putting the files into /var/www/html will do nothing, if you don’t explicitly configure Apache to serve files from that directory (alongside the virtual hosts in other locations). Again, Apache has two modes…Virtualmin requires Apache to be in the virtual hosting mode.

I want to correctly migrate my example.com site from shared hosting to this vps. So it would be ok to just “Create Virtual Server” in virtualmin for the example.com and it doesn’t matter that no website ever will be loaded from /var/www/html ?

And I have some problems understanding nameservers. When I bought this VPS I used example.com as my domain (to clarify by example.com I just refer to my real domain name) and now I can see in Virtualmin that there’s hostname server.example.com which is acting like a nameserver (in my opinion) looking at the attached screenshot.

I tried to host my 2 other domains on this vps by creating private nameservers like ns1.otherdomain.com pointed to IP of vps and they seem to work, however when I check those domains with intodns.com I get those errors: (see attached file).

What nameservers I should use for example.com to migrate it to this vps?

p.s. I edited screenshot with Firebug but the concept remains the same. ns.someisp.com is like secondary dedicated server of this hosting company to handle nameservers.

There’s some more info about the vps:
System hostname server.example.com
Operating system CentOS Linux 5.4
Webmin version 1.480
Virtualmin version 3.703.gpl GPL