Bug 260964 - www/apache24: command line make options -DWITH_SUEXEC do not work, building only works when setting this in make.conf
Summary: www/apache24: command line make options -DWITH_SUEXEC do not work, building o...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-apache (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-05 21:55 UTC by Stefan B.
Modified: 2025-12-03 10:54 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan B. 2022-01-05 21:55:56 UTC
SirDice of the FreeBSD forums suggested me to enter a PR for this.

PROBLEM:
Setting options on the ports' make build and make install command line
-DWITH_SUEXEC
as well as
-DWITH=SUEXEC
does not work.

Neither does
-DSUEXEC_DOCROOT=...
-DSUEXEC_USERDIR=...
-DSUEXEC_UIDMIN=...
-DSUEXEC_GIDMIN=...
-DSUEXEC_LOGFILE=...
work.

WORKAROUND:
This all only works if one sets these defines in make.conf.

EXPECTED BEHAVIOUR:
Works like described in the documentation, using the make -D command line options.
Comment 1 Bernard Spil freebsd_committer freebsd_triage 2025-12-03 10:05:31 UTC
Hi Stefan,

Having a bit of trouble figuring out how you actually invoked and where you got information/documentation from.

1. Can you provide the full commandline(s) you tried?
2. Can you provide links to the documentation you got the information from?

Neither https://man.freebsd.org/cgi/man.cgi?query=ports nor https://docs.freebsd.org/en/books/handbook/book/#ports show use of -D for configuring the port.

1. Use `make config` to configure port
2. Use `env=SUEXEC_DOCROOT=... make ` to override defaults
Comment 2 Bernard Spil freebsd_committer freebsd_triage 2025-12-03 10:07:58 UTC
(In reply to Bernard Spil from comment #1)

With your testing, also check outcome of your configuration using e.g.

> SUEXEC_DOCROOT=/tmp/bla make -VSUEXEC_DOCROOT

that shows you what SUEXEC_DOCROOT ends up being.
Comment 3 Stefan B. 2025-12-03 10:39:22 UTC
(In reply to Bernard Spil from comment #2)
Hi Bernard,

thank you very much for reply!
In short, the application (graphical configuration with suexec requirements) now has been abandoned.
Iirc back then the information in the FreeBSD Handbook (or some other reputable source like the mailing lists) was to use -D<flag>.
As this did not work, I asked in the FreeBSD Forums, and helpful SirDice showed me the make.conf alternative. It was also suggested that I post a bug report to clear that discrepancy.

However the handbook (also the sections regarding setting up web servers and suexec) seems to be updated a lot in the meantime, which is almost 5 years (see https://forums.freebsd.org/threads/ports-manpage-need-for-clarification-of-make-target-function-and-behavior.78420/post-490210 )


So I guess this has solved itself by time, or the advice in the forums mentioned above was incorrect.

Thank you again Bernard!
Comment 4 Bernard Spil freebsd_committer freebsd_triage 2025-12-03 10:54:12 UTC
(In reply to Stefan B. from comment #3)

Happy that it's been resolved!