1

I've got wrong apache configuration. My script don't want to be executed and browser trying to download it as a file.

<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>
  1. Scripts are own by www-data:www-data with rights 755 and can be executed (+x).
  2. Shebang e.g. #!/usr/bin/perl.
  3. Error log is empty.
1
  • @Rinzwind I replace that part and the DocumentRoot section, but is doesn't work
    – tregnas
    Sep 9, 2014 at 8:49

1 Answer 1

1

Problem solved!

I remove all Require all granted (it's only for Apacvhe 2.4+) and paste:

Order allow,deny
allow from all

Also i move AddHandler cgi-script .cgi .pl to DocumentRoot directory description

1
  • Nice one! don't forget to accept in a few hours;have an upvote to start with :)
    – Rinzwind
    Sep 9, 2014 at 9:37

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .