Solved Reconciling Virtualmin and Apache 24 mod_suexec

gladiola

Member


Messages: 38

#1
I am having some difficulty getting Virtualmin to work with Apache24. Most of the download and install seemed to go okay. However, I am having difficulty with mod_suexec. I'm not sure how to adjust the scripts to help me work around this problem.

I have compiled my Apache24 from ports, using the make config option for SUEXEC in the curses dialog. It does pull in, and it installs the .so file in the expected location. However, I am trying to use Virtualmin/Webmin. That program requires mod_suexec, and it needs it in a particular place.

As I have worked through the installation process for these programs, in Virtualmin, I now receive the warning:

"The Suexec command on your system is configured to only run scripts under /usr/local/www/data, but the Virtualmin virtual server home directory is /usr/home. CGI and PHP scripts run as domain owners will not be executed.
" .. your system is not ready for use by Virtualmin."

Because I have received this message, it seems to me that the correct action would be to adjust the mod_suexec to work with Virtualmin. I think I would like to know how to compile Apache24 to use mod_suexec with the argument for --with-suexec-userdir=DIR. I think the correct value for DIR will be the /usr/home specified in the warning. I came to that conclusion after reviewing this page: https://httpd.apache.org/docs/2.4/suexec.html

I reviewed the Makefile for Apache24 that I found in /usr/ports/www/apache24 . I noticed that there were three makefiles for Apache24. I am not sure where to place what edit to try to adjust how Apache uses suexec. If there are other options or changes that I must make to Apache instead, then those clues have escaped me. So far, I have not gone far into modifying Apache24's httpd.conf beyond adding a few modules that seemed to be needed for Virtualmin.

Any advice you might have on making the necessary adjustments might be helpful. Thanks.
 
OP
OP
gladiola

gladiola

Member


Messages: 38

#3
I apologize. There were multiple edits required to httpd.conf in order to get the Virtualmin working. There were no modifications needed to suexec.

References included:
https://httpd.apache.org/docs/2.4/howto/public_html.html
https://httpd.apache.org/docs/2.4/vhosts/examples.html

Modifications that had to be made include:
In httpd.conf:
Adding:
# Virtualmin needs these apache mods
LoadModule suexec_module libexec/apache24/mod_suexec.so
LoadModule actions_module libexec/apache24/mod_actions.so
LoadModule cgi_module libexec/apache24/mod_cgi.so

Uncommenting LoadModules for related topics and CGI.
Commenting out the directives for CGI Bin defaults
Uncommenting the Includes for User home directories and Virtual Hosts.

Inside the config for the user home directories:
Establish the values for the UserDir and the Directory directive.

This got me to loading Virtualmin without warnings, but the results of the settings may require further troubleshooting.
 
OP
OP
gladiola

gladiola

Member


Messages: 38

#4
I wanted to note that I found an answer on the Virtualmin site that points out that we can disable using mod_suexec altogether. That page is: https://www.virtualmin.com/node/21323

The main idea there is to go in through the Virtualmin controls, and edit the configuration of the server template to not use suexec. There is a radio button built-in to the interface for this purpose.
 
Top