Unattended Install throws apachectl: The "-M" option is not supported

I’m trying to script and install and setup on Alma Linux 9 (says installer is supported).
I’m on Hetzner Cloud using Alma Linux 9
I’m having trouble when it comes to running the lucee installer in unattended mode
The error I get is (running as root):

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.
Failed to install Lucee

The part of the script that installs Lucee:

# Download and install Lucee
mkdir -p /opt/lucee
mkdir -p /opt/tmp

curl -o /opt/tmp/lucee-installer.run https://cdn.lucee.org/lucee-6.2.0.321-linux-x64-installer.run || echo "Failed to download Lucee installer" >> $LOGFILE
chmod +x /opt/tmp/lucee-installer.run || echo "could not make lucee installer executable" >> $LOGFILE

/opt/tmp/lucee-installer.run --mode unattended --luceepass "@mypass" >> $LOGFILE || echo "Failed to install Lucee" >> $LOGFILE

Nothing has changed in that code in a while, did it work previously?

This is the first time I have attempted to script an install, so could not say. I can post the full script if that might help

Server version: Apache/2.4.62 (AlmaLinux)

What version of Apache?

That code hasn’t changed in over four years

It’s trying to get a list of installed modules, -M option is meant to be passed to httpd to list the installed modules/?

https://httpd.apache.org/docs/trunk/en/programs/apachectl.html

https://httpd.apache.org/docs/trunk/en/programs/httpd.html

Thanks.
Thats the output of httpd -v
I’m not adding any other flags to the install so I would asume all the defaults are in place, unless there’s another flag I need to run with the installer
Server version: Apache/2.4.62 (AlmaLinux)

here’s a workaround, call httpd directly

what does httpd -M show?

Ok thanks that seems to have moved things along though, I now get this error:

Error running /opt/lucee/sys/install_mod_cfml.sh -m install -f /etc/httpd/conf/httpd.conf -d /usr/lib64/httpd/modules/ -c /usr/sbin/httpd -k a3d93e1882f6436bf954eaae8f187edea80463c46fcdbd01ec65880e326fcb2f: Usage: /usr/sbin/httpd

httpd -M

AH00558: httpd: Could not reliably determine the server's fully qualified domain name, using ::1. Set the 'ServerName' directive globally to suppress this message
Loaded Modules:
 core_module (static)
 so_module (static)
 http_module (static)
 access_compat_module (shared)
 actions_module (shared)
 alias_module (shared)
 allowmethods_module (shared)
 auth_basic_module (shared)
 auth_digest_module (shared)
 authn_anon_module (shared)
 authn_core_module (shared)
 authn_dbd_module (shared)
 authn_dbm_module (shared)
 authn_file_module (shared)
 authn_socache_module (shared)
 authz_core_module (shared)
 authz_dbd_module (shared)
 authz_dbm_module (shared)
 authz_groupfile_module (shared)
 authz_host_module (shared)
 authz_owner_module (shared)
 authz_user_module (shared)
 autoindex_module (shared)
 cache_module (shared)
 cache_disk_module (shared)
 cache_socache_module (shared)
 data_module (shared)
 dbd_module (shared)
 deflate_module (shared)
 dir_module (shared)
 dumpio_module (shared)
 echo_module (shared)
 env_module (shared)
 expires_module (shared)
 ext_filter_module (shared)
 filter_module (shared)
 headers_module (shared)
 include_module (shared)
 info_module (shared)
 log_config_module (shared)
 logio_module (shared)
 macro_module (shared)
 mime_magic_module (shared)
 mime_module (shared)
 negotiation_module (shared)
 remoteip_module (shared)
 reqtimeout_module (shared)
 request_module (shared)
 rewrite_module (shared)
 setenvif_module (shared)
 slotmem_plain_module (shared)
 slotmem_shm_module (shared)
 socache_dbm_module (shared)
 socache_memcache_module (shared)
 socache_redis_module (shared)
 socache_shmcb_module (shared)
 status_module (shared)
 substitute_module (shared)
 suexec_module (shared)
 unique_id_module (shared)
 unixd_module (shared)
 userdir_module (shared)
 version_module (shared)
 vhost_alias_module (shared)
 watchdog_module (shared)
 brotli_module (shared)
 dav_module (shared)
 dav_fs_module (shared)
 dav_lock_module (shared)
 lua_module (shared)
 mpm_event_module (shared)
 proxy_module (shared)
 proxy_http_module (shared)
 proxy_ajp_module (shared)
 ssl_module (shared)
 systemd_module (shared)
 cgid_module (shared)
 http2_module (shared)
 proxy_http2_module (shared)
 modcfml_module (shared)

