Ich habe eine falsche Apache-Konfiguration. Mein Skript will nicht ausgeführt werden und der Browser versucht, es als Datei herunterzuladen.
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName president.com
DocumentRoot /var/www
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
ScriptAlias /cgi-bin/ /var/www/cgi/
<Directory /var/www/cgi/>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Require all granted
AddHandler cgi-script .cgi .pl
</Directory>
- Skripte gehören meinem Besitzer
www-data:www-data
und755
können ausgeführt werden (+x
). - Shebang zB
#!/usr/bin/perl
. - Fehlerprotokoll istleer.
Antwort1
Problem gelöst!
Ich entferne alles Require all granted
(es ist nur für Apacvhe 2.4+) und füge ein:
Order allow,deny
allow from all
Außerdem gehe ich AddHandler cgi-script .cgi .pl
zur DocumentRoot-Verzeichnisbeschreibung