54 lines
2.1 KiB
Markdown
54 lines
2.1 KiB
Markdown
# Installation Script for OpenEMS
|
|
|
|
This installation script automates the setup of OpenEMS on a server. It performs the following tasks:
|
|
|
|
1. **Host Configuration**: Prompts the user to enter the host name for the server. If no input is provided, it defaults to the current hostname.
|
|
|
|
2. **UI Default Setting**: Asks the user if they want to set the OpenEMS UI as the default for the server. If confirmed, it warns that this will override the default Nginx configuration.
|
|
|
|
3. **Package Installation**: Updates the package list and installs the required packages, including OpenJDK 17, Nginx, and Wget.
|
|
|
|
4. **OpenEMS Service Setup**: Downloads the OpenEMS system service configuration and sets up the necessary directories and files for OpenEMS.
|
|
|
|
5. **Nginx Configuration**: Sets up the Nginx server to serve the OpenEMS UI, including downloading the UI files and configuring the Nginx site.
|
|
|
|
6. **Service Management**: Reloads the systemd manager configuration, enables, and starts the OpenEMS service, and restarts Nginx to apply the new configuration.
|
|
|
|
### Installation Instructions
|
|
|
|
You can install OpenEMS by executing these commands:
|
|
|
|
```bash
|
|
# Download the script
|
|
curl -sfLO https://git.mumme-it.de/Mumme-IT/openems-build/raw/branch/main/installation/install-openems.sh
|
|
|
|
# Make it executable
|
|
chmod +x install-openems.sh
|
|
|
|
# Run the installation script
|
|
./install-openems.sh
|
|
```
|
|
|
|
The script will prompt you for:
|
|
- The hostname for your server (defaults to current hostname if left empty)
|
|
- Whether to set OpenEMS UI as the default site for the server
|
|
|
|
## Installation
|
|
|
|
To install OpenEMS, run the following command:
|
|
```bash
|
|
wget -O - https://git.mumme-it.de/Mumme-IT/openems-build/raw/branch/main/installation/install-openems.sh | bash
|
|
```
|
|
|
|
## Updates
|
|
|
|
The installation script also supports updating an existing installation. If you run the script on a system that already has OpenEMS installed, it will:
|
|
|
|
- Update the OpenEMS JAR file
|
|
- Update the UI files
|
|
- Restart the OpenEMS service
|
|
|
|
To update your installation, simply run the installation command again:
|
|
```bash
|
|
wget -O - https://git.mumme-it.de/Mumme-IT/openems-build/raw/branch/main/installation/install-openems.sh | bash
|
|
``` |