Want to Enable SSI in AlmaLinux 8.10

Greetings,

I am running AlmaLinux 8.10, and would like to enable Server Side Includes (SSI). I believe I have everything properly set, but it does not work.

In the .htaccess file for the website root, these lines were added:

AddType text/html .htm .html .shtml
AddHandler cgi-script .cgi .pl
AddHandler server-parsed .htm .html .shtml
Options +Includes +ExecCGI

I noticed that the “include_module” was not loaded, so I added this to the vhost configuration file, which successfully loads it:

LoadModule include_module /usr/local/apache/modules/mod_include.so

However, with these in place, SSI is not working, even with a simple directive as this:

Is there something in AlmaLinux that must be configured to enable SSI?

Thank you.

Have you enabled .htaccess with AllowOverride? If you’re using httpd installed from the AlmaLinux repository, you can add an example SSI page with just the following steps.

# dnf -y install httpd
# sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
# cat >/var/www/html/.htaccess <<EOF
> AddType text/html .shtml
> AddOutputFilter INCLUDES .shtml
> Options +Includes
> EOF
# echo '<!--#echo var="DATE_LOCAL" -->' >/var/www/html/date.shtml
# systemctl start httpd
# curl localhost/date.shtml
Tuesday, 08-Oct-2024 20:40:29 JST

Thank you for your reply.

In the CONF file for the vhost site, I already have this:

<Directory “/home/uranet/public_html”>
Options -Indexes -FollowSymLinks +SymLinksIfOwnerMatch
AllowOverride All Options=ExecCGI,Includes,Indexes,MultiViews,SymLinksIfOwnerMatch


If I do a CURL, I only get the directive and not the date.

You might want to start with the minimum config (the one I mentioned earlier) and verify that SSI works, then add your custom configs.
I think one of the configs you added is causing a conflict.

This time I used the minimum configuration that you suggested. The settings for both the CONF and .HTACCESS files are below. It made no difference. The directives are not being processed.

Thank you for your assistance!

<Directory “/home/uranet/public_html”>
AllowOverride All

AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
Options +Includes

Is there anything in your httpd log (error_log)?
If not, unfortunately, I’m not sure what else I can do.

By the way, by ‘minimum’, I mean the absolute default plus any necessary configs.

What I would do is:

  1. Setup a clean AlmaLinux VM
  2. Install httpd from the AlmaLinux repo (you’re not using a third-party one, right?)
  3. Ensure SSI works under /var/www/html (the default place)

There are no error_log entries that would account for this.

I have AL running on a dedicated server in my home. HTTPD was installed via the AL repo, and not some third party. I might experiment with another installation.

However, this server also has CWP (CentOS Web Panel) installed, so I don’t know whether that could be causing issues. I plan to check into that as well. In addition, I have the server locked down with ConfigServer Firewall. Its security scanner shows everything is configured, with the highest score. So I don’t know whether that is affecting things. If I do test another AL install, I will see whether SSI works prior to installing CWP and CSF.

Thank you for your help!