changing virtual-server Home directory

hello all -

a couple of my first virtual-servers didn’t have the domain-name suffix in the home directory (the default is changed now thanks to forum help…!)

so, being the brilliant newbie that i am, i simply renamed the home file (example)

mv /home/ilovevirtualmin /home/ilovevirtualmin.com ;

and then i manually edited the httpd.conf file and restarted apache.

however, my virtualmin page still shows the old file location (attached)

any ideas? (other than to simply ignore it, and to keep newbies away)

can this even be done using virtualmin? i need to make a few changes.

Hi,

Yes, this can definitely be done. The area where it gets done can be easily confused, because it’s not as obvious given it part of a larger feature inside Virtualmin. Here are the steps.

Navigate to: Virtualmin > Server Configuration > Change Domain Name

For your needs, adjust “Change home directory” parameter to what you desire, then simply click “Rename Now”.

*** This will create the new home directory, and move things to that directory, and finally delete the old home directory accordingly. ***

-Peter

awww - i should have known it had a simple answer! thank you peter!

Changing home directory and domain name is two different things but as always virtualmin help = no help

There should be a change you can do it by follow the steps for activating virtual hosts you can find for the linux version you are using by searching google

Hi, when I tried to do that it says that directory already existed.
I’m trying to import a Virtual Server from an existing nginx Virtual Server on /var/www/mydomain.com

how does it work?

@times,

Please refrain from posting negative comments that are not aimed at helping users. You are entitled to your opinion, but making statements like “as always virtualmin help = no help” is not contributing to the posters question. The Virtualmin team does it’s best to help all users, regardless of whether they are using a GPL or Pro version, however we also encourage users to help one another, as there’s lots of questions and few of us.

@jfolph,

Typically using the instructions I originally posted will result in a resolution, however there may be some quirks with regards to nGinx specifically. If you’d like, I am available to discuss the matter further over Skype. Drop me a line, and we can setup a time and day to look into this further. Cheers!

@edwardsmarkf,

I’m glad my tip was able to help you :slight_smile:

This isn’t off-topic i hope as it’s along the same lines.

Is it possible to force a home directory change to an existing virtual server’s home directory? Virtualmin doesn’t allow this stating the directory already exists, but this is needed to make use of OpenCart’s multi-store feature. I’ve been able to do this on CPanel/Plesk - just having difficulty doing this on Virtualmin, or am i missing something??

@sky

Looking for exact same thing!

Hey @sky and @LeoSilver,
I see this is old but with no answer posted I thought I’d take the chance to contribute.

When you create a new Virtual Server, you have the option of "Alias of yourdomain.com

I use TYPO3 with multiple domains in one instance. Similar to what you want to do with OpenCart.

KC

Here it is:
After hours of searching and playing experimenting with Vmin, i finally figured it out.
for my setup its a little unique and this makes it not a straight forward setup as normal
i am running Ubunto 18, Nginx and Apache running with Vmin installed to manage both (nginx and apache2)

  1. Virtualmin >> System Settings >> Server Templates >> >> Defualt Settings (Notice Under ‘Skeleton Direcory’ >> /etc/skel)

  2. From the drop down select Home directory again notice ‘/etc/skel’ run SSH and type cd /etc/skel then ls (you should find something like:examples.desktop)
    you can open and view content using nano examples.desktop >> i did and the content seem like latin to me and i do not understand latin…but anyways next step…
    Make no changes in step 2, this is just for information purpose

  3. do :
    a. /etc/apache2/suexec then
    b. ls on that and you will find : www-data

  4. nano www-data i had :
    /home
    puplic_html

i changed it to :
/var/www/html
html

  1. navigate back to : Virtualmin >> System Settings >> Server Templates >> >> Defualt Settings
    select ‘Apache Website’ drop down and change:

DocumentRoot ${HOME} to DocumentRoot ${HOME}/html
and
<Directory ${HOME}> to <Directory ${HOME}/html>

by doing this i have changed my default directory from /home to /var/www/html

home is a variable that is equal to /var/www if you know what i mean…

Other problem i was having was nginx ‘site creating’ by virtualmin was writing and updating port “liston:80” into my ports.conf configuration which breaks my setup and stop apache or nginx working…
i remedied this by setting any port other than 80 or 443 (on the apache server setttings) which is reserved for the nginx server which proxies to apache server:8080

Ps: always check these when playing with you setup
a. /etc/apache2/sites-available/creative.ctechn.com.conf (find document and directory settings here : whats written into it by Virtualmin)
b. ports.conf (if any ports have been recently entered in by virtualmin breaking config)

c. then tersting using:
apache2 -t and nginx -t (to make sure you have an ok on all settings configurations)

…CORRECTION to the Above …

---------------------------------------Changing Home website Directory----------------------------

1.

Virtualmin >> System Settings >> Server Templates >> >> Defualt Settings (Notice Under ‘Skeleton Direcory’ >> /etc/skel)

do : a. /etc/apache2/suexec then b. ls on that and you will find : www-data

nano www-data i had : /home puplic_html

i changed it to : /var/www/html html

navigate back to : Virtualmin >> System Settings >> Server Templates >> >> Defualt Settings select ‘Apache Website’ drop down and change:
DocumentRoot ${HOME} to DocumentRoot ${HOME}/${ALIAS} and
<Directory ${HOME}/public_html> to <Directory ${HOME}${ALIAS}/>

by doing this i have changed my default directory from /home to /var/www/html

#######Directives and settings for new websites########

2.

     ..................................................................................(OLD)

ServerName ${DOM}
ServerAlias www.${DOM}
ServerAlias mail.${DOM}
DocumentRoot ${HOME}/public_html
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}/public_html>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

                                                                           TO (/var/www/<DomainAlias>)

…(NEW)

ServerName ${DOM}
ServerAlias www.${DOM}
ServerAlias mail.${DOM}
DocumentRoot ${HOME}/${ALIAS}
ErrorLog /var/log/virtualmin/${DOM}_error_log
CustomLog /var/log/virtualmin/${DOM}_access_log combined
ScriptAlias /cgi-bin/ ${HOME}/cgi-bin/
DirectoryIndex index.html index.htm index.php index.php4 index.php5
<Directory ${HOME}${ALIAS}/html/>
Options -Indexes +IncludesNOEXEC +SymLinksIfOwnerMatch
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch

<Directory ${HOME}/cgi-bin>
allow from all
AllowOverride All Options=ExecCGI,Includes,IncludesNOEXEC,Indexes,MultiViews,SymLinksIfOwnerMatch