0022561: CGI scripts won't run from /var/flexshare/share paths
Migrated from: https://tracker.clearos.com/view.php?id=22561; https://tracker.clearos.com/view.php?id=19201
Reported by: NHowitt
From #19201: If you enable CGI in the Webconfig the flex-80 file points the ScriptAlias to settings to the flexshare location rather than the location under /var/www/virtual. Although they are synonymous (when the bind mounts work) it is inconsistent. Example from flex-80:
ScriptAlias /flexshare/www.example.com/cgi-bin/ /var/flexshare/shares/www.example.com/cgi-bin/
<VirtualHost *:80>
ServerName www.example.com
DocumentRoot /var/www/virtual/www.example.com
ScriptAlias /cgi-bin/ /var/flexshare/shares/www.example.com/cgi-bin/
ErrorLog /var/log/httpd/www.example.com_error_log
CustomLog /var/log/httpd/www.example.com_access_log combined
</VirtualHost>
<Directory /var/www/virtual/www.example.com/cgi-bin>
Options +ExecCGI
Require all granted
</Directory>
The Directory line is as I would have expected, the two ScriptAlias lines are not as they point to the flexshare version of the file location, /var/flexshare/shares/www.example.com/cgi-bin/ instead of /var/www/virtual/www.example.com/cgi-bin
From #22561: There has been an e-mail report that CGI scripts will not run from the /var/flexshare/shares/{website} path, but they will run from /var/www/html/cgi-bin. See attached e-mail to support.
For the Default Website, in the CGI path /etc/httpd/conf.d/flex-80.conf is /var/flexshare/shares/{website}/cgi-bin/. This needs to be changed to /var/www/html/cgi-bin
Also note that the default folder structure creates /var/www/cgi-bin and not /var/www/html/cgi-bin
Although /var/flexshare/shares/{website} paths are bind mounted with /var/www/html and /var/www/virtual/{website} paths it seems to be giving an issue with CGI scripts.
Really all paths in /etc/httpd/conf.d/flex-80.conf need to be somewhere under /var/www and not var/flexshare/shares.