Can i reload nginx from command line like the Reload button in the main ui?
-
I love
Laragon
and ever since i found just what i personally use, thank you!
Im working a small project and i would like to reload nginx after i made new folders. But instead that i must click theReload
button, i want run a command in the shell for examplelaragon -reload
or something, because theReload
command edit the hosts file and update nginx configurations after i clicked - lazy i know.
I want list and manage my projects with a small laravel application. I learn about sockets now and i invent this.
Here is my half-baked solution - it isnt too informative: http://pastebin.com/kuFAh4CC
-
@x-rep-zm: I believe you want to automate Laragon and your code looks fine
I'll release Laragon 2.1.5 which supportslaragon reload
soon.
-
Really? I love You, thanks! I share with you the code if im ready.
-
@x-rep-zm: Laragon 2.1.5 is ready
You can calllaragon reload
for your purpose.
https://forum.laragon.org/topic/323/laragon-2-1-5-release-announcement-auto-created-virtual-hosts-from-command-line-laragon-reload
Note, because Laragon can run with both Nginx & Apache, you can specify service to be reloaded:
laragon reload nginx
laragon reload apache
-
Thank you! This is a
Christmas
gift
-
In my computer i used simple setup for creating new hosts without problems and keeping safety.
Log in with a user with Administrators group (e.g. the firts installed user).# Activate superuser and setup the new password net user Administrator /active:yes * # Create a new command window with administrator privileges runas /user:Administrator cmd # Create a new usergroup net localgroup /add Developers # Always prompt when changing is detected (useraccount control settings) reg add HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System /v ConsentPromptBehaviorAdmin /t REG_DWORD /d 2 /f # Add write only acces to the hosts file for Developers usergroup icacls %systemroot%\System32\drivers\etc\hosts /grant Developers:w # Create a new user (the new user autmatically assigned with Users group too) net user /add developer /fullname:"Developer" * # Add the new user to the created usergroup net localgroup /add Developers developer # Leave superuser command window exit # Logout: rundll32 user32.dll,LockWorkStation
Logged in with developer user
# Create new host cd %laragonroot% && mkdir www/newhost && echo It works! > www/newhost/index.php # And now enjoy the auto virtualhost feature laragon reload && start http://newhost.dev
-
Nice
You must be a Windows guru!
-
@leokhoa No, im not. I have got a mistake, sorry.
"The snake can sometimes stumble."
# Correct cd %laragonroot% && mkdir www/newhost && echo It works! > www/newhost/index.php # Wrong. Must create the folder before creating the index file cd %laragonroot% && echo It works! > www/newhost/index.php
-
No worries, I see that you are very keen on what you are trying to achieve.
Good to know you
Merry Xmas!
-
@leokhoa Merry Christmas to You too!
-
@leokhoa I have got an issue.
Afterreload
ran, nginx won't serve the new host correctly. And the windows message is get stuck on tray. Is clickable but dont solve anything.- stop laragon (elephant)
- delete all generated nginx sites (Menu/Nginx/sites-enabled/Delete all [auto]
- remove current host from hosts file (h)
- remove current directory
- start laragon (elephant)
- visit manager site then click the button
- laragon reloaded
- host added in the hosts file
- nginx create the new config file
- visit the page, but i see only the laragon logo
I stop and start laragon then everything is fine.
Have You any idea?https://github.com/xrepzm/project-manager (not eventual)
I use win 10 x64 with nginx-ed laragon.
-
I had tested
laragon reload
carefully with Win 7 x32/Win 10 x64/Win 2012 x64
I guess the issue is on your code when callinglaragon reload