硬件:BeagleBone Black
Apache版本:Apache/2.4.18 (Ubuntu)
<span style="font-size:18px;">ubuntu@arm: sudo vim /etc/apache2/conf-available/serve-cgi-bin.conf</span>
修改为下列内容
<span style="font-size:18px;">ScriptAlias /cgi-bin/ /var/www/cgi-bin/
<Directory "/var/www/cgi-bin">
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
AddHandler cgi-script .cgi .py .pl
</Directory></span>
启动CGI模块
<span style="font-size:18px;">ubuntu@arm:/$ sudo a2enmod cgi
</span>
cgi程序
<span style="font-size:18px;">ubuntu@arm:/$ vim /var/www/cgi-bin/hello.py
</span>
<span style="font-size:18px;">ubuntu@arm:/$ sudo service apache2 restart
</span>
<span style="font-size:18px;">http://<span style="font-family: "Microsoft YaHei"; line-height: 26px;">192.168.7.2</span>/cgi-bin/hello.py</span>