A set of bash scripts for standing up a Lucee server using nginx and Tomcat on Amazon Linux. Uses
- Updates Amazon Linux - simply runs
yum update -y
andyum upgrade -y
- Downloads Lucee - uses curl to download lucee jars from BitBucket places jars in
"https://release.lucee.org/rest/update/provider/loader/$lucee_version
- Installs & Configures Tomcat 9 - download tomcat9 updates the
web.xml
server.xml
andcatalina.properties
to configure Lucee servlets and mod_cfml Valve. (Tomcat/Lucee run on port 8080 by default). - Run
install.sh
- make sure you are root or sudo and run./install.sh
you may need tochmod u+x install.sh
to give execute permissions to the script. - JVM/Tomcat9 - Check services.
- Installs & Configures nginx - runs
yum install nginx -y
to install nginx. Creates a web root directory. Creates alucee.config
file so you can justinclude lucee.config
for any site that uses CFML - Set Default Lucee Admin Password - uses cfconfig to set the Lucee server context password and default web context password. If environment variable ADMIN_PASSWORD exists that is used, otherwise a random password is set.
Take a look in the scripts/
subfolder to see the script for each step.
- Download this repository -
wget https://github.com/victorbvieira/amazon-linux-nginx-lucee/archive/refs/heads/main.zip
- Extract repository -
unzip main.zip
- Configuration - You can either Edit the
install.sh
and change any configuration options such as the Lucee Version or JVM version - or you can use environment variables (see below). - Run install.sh - make sure you are root or sudo and run
./install.sh
you may need tochmod u+x install.sh
to give execute permissions to the script.
By default nginx on Amazon Linux looks in the folder /etc/nginx/conf.d/
for configuration nginx files, for example /etc/nginx/sites-enabled/me.example.com.conf
at a minimum it will look like this:
server {
listen 80;
server_name me.example.com;
root /web/me.example.com/wwwroot/;
include lucee.conf;
}
After making changes you need to restart or reload nginx:
sudo service nginx restart
Commandbox error installing
Solution:
During the installation process, java 17 can be installed and activated automatically, to fix it, run the alternatives --config java
command and select the java 11 option
Pete Freitag Special thanks for creating the ubuntu-nginx-lucee repository which was used as a base to adapt Ubunto commands for Amazon Linux and Nginx update
Andreas Thanks Andreas, for the hours you spent together with me configuring the CommandBox in a Raspberry PI, this was the beginning for this script
Daniel Mejia That with a lot of patience and persistence we discovered that the Commandbox did not run in java 17, thanks for the help
PC Silva With him I learned a lot about nginx and to understand its folder structure