I have a website up and running on the Apache webserver, but the CGI scripts in
/Library/WebServer/CGI-Executables will not run. Instead, the text of the file loads in the browser instead.
I made the following changes to
Added the following line to the LoadModules group:
LoadModule cgi_module /usr/libexec/apache2/mod_cgi.so
Uncomment the following line (by removing the #):
AddHandler cgi_script .cgi
Added this to the virtual host file for the specific site:
<VirtualHost *:81> DocumentRoot "/Library/WebServer/Documents/" ScriptAlias /cgi-bin/ "/Library/WebServer/CGI-Executables/" <Directory "/Library/WebServer/CGI-Executables/"> AllowOverride none Options +ExecCGI AddHandler cgi-script .cgi </Directory> </VirtualHost>
I am able to run the Perl scripts from the command line without an issue.
Note: this is on High Sierra.