简单配置,分2部分
1.a2enmod cgi (a2enmod is a script that enables the specified module within the apache2 configuration)
2./etc/apache2/conf-available/serve-cgi-bin.conf 根据实际情况,配置
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
Options +Indexes +ExecCGI -MultiViews +SymLinksIfOwnerMatch
#Require all granted
Order allow,deny
Allow from all
AddHandler cgi-script .py .cgi
AddHandler default-handler .html .htm
</Directory>