AWS Linux 2023 incomplete Lucee Install Apache/Tomcat/Lucee

Trying again as I’ve hit a cul-de-sac with any further information.
Installing a fresh Lucee 5.4.5.23 on an AWS Linux 2024 box.
I have installed apache, ran the Lucee installer and got tto the point where the error

 Error running /opt/lucee/sys/install_mod_proxy.sh -m install -t 8888 -f 
/etc/httpd/conf/httpd.conf -c /usr/sbin/apachectl: apachectl: The "-M" option is 
not supported.
apachectl: The "-M" option is not supported.
apachectl: The "-M" option is not supported.
apachectl: The "-M" option is not supported.
Press [Enter] to continue:

Lucee works and has picked up by instance in /tomcat/webapps instance but

Listing the modules which on this system is

httpd -M

Does not list the mod_proxy or mod_cfm modules as loaded. Which presumably means the connector is not going there.

There doesnt appear to be any instructions other than just running the installer for me to reference to try and fix this. Would running this on another flavour of linux (other than AWS 2023 or Linux 2 - which is dropping support) be a better idea?

OS: Linux (6.1.79-99.167.amzn2023.x86_64) 64bit
Java Version: 11.0.22 (Eclipse Adoptium) 64bit
Tomcat Version: Apache Tomcat/9.0.86
Lucee Version: Lucee 5.4.5.23

hi @Nick_Batt

Yes running another Distro would solve this. I suggest Alma, Rocky, RHEL or some RHEL clone.

The install would go as follows after spin up

yum update -y
yum install httpd mod_ssl -y
yum install rsync wget -y (these maybe already installed)

after install, setenforce 0 (temporarily tell SELINUX to stop)

for Lucee 6
wget https://cdn.lucee.org/lucee-6.0.1.83-linux-x64-installer.run

For Lucee 5
wget https://cdn.lucee.org/lucee-5.4.5.23-linux-x64-installer.run

chmod +x File you just downloaded…
sh ./file you just downloaded
run installer as normal

after install, vi /etc/httpd/conf/httpd.conf
make sure proxy_http and proxy are uncommented

Add the following if the installer did not already add it to your vhost or your main httpd.conf file

[Blockquote] ```

<Proxy >
Allow from 127.0.0.1

ProxyPreserveHost On
ProxyPassMatch ^/(.+.cf[cm])(/.
)?$ http://127.0.0.1:8888/$1$2
ProxyPassMatch ^/(.+.cfml)(/.)?$ http://127.0.0.1:8888/$1$2
# optional mappings
#ProxyPassMatch ^/flex2gateway/(.
)$ http://127.0.0.1:8888/flex2gateway/$1
#ProxyPassMatch ^/messagebroker/(.)$ http://127.0.0.1:8888/messagebroker/$1
#ProxyPassMatch ^/flashservices/gateway(.
)$ http://127.0.0.1:8888/flashservices/gateway$1
#ProxyPassMatch ^/openamf/gateway/(.)$ http://127.0.0.1:8888/openamf/gateway/$1
#ProxyPassMatch ^/rest/(.
)$ http://127.0.0.1:8888/rest/$1
ProxyPassReverse / http://127.0.0.1:8888/


start lucee, if you installed it as a service
systemctl start lucee

start apache
systemctl start httpd

Now if your ports are not already open 

firewall-cmd --zone=public --add-service=http --permanent
firewall-cmd --zone=public --add-service=https --permanent
1 Like

Thankyou, thats perfect. I will have a crack at that.

Just post here or PM me if you get stuck.

Thanks I have one question, trying to find where I put the export Application.cfc in CFadmin on source (production server) on the new commission server to bring over the DSN and mappings etc?
I am not running CommandBox so cant just export it all

I’ve had great success with AlmaLinux and I also use AJP (Apache JServ Protocol) for more efficient communication between Apache and Tomcat compared to using standard HTTP.

So my Apache config includes the following:

<IfModule mod_proxy.c>
    <Proxy *>
    Allow from 127.0.0.1
    </Proxy>
    ProxyPreserveHost On
    ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://127.0.0.1:8009/$1$2 flushpackets=on secret=redacted
    ProxyPassMatch ^/(.+\.cfchart)(/.*)?$ ajp://127.0.0.1:8009/$1$2 flushpackets=on secret=redacted
    ProxyPassMatch ^/(.+\.cfml)(/.*)?$ ajp://127.0.0.1:8009/$1$2 flushpackets=on secret=redacted
    ProxyPassReverse / ajp://127.0.0.1:8009/ secret=redacted
</IfModule>

LoadModule modcfml_module modules/mod_cfml.so
CFMLHandlers ".cfm .cfc .cfml"
ModCFML_SharedKey "redacted"
LogHeaders false
LogHandlers false
LogAliases false
VDirHeader false

in the lucee admin
under settings
You should be able to click “Export”
There are all your settings.

Sorry, Maybe I misread that.

If you are talking Just the Application.CFC, you would put it in the root of your file system.

if you are using the Proxy method and added a vhost it would be /var/www/html/Vhostname/YourluceeCodeRoot/

If you are just using proxy as is, then it would be
/var/www/html/

remember to chown the files so apache can access and understand what you are throwing at it.

ie chown -R apache.apache /var/www/html

:slight_smile:

Thanks. Much appreciated, I got that part just not where the information gets imported to. I set all the mappings and DSN at the server level not the individual web context

Lucee 5 its stored as an XML file under the WEB-INF
In Lucee 6 its stored as a json file under the /lucee/context/ location .CFconfig.json

Any specific ALMA version to go for 8 or 9? There are plenty of free AMIs but its not flavour I’ve used before

I would go with the latest, but both are great and I use both in production.

Ok I added that to the httpd.conf just after the last line:

# Load config files in the "/etc/httpd/conf.d" directory, if any.
IncludeOptional conf.d/*.conf
<Proxy >
Allow from 127.0.0.1
etc....

but Apache will not restart, I also added a closing </Proxy> tag but that didnt work either.

Ok looks like thats fixed, needed that to be:

<IfModule mod_proxy.c>
<Proxy * >
Allow from 127.0.0.1
</Proxy>
Stuff...
</IfModule>
2 Likes

Ok here’s what I did with only Lucee installed so far, no other vhosts - as in my production server all the DSN and mappings are set at this level.

In:
/opt/lucee/tomcat/webapps/ROOT/Applcation.cfc (this file already exists)
Pasted my export from production server, restarted, but none of the values are present.

I could be mistaken but my understanding of Application.cfc is that it only applies to each webroot, not the entire server? See below, screenshot from Lucee Admin > Settings - Request.

What I do is copy/paste <data-sources> and <mappings> from/to:

/opt/lucee/tomcat/lucee-server/context/lucee-server.xml

Of course you’ll need to adjust mapping paths if they don’t match the source.

Thanks, that what I was hoping to do but there are no entries in my lucee-server.xml.cfm files (they do exist) I’ve searched and cannot find any in the ROOT (cfadmin) or in my context for the actual website.

I’ll have another search

1 Like

Have you tried searching with grep?

sudo grep -rl "YOUR_DATASOURCE_NAME" /opt/lucee/

Excellent - found it in that path, I was previously looking for lucee-web.xml.cfm

1 Like