I’m a bit stuck here,
I’ve followed the requirements of supported OS and instructions for the unattended install, just trying a vanilla install to start with, before I get more adventurous and pull my own site in and try and configure that.
I’ve removed any of my own customisation and now just - install apache and then lucee
But that throws this error:

Problem running post-install step. Installation may not complete correctly
 Error running /opt/lucee/sys/install_mod_cfml.sh -m install -f /etc/httpd/conf/httpd.conf -d /usr/lib64/httpd/modules/ -c /usr/sbin/httpd -k ab9923ebf6da949f1a976c9cd7e47aa08f858bd511edf7c7d4646496fb8abcb2: Usage: /usr/sbin/httpd [-D name] [-d directory] [-f file]

I listed the modules (/usr/lib64/httpd/modules/) and noticed the switches for t mod_cfml.so are different to the rest of the modules listed, perhaps a clue?

-rwxr-xr-x. 1 root root  40496 Jan 21 21:25 mod_cache_socache.so
-rw-r--r--. 1 root root  46695 Mar  3 17:00 mod_cfml.so

I wonder if there are any script examples for autoconfiguring a basic Lucee install I can peruse to see if I’m doing something especially wrong.

does apachectl -t -D DUMP_MODULES work?

No, I get this:
Passing arguments to httpd using apachectl is no longer supported.
You can only start/stop/restart httpd using this script.
To pass extra arguments to httpd, see the httpd.service(8)
man page.

I am currently trying to manually run the installer using the /usr/sbin/httpd path to apache control and have come across thi same issue during the final install process:

 Error running /opt/lucee/sys/install_mod_cfml.sh -m install -f 
/etc/httpd/conf/httpd.conf -d /usr/lib64/httpd/modules -c /usr/sbin/httpd -k 
df3b42923f49d6a3d562956b91a331aac0dbabf622c01c5f4bc20a7d85553f4f:

I have a virtual host in my httpd.conf for the ROOT default lucee site, and I can see that the installer has added lines, but going to my IP and I am just geting the Apache default page.
relevant lines of my httpd.conf

<VirtualHost *:80>
  DocumentRoot /opt/lucee/tomcat/webapps/ROOT
  ServerName mydomain.com
  DirectoryIndex index.cfm
  <Directory "/opt/lucee/tomcat/webapps/ROOT">
    Options -Indexes
    AllowOverride All
    Require all granted
    DirectoryIndex index.cfm
    RewriteEngine On
    RewriteRule         ^index.cfm                      / [R=301,L,NC]
    RewriteRule         ^($|.*\.cf[mc])$                ajp://localhost:8009/$1 [P]
  </Directory>
  <Location /lucee>

    <RequireAny>
      Require ip my IP
    </RequireAny>
  </Location>
  ServerSignature Off


  # TODO remove this when we're sure the load balancers are doing this
  #  RequestHeader set host "mydomain.com"
    CustomLog /var/log/httpd/sonic_access.log combined
  ErrorLog /var/log/httpd/sonic_error.log
  <Proxy *>
    Require all granted
  </Proxy>
  ProxyPreserveHost On
  ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ ajp://127.0.0.1:8009/$1$2
</VirtualHost>

<IfModule mod_proxy.c>
  ProxyPreserveHost On
  ProxyPassMatch ^/(.+\.cf[cm])(/.*)?$ http://127.0.0.1:8888/$1$2
  ProxyPassMatch ^/(.+\.cfml)(/.*)?$ http://127.0.0.1:8888/$1$2
  ProxyPassReverse / http://127.0.0.1:8888/
</IfModule>

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

Ok so it appears that even with that error, the install is working.

@Nick_Batt see Updated Almalinux / Redhat installer

Ok great, I’ll try and test. Thanks!

1 Like

I’m getting the same error.

From the man page for apachectl it appears that (at least) AlmaLinux 9 (that is all I have tested on so far) has replaced the usual apachectl package with a wrapper:

Compatibility
The version of apachectl used on this system is a replacement script intended to be mostly (but not completely) compatible with version
provided with Apache httpd. This apachectl mostly acts as a wrapper around systemctl and manipulates the systemd service for httpd. The
interface to the Apache version of apachectl is described at apachectl - Apache HTTP Server Control Interface - Apache HTTP Server Version 2.4.

I don’t know on what world they consider “mostly” to be valid given the number of arguments that apachectl used to include, but I suppose there isn’t much we can do about it.