-
Hello, The domain-structure should be: I tried everything I found with Google, but nothing works. Thank you. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 8 replies
-
The explanation you have found is correct, I can give more information on how Laragon works and add more detail. When a new project is created in c:\laragon\www Laragon will automatically detect the folder, it will:
Each time a project is added to the www directory the auto file will be re-created, it is not advisable to edit them. Example: I assume each of the projects has its own entry point, therefore create the three projects in the www directory: admin-project Laragon will create three entries in the host file: 127.0.0.1 admin-project.test #laragon magic!
127.0.0.1 app-project.test #laragon magic!
127.0.0.1 main-project.test #laragon magic! Laragon will also create three Apache conf files: auto.admin-project.test.conf
auto.app-project.test.conf
auto.main-project.test.conf Copy the three #laragon magic! lines in the host file and amended them to the required subdomain
Tip: Note the domain change from .test to .local, this is to separate the Laragon domain from manually configured ones. Feel free to amend Laragon to use .local and .test for manual. Next, navigate to the sites-enabled folder. Copy each of the auto Apache conf files and rename them: manual.admin.myproject.local.conf
manual.app.myproject.local.conf
manual.myproject.local.conf Edit each of the three manual files and change the define SITE e.g. the app site will be: define SITE "app.myproject.local" For the main site also remove the wildcard: ServerAlias *.${SITE}, as this may cause problems with the subdomains Restart Apache and you can now navigate each site by its subdomain. Note: Each site must have an index.html or index.php file in the project folder or public subfolder for Laragon Magic to work, if you have another entry point the Apache file may need to be amended. For example, How to develop a Node.js app with Laragon ? #455 Tip: if you haven't enabled SSL in Laragon see my blog: How to set up Laragon on a new Windows computer (part 4) - Enable security I hope this helps, if you have any further questions please ask. |
Beta Was this translation helpful? Give feedback.
-
Thanks very much for your fast answer, your explanation works fine. So for the sake of completeness, the content of my manuals: For the main domain ->manual.myproject.test.conf:
And for the "admin" Subdomain ->manual.admin.myproject.test.conf:
|
Beta Was this translation helpful? Give feedback.
-
but I think if we have some thing like multitenant application where subdomain created on the fly we don't need multiple projects for subdomain I mean our main application abc.test and the subdomain is user1.abc.test and then user2.abc.test and so on...so the above discussion does not look or support this case as i have tried it practically any input or solution for this is welcome |
Beta Was this translation helpful? Give feedback.
The explanation you have found is correct, I can give more information on how Laragon works and add more detail.
When a new project is created in c:\laragon\www Laragon will automatically detect the folder, it will:
Each time a project is added to the www directory the auto file will be re-created, it is not advisable to edit them.
Example:
I assume each of the projects has its own entry point, therefore create the three projects in the www directory:
admin-project
app-project
main-project
Laragon will create three entries in the host file: