I am attempting to convert our system wide Perl application from Cpanel to Virtualmin Webmin.
We have been using apache2 on Centos and cpanel for over 10 years.
On cpanel Centos Servers, there are system wide scripts located in
/usr/local/cpanel/cgi-sys/
We are able to place a directory of scripts and data in those directories, and run them system wide on any virtual host in the server using apache2.
Inside the cgi-sys directory are cgi scripts for cpanel that do redirections.
We are able to put our script aliases in those directories, and call them with a script alias in httpd.conf. ie: ScriptAlias /dwos-bin/ /usr/local/cpanel/cgi-sys/netstores/dwos-bin
Now in Virtualmin / webmin on UBUNTU there is the directory called: /usr/share/webmin which contains all the server wide scripts of webmin and virtualmin.
These are perl scripts running systemwide.
We need to do the same thing with our application so I put the perl application scripting directory in:
/usr/share/netstores
with the scripting diretories within directory.
ie:
/usr/share/netstores/dwos-bin [same as a cgi-bin]
and within that directory a test2.pl which is just hello world.
now the same perlscript work under the normal cgi-bin of a virtual host, but I get a server misconfiguration and suexec error when I try to run as a system wide scripts.
ScriptAlias /dwos-bin/ /usr/share/netstores/dwos-bin/
Added this additional ScriptAlias for adding another location in the conf-available conf file.
/etc/apache2/conf-available/serve-cgi-bin.conf
<IfDefine ENABLE_USR_LIB_CGI_BIN>
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
ScriptAlias /dwos-bin/ /usr/share/netstores/dwos-bin/
<Directory "/usr/share/netstores/dwos-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
</Directory>
</IfDefine>
This is the suexec error when attempting to run.
[2021-07-08 21:45:04]: uid: (1001/netstore) gid: (1001/netstore) cmd: test2.pl
[2021-07-08 21:45:04]: command not in docroot (/usr/share/netstores/dwos-bin/test2.pl)
Where do I place custom system wide perl scripts?
What is the configuration to do?
This is working on CPanel, any assistance on making it work on Virtualmin/Webmin Apache2 Ubuntu will be helpful.