This guide explains the proper way to restart Lucee on Windows and Linux. It also covers why you should avoid using the bundled start.sh
/ stop.sh
scripts that come with Lucee installers.
Step-by-step guides in this article:
- Why You Should Avoid the Bundled Scripts
- Restarting Lucee on Windows
- Restarting Lucee on Linux
- Troubleshooting
Why You Should Avoid the Bundled Scripts
Lucee's distribution includes control scripts such as start.sh
, stop.sh
or startup.bat
. While these may work for some setups, using them in other environments can be catastrophic. Based on our experience, a few common issues include:
- Missing JVM Arguments: Sometimes additional JVM arguments are passed in via a custom script or service manager.
- Wrong User Context: Starting up Lucee as the wrong user will likely result in the server context being overwritten and all configuration lost. This includes datasources, scheduled tasks, mappings and a number of other settings. The password you used previously for the context also would be lost and require resetting. Note that starting up Lucee with the wrong user will also cause the felix-cache to be cleared.
- Failure to Stop or Start an Instance: If a service manager is set up or a custom script executes to change the default ports used for Lucee (including the start/stop ports), then this could result in multiple instances of Lucee running, or a failure to start the Lucee server because it is already running due to a failed stop.
In short, if your server uses a service manager, like services.msc
for Windows, or systemctl
for Linux, then we recommend only using those for Lucee service operations (stop/start/restart). Using a singular method for restarting Lucee is always a good practice anyway, so if possible make it a practice of utilizing the service manager on the server for these operations.
Restarting Lucee on Windows
On Windows, the Lucee service should be controlled by the built-in Windows Service console (services.msc
), so that the service not only can be easily restarted on demand, but also so that Lucee starts up when the server is rebooted by setting the service to an Automatic startup type. At Vivio, we automatically set up your Lucee service to be controlled via the Windows Service console. The steps to restart Lucee are below:
1. The first step is to log in to your server via remote desktop protocol (RDP). Your server account information should be within your account welcome email, but you can also find this information via your Vivio portal. View our guide on locating your service credentials, if needed.
2. Open the Windows Service Utility. Methods to do this are listed below:
- Start Menu > type "services" and click on the the result for services (should have two gear icon).
- Start Menu > Windows Administrative Tools > Services
- Use the Run utility and enter: services.msc
- Open Command Prompt and enter: services.msc
- Open File Explorer and run: %windir%\system32\services.msc
3. In the Windows Service Utility, find the service for Lucee. The name of the service depends on how it was configured when added to the services console. Typical names are:
- Apache Tomcat
- Lucee x.x (where x.x is the major.minor version)
- Tomcat
4. After selecting the service, you should see an option for "Start", "Stop" and "Restart". You can choose your desired operation and wait for the control service to confirm it succeeded. Depending on several factors, including server resources or the number of websites on the server, this may take a minute or two to process.
Restarting Lucee on Linux
On Linux, the Lucee service is typically controlled by either service
or systemctl
commands, depending on the OS and configuration. We will cover both below:
Using systemctl command
You can verify if your server's systemctl is configured to control Lucee in several ways. You can either run systemctl without any commands, which will include a list of services controlled by systemctl and whether the service is enabled and loaded. Another method is to run systemctl list-unit-files | grep lucee
which will show you the service name if it is configured and whether it is enabled and loaded. If no results are found, then it may not be configured, unless it was done so under another name which is not usual. Once you know the name, then you can run the steps below:
- Log in to the server via SSH. View our guide on locating your service credentials, if needed.
- Run your desired systemctl command below. If your control service name is different than the usual lucee_ctl then reference the correct name:systemctl example commands
# Command to check the status of the Lucee service systemctl status lucee_ctl # Command to restart Lucee (will attempt to stop, then start up Lucee) systemctl restart lucee_ctl # Command to stop Lucee systemctl stop lucee_ctl # Command to start Lucee systemctl start lucee_ctl
If you want to make sure that Lucee stopped, then there are a few options:check if service is running# Command to check Lucee port (if listening then service is running) netstat -tul | grep "8888" # or newer package to check Lucee port ss -tul | grep "8888" # Command to list processes running on system, then searching for keyword "lucee" ps aux | grep "lucee"
Using service command
You can check if your server's service utility is configured for Lucee service operations by running the command service --status-all
and then looking through the list of services to see if Lucee is listed. Note that this command usually takes a while as it lists out each service after doing a status check. You can also run service lucee_ctl status
as a quick check if it's using the normal naming convention.
The steps to restart Lucee using the service command are below:
- Log in to the server via SSH. View our guide on locating your service credentials, if needed.
- Run your desired service command below. If your control service name is different than the usual lucee_ctl then reference the correct name:service command examples
# Command to check the status of the Lucee service service lucee_ctl status # Command to restart lucee service restart lucee_ctl # Command to stop Lucee service stop lucee_ctl # Command to start Lucee service start lucee_ctl
If you want to make sure that your Lucee service is stopped, then refer to the options listed in the section above using either the netstat or ps aux commands.
Having Trouble Restarting Lucee?
Depending on the problem you are facing, you might find it easier to restart Lucee when the web server, such as IIS or Apache is stopped. If there is a lot of web traffic coming into the server, then it might overwhelm Lucee while it's still trying to start up and cause a large number of requests piling up for Lucee to process.
On Windows, using IIS as your web server, you can either stop the websites in the IIS GUI or you can stop the entire IIS webserver by running iisreset /stop
in an elevated Command Prompt (running as Administrator). Just be sure to run the oppositive command to start IIS back up after Lucee starts up fully by running iisreset /start
.
On Linux, if you are using Apache, then you can stop Apache temporarily using the same service
or systemctl
service control commands we talked about earlier, but for Apache instead (it may be listed as either apache, apache2 or httpd).
If you are still having trouble restarting Lucee, then contact our Vivio support team for assistance.