2

so i have an apache-2.4.25 (as packaged in Debian/stretch), and would like to use SSI's exec method.

<!--#exec cmd="ls" -->

Unfortunately this gives me an error:

[an error occurred while processing this directive]

In the logfiles it says

unknown directive "exec" in parsed doc /path/to/some/user/public_html/ssitest/index.shtml

which I tracked down to having Options +IncludesNOEXEC enabled in my userdir.conf (which disables the exec directive for SSI). So I tried to turn that option off for a single specific VHost, by putting the following into the VirtualHost section:

Options -IncludesNOEXEC
Options +Includes

Unfortunately this doesn't help.

So I tried with in the Directory section, but still no luck:

Alias /ssitest/ /path/to/some/user/public_html/ssitest/
Options -IncludesNOEXEC
Options +Includes
<Directory /path/to/some/user/public_html/ssitest/>
  Options -IncludesNOEXEC
  Options +Includes
</Directory>

Whenever I try to access my page, I get the an error occurred while processing this directive error.

So is there a way to disable a previously set option?

umläute
  • 469
  • 1
  • 7
  • 26

2 Answers2

1

You need to enable mod_cgi. I now check ssi exec run on Ubuntu 16.04+apache2 - it works if you enable mod_include and mod_cgi, and put Options +Includes in htaccess or in <Directory... >.

Options -IncludesNOEXEC wasn't needed in my case.

Andrew Schulman
  • 8,561
  • 21
  • 31
  • 47
Anton K.
  • 11
  • 2
0

for ubuntu, apache2 web server enable the mod, with the following commands

a2dismod cgi

and with

cd /etc/apache2/sites-available
vim 000-default.conf

add the following:

<Directory /var/www/vhosts/YOUR-DOMAIN.COM/httpdocs>
    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml
    Options +Includes
</Directory>
umläute
  • 469
  • 1
  • 7
  • 26