Default Virtual host

I am trying to change the behavior of virtualmin to use the UserDir style of: domain.tld/sitename/ for creating virtual servers.

I have followed the FAQ here:

http://www.virtualmin.com/documentation/web/faq

How do I make a users website available at "http://www.mydomain.tld/~customerdomain"?

However, there is no change to the behavior.

Thank you for your help with this.

Thank you.

Status: 
Active

Comments

Howdy -- well, we'd certainly suggest using the mode of username.domain.tld rather than domain.com/~username if at all possible. It's more secure, and you'll be able to use CGI and FCGID, which don't work when using UserDir.

If you wish to use UserDir anyhow -- you'd need to change your domain.com Virtual Server to use mod_php rather than CGI or FCGID. You can do that in Server Configuration -> Website Settings -> PHP Execution Mode.

Once you do that and save, it should restart Apache (which I'm not sure the above document has you do).

Thank you for your help.

Unfortunately, that didn't change the behavior. I changed the execution mode to mod_php for "mydomain.tld" virtual server and restarted apache.

However, when I try to create the new site it is still defaulting to site.mydomain.tld instead of mydomain.tld/site/

Can you please give me instructions on how to do this step by step starting with a default installation?

Thank you for all your help. This issue has been driving me nuts trying to figure it out.

I'm currently changing all settings back to the default settings while I wait for your reply.

Don't erase your changes, let's figure out what's not working :-)

The steps you followed won't prevent Virtualmin from setting up a domain name when you create a new Virtual Server. Every Virtual Server has to have a domain name.

What the steps you're doing will do is make it so that, in addition to that domain name, that domain.com/~username should work in addition to that domain name being there.

OK. I have changed my settings back. Webmin apache module - mydomain.tld virtual servers on ports 80 and 443 automatic virtual server host root to: /home/%0/public_html

Changed the mydomain.tld Virtualmin setting: Server Configuration:Website Options:PHP Execution mode to:Apache mod_php (run as Apache's user)

Restarted httpd

Logged in as the mydomain.tld admin instead of root.

clicked create virtual server. typed in newfolder for the domain name and it automatically changed it to: newfolder.mydomain.tld

It also wants to use the IP address of my physical server instead of the IP address of the mydomain.tld virtual server. stopped at this point and did NOT create the sub-server

I really need a website, mydomain.tld with sites under it - all with the same IP address mydomain.tld/music mydomain.tld/art mydomain.tld/sports

Any and all help is appreciated.

Thank you.

Well, the way you're going about creating those isn't how UserDir would work.

The way UserDir works, it assumes you have each of those sites setup as individual top-level Virtual Servers, each with their own dedicated username.

However, if all you want are folders named "music", "art", and "sports" under "mydomain.tld" -- an alternate way to accomplish that would be to go into the public_html folder for mydomain.tld, and individually create those folders, and upload your content into them.

That would then enable mydomain.tld/FOLDERNAME.

If you have individual users who may wish to upload files into those directories, you could enable FTP access into each individual directory by going into Edit Mail and FTP Users, and creating FTP users with "Add Website FTP Access User".