could someone with ACF 2016 on Linux please verify...
# adobe
c
could someone with ACF 2016 on Linux please verify the following behaviour with
expandPath()
?
Copy code
<cfoutput>
   expandPath( '/some-dir/' ): #expandPath( '/some-dir/' )#
</cfoutput>
If
some-dir
contains an
index.cfm
, the output is
/var/www/some-dir/index.cfm/
This happens only on ACF on Linux (with on a native install and within a Docker container. It does NOT happen on CommandBox servers though. (So possibly it does not happen on WAR installs?) I'd just like to find out if this is something in ACF or maybe related to your system setup.
a
Copy code
paths = [
    "/existent-directory-with-index-cfm/",
    "/existent-directory-without-index-cfm/",
    "/non-existent-directory/"
]
paths.each((path) => writeOutput("expandPath('#path#'): #expandPath(path)# (index.cfm? #fileExists(expandPath('#path#index.cfm'))#)<br>"))


writeOutput("<br>#server.coldfusion.productVersion# / #server.os.name# / #server.os.additionalInformation# / #server.os.version# / #server.os.arch#<br>")
Copy code
expandPath('/existent-directory-with-index-cfm/'): /app/existent-directory-with-index-cfm/ (index.cfm? YES)
expandPath('/existent-directory-without-index-cfm/'): /app/existent-directory-without-index-cfm/ (index.cfm? NO)
expandPath('/non-existent-directory/'): /app/non-existent-directory/ (index.cfm? NO)

2021,0,03,329779 / UNIX / Linux / 4.19.128-microsoft-standard / amd64
Might be something in your config I think.
c
Thanks @Adam Cameron... so we can say that at least on CF 2021 it works as expected 👍
a
Oh sorry I did not see your mention of CF2016. I can't be arsed working out how to create a CF2016 container, soz.
d
This isn't super helpful, but FYI, at a prior employer, on some older versions of CF and Windows that I don't specifically remember, we ran into the same thing on Windows.
p
@chris-schmitz def not happening to me
message has been deleted
c
Thanks guys, your results show that it must be something in our setup .... and I finally found the reason. We have Apache web server connecting to ACF with mod_jk (the one that comes with ACF). If you have a
DirectoryIndex index.cfm
directive either in your
mod_jk.conf
or in the host configuration,
expandPath()
will behave as I described above. If you remove both, it works as expected.
Lessen learned: describe your server setup properly when asking a question like this 😉