Hi. I'd like to ask a question about a problem that I've been facing with OpenLiteSpeed.
Here's the full problem.
So I'm running a deployment script on my VM. When there's new version of the app, the scripts runs this sequence:
Now, the problem happens at step 5 and 10. When the production or backup web folder is deleted, there's about 1-2 seconds window the webserver returns 404, and then goes back to normal. Even though at that point OLS should use the new folder (I checked at the WebAdmin, and I swear it showed that the context uses the new folder), instead of the previous one that gets deleted.
What is the solution for this?
Thank you.
Here's the full problem.
So I'm running a deployment script on my VM. When there's new version of the app, the scripts runs this sequence:
- Create a backup folder for the current production web folder.
- Create (or if exists, edit) context for URL "/" to point to the backup folder.
- Restart OLS using `service lsws try-restart`.
- Wait for 5s so I'm sure OLS fully restarts.
- Delete current production web folder.
- Copy new files to the production web folder.
- Edit context for URL "/" to point to the new production web folder with the new files.
- Restart OLS using `service lsws try-restart`.
- Wait for 5s so I'm sure OLS fully restarts.
- Delete backup folder.
Now, the problem happens at step 5 and 10. When the production or backup web folder is deleted, there's about 1-2 seconds window the webserver returns 404, and then goes back to normal. Even though at that point OLS should use the new folder (I checked at the WebAdmin, and I swear it showed that the context uses the new folder), instead of the previous one that gets deleted.
What is the solution for this?
Thank you.