# Changing web root in templete not workin?

**URL:** <https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527>\
**Category:** Webmin\
**Tags:** solved\
**Created:** [March 19, 2024, 10:43am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527 "2024-03-19T10:43:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![juan.borras](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@juan.borras](https://forum.virtualmin.com/u/juan.borras)\
**Post date:** [March 19, 2024, 10:43am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/1 "2024-03-19T10:43:45Z")

</div>

Hey there! Just follow the instructions and changed the template “Website for domain” section. Set the DocumentRoot to ${HOME}/public and \<Directory ${HOME}/public\>. Then created a new Virtual Server and the directory is the same old public\_htlml instead of the new “public”.

Any ideas?

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [March 19, 2024, 11:20am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/2 "2024-03-19T11:20:48Z")

</div>

Hello,

@juan.borras If you use Virtualmin with Apache you should also change `public_html` entry in the template above to `public`, e.g.:

 ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/f/f6fbf9082154b2ff61e9e822cdd3af00e93766da.png)

I personally find this a bit confusing and redundant. @Jamie, should we just update the textbox with Apache template automatically when changing `html_dir` option in Virtualmin templates page? It isn’t hard to do.

---

<div class="post-metadata">

**Author:** ![Jamie](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jamie/32/8589_2.png) [@Jamie](https://forum.virtualmin.com/u/Jamie)\
**Post date:** [March 20, 2024, 2:53am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/3 "2024-03-20T02:53:20Z")

</div>

Maybe we should instead just change the “Website subdirectory to create” field to have an “Automatic” option which gets it from the Apache config template?

---

<div class="post-metadata">

**Author:** ![juan.borras](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/j/e56c9b/32.png) [@juan.borras](https://forum.virtualmin.com/u/juan.borras)\
**Post date:** [March 20, 2024, 7:33am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/4 "2024-03-20T07:33:46Z")

</div>

Hey! Thanks! I missed the “User’s website subdir to create” option!

Sorry!!

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [March 20, 2024, 1:58pm UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/5 "2024-03-20T13:58:05Z")

</div>

> [@Jamie](#):
>
> Maybe we should instead just change the “Website subdirectory to create” field to have an “Automatic” option which gets it from the Apache config template?

Yeah it’s easier, and it could work just great too! I thought to keep it consistent with Nginx at first.

---

<div class="post-metadata">

**Author:** ![jovib](https://cdn.forum.virtualmin.com/letter_avatar_proxy/v4/letter/j/ed8c4c/32.png) [@jovib](https://forum.virtualmin.com/u/jovib)\
**Post date:** [March 21, 2024, 10:51am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/6 "2024-03-21T10:51:58Z")

</div>

Same the problem is here with me[.](https://lescobill.pk/lesco-bill-payment/)

---

<div class="post-metadata">

**Author:** ![jimr1](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jimr1/32/14173_2.png) [@jimr1](https://forum.virtualmin.com/u/jimr1)\
**Post date:** [March 21, 2024, 11:41am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/7 "2024-03-21T11:41:06Z")

</div>

did you read

> [@Ilia](#):
>
> Hello,
> 
> @juan.borras If you use Virtualmin with Apache you should also change `public_html` entry in the template above to `public`, e.g.:
> 
> ![image](https://cdn.forum.virtualmin.com/uploads/default/original/2X/f/f6fbf9082154b2ff61e9e822cdd3af00e93766da.png)
> 
> I personally find this a bit confusing and redundant. @Jamie, should we just update the textbox with Apache template automatically when changing `html_dir` option in Virtualmin templates page? It isn’t hard to do.

and the bit the OP missed

> [@juan.borras](#):
>
> Hey! Thanks! I missed the “ **User’s website subdir to create** ” option!
> 
> Sorry!!

That fixes it

---

<div class="post-metadata">

**Author:** ![Stegan](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/stegan/32/6860_2.png) [@Stegan](https://forum.virtualmin.com/u/Stegan)\
**Post date:** [April 21, 2024, 9:46am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/8 "2024-04-21T09:46:40Z")

</div>

> [@Ilia](#):
>
> keep it consistent with Nginx

yes! the choice of webserver used is secondary

---

<div class="post-metadata">

**Author:** ![Ilia](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/ilia/32/10185_2.png) [@Ilia](https://forum.virtualmin.com/u/Ilia)\
**Post date:** [April 22, 2024, 12:27pm UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/9 "2024-04-22T12:27:10Z")

</div>

> [@Ilia](#):
>
> > [@Jamie](#):
> >
> > Maybe we should instead just change the “Website subdirectory to create” field to have an “Automatic” option which gets it from the Apache config template?
> 
> Yeah it’s easier, and it could work just great too! I thought to keep it consistent with Nginx at first.

@Jamie, where we at about this?

---

<div class="post-metadata">

**Author:** ![Jamie](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jamie/32/8589_2.png) [@Jamie](https://forum.virtualmin.com/u/Jamie)\
**Post date:** [April 22, 2024, 8:37pm UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/10 "2024-04-22T20:37:28Z")

</div>

It’s on my TODO list!

---

<div class="post-metadata">

**Author:** ![system](https://cdn.forum.virtualmin.com/uploads/default/original/2X/c/cd96d761e326db4b2bef94886a639109bd7a8e76.svg) [@system](https://forum.virtualmin.com/u/system)\
**Post date:** [June 21, 2024, 8:38pm UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/11 "2024-06-21T20:38:05Z")

</div>

Closed on June 21, 2024, 8:38pm UTC

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Jamie](https://cdn.forum.virtualmin.com/user_avatar/forum.virtualmin.com/jamie/32/8589_2.png) [@Jamie](https://forum.virtualmin.com/u/Jamie)\
**Post date:** [September 15, 2024, 4:30am UTC](https://forum.virtualmin.com/t/changing-web-root-in-templete-not-workin/125527/12 "2024-09-15T04:30:32Z")

</div>

Ok in the next release, there will be no danger of a mismatch because the “Users’ website subdirectory to create” will take precedence over the Apache directives template.
