Set site root folder in site template
-
Hello,
Some apps require to set the public root folder in a subdirectory of site folder.
The quick creation of these apps requires an additional step , and so would be great if there was a way to pass a relative path (sth like "/app") from a site template and have it appended to documentRoot setting of Nginx/Apache..
-
@Kilbourne : As there are only some apps, you can achieve this manually. I will give you some idea on that.
-
In reality all my (wordpress) sites use this setup( i use https://roots.io/bedrock/, which a widespead boilderplate for wordpress installation). And i think it's a common best practice to put the app public folder one level down the root..
-
@Kilbourne : If you want to use
app
as public directory, you just let Laragon know that by put this setting in laragon.ini under [preferences][preferences] PublicDir=app ....
-
Thanks, i will try...
Would be great if this setting was applicable "app template" , i.e. from sites conf ( or even set from sites.conf a particular tpl to apply)..
-
@Kilbourne: Does the setting work for you?
If not, please tell me the reason, I am happy to help.
-
I tried PublicDir setting but i can't see its effect - the nginx config for the site is the same ( and also the folder structure is the same).
Aside this issue, i don't think is what i need ( a global switch). I try to explain it better:
The level at which i would customize is at Quick App templates: all the apps of the same Quick App should be applied the same settings. The settings are 2:- a setting to append a subfolder to nginx root setting ( and same on apache)
- [very minor] a setting to extract the site template in a subfolder
These two in a declarative "laragon" style inside usr/sites.conf would be great, but is ok also to run an user-defined command ( an sh script as ex.) on a postInstalled hook per template. (maybe a file in usr template with same name of sites.conf)
-
Just realized by this that the sites.conf support any command https://github.com/leokhoa/laragon/issues/61 and not only urls, so procedural way is already possible..
-
I'd be interested in running Bedrock within Laragon. Any advice or tutorial much appreciated. Thank you!
-
@Kilbourne , @ladislavsulc : I've created a tutorial here:
https://forum.laragon.org/topic/1383/tutorial-how-to-add-wordpress-project-using-composer-bedrockHope it helps.
-
@leokhoa there's an additional final step for the guide ( the point is about this ticket):
from https://roots.io/bedrock/docs/installing-bedrock/
"4. Set the document root on your webserver to Bedrock's web folder: /path/to/site/web/"
-
@Kilbourne : I don't think it is needed with Laragon as Laragon automates the step.
-
@leokhoa it's not an optional step...you need to set the site root to the "web" subfolder , otherwise it will not work ( give a try to your guide
).
-
This post is deleted!
-
@leokhoa Thank you! Much appreciated. And it looks so simple. Very helpful.