Description of problem: Server Side Includes are not working in Apache. Version-Release number of selected component (if applicable): httpd-2.4.6-2.fc19.x86_64 How reproducible: always Steps to Reproduce: 1. serve a page that has SSI 2. The SSI is not rendered. 3. Here is one of the SSI lines in the html source. <!--#include virtual="/includes/links01.html" --> Actual results: The html included in the links01.html is not served. Expected results: The html included in the links01.html should be served. Additional info: I have several virtual hosts. This happens on all of them. The httpd.conf has the shtml type added and +Includes in the Options and also has the XBitHack enabled. Here are excerpts from the httpd.conf file. <Directory "/var/www/html"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options +Indexes +FollowSymLinks +Includes # # AllowOverride controls what directives may be placed in .htaccess files. # It can be "All", "None", or any combination of the keywords: # Options FileInfo AuthConfig Limit # AllowOverride AuthConfig Options # # Controls who can get stuff from this server. # Require all granted </Directory> ... # # Filters allow you to process content before it is sent to the client. # # To parse .shtml files for server-side includes (SSI): # (You will also need to add "Includes" to the "Options" directive.) # AddType text/html .shtml AddOutputFilter INCLUDES .shtml ... # # XBitHack allows server-side includes (SSI) # <IfModule include_module> XBitHack on </IfModule> ... # Default server must be first # XXXXXX <VirtualHost *:80> ServerAdmin webmaster # ---- On line ---- # ServerName www.xxxxxxxxxxx.com # ServerAlias xxxxxxxxxxx.com *.xxxxxxxxxxx.com # ---- Off line ---- ServerName xxxxxxxxxxx.internal.xxxxxxxxxxx.com ServerAlias xxxxxxxxxxx DocumentRoot "/var/www/xxxxxxxxxxx <Directory "/var/www/xxxxxxxxxxx"> # # Possible values for the Options directive are "None", "All", # or any combination of: # Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews # # Note that "MultiViews" must be named *explicitly* --- "Options All" # doesn't give it to you. # # The Options directive is both complicated and important. Please see # http://httpd.apache.org/docs/2.4/mod/core.html#options # for more information. # Options +Indexes +SymLinksifOwnerMatch +Includes # ...
If you put "XBitHack on" directly inside one of the <Directory> stanzas where SSI is not working, does that help?
No. Adding the "XBitHack on" directly inside the virtual server directories does not help.
Seems I am not the only one experiencing problems with SSI not working in 2.4. http://support.godaddy.com/groups/web-hosting/forum/topic/apache-2-4-upgrade-broke-ssi-use/
That looks different. Is the SSI being processed or not in your case? i.e. do you get the raw unprocessed SSI output from the server?
You are correct. Sorry. That is different. I am getting no output from the SSI. This is a snippet of the generated source under 2.4. <body id="home"> <div id="container"> <!--#include virtual="/includes/links01.html" --> This is the same snippet from the same page served by 2.2. <body id="home"> <div id="container"> <!-- This is the code to produce the page links to other portions of the web site --> <div id="extraDiv1"><span>Shuri-mon gate, small image</span></div> <div id="linkList"> <div id="linkList2"> <div id="lselect"> <h4 class="select"><span>Select an Area:</span></h4> <ul> <li> <a href="/" title="AccessKey: H" accesskey="H"><span class="accesskey">H</span>ome</a> </li> <!-- <li> <a href="/membership/" title="AccessKey: B" accesskey="A"><span class="accesskey">B</span>ecome a Member</a> </li> --> <li> <a href="/associationLinage/" title="AccessKey: A" accesskey="A"><span class="accesskey">A</span>ssociation Linage</a> </li> <li> <a href="/Seminars/" title="AccessKey: n" accesskey="n">Semi<span class="accesskey">n</span>ars</a> </li> <li> <a href="/News/" title="AccessKey: w" accesskey="w">Ne<span class="accesskey">w</span>s</a> </li> <li> <a href="/store/" title="AccessKey: S" accesskey="S"><span class="accesskey">S</span>tore</a> </li> <li> <a href="/contactUs/" title="AccessKey: C" accesskey="C"><span class="accesskey">C</span>ontact Us</a> </li> </ul> </div> <div id="lmembers"> <h4 class="members"><span>Members Only:</span></h4> <ul> <li> <a href="/membersArea/" title="AccessKey: M" accesskey="M"><span class="accesskey">M</span>embers' Area</a> </li> <li> <a href="/membersArea/history/" title="AccessKey: i" accesskey="i">H<span class="accesskey">i</span>story</a> </li> <!-- Comment out the dojos <li> <a href="/membersArea/memberDojos/" title="AccessKey: D" accesskey="D">Member <span class="accesskey">D</span>ojos</a> </li> --> <li> <a href="/membersArea/pictures/" title="AccessKey: P" accesskey="P"><span class="accesskey">P</span>ictures</a> </li> <li> <a href="/membersArea/store/" title="AccessKey: e" accesskey="e">M<span class="accesskey">e</span>mbers' Store</a> </li> </ul> </div> <div id="lsenseis"> <h4 class="senseis"><span>Senseis Only:</span></h4> <ul> <li> <a href="/senseisArea/" title="AccessKey: r" accesskey="r">Senseis' A<span class="accesskey">r</span>ea</a> </li> </ul> </div> </div> </div>
I don't know why it works in 2.2 and not in 2.4, but maybe the not-working state can be caused by some .htaccess overriding default Options defined in main httpd.conf?
No .htaccess files involved.
Hm, I'm still not able to reproduce it. Could you try to reproduce it with minimal httpd config with clean httpd installation? I have no clue right now why this doesn't work for you...
It will take a couple of days to get to this.
Took more than a couple of days. Sorry. I completely removed my httpd.conf file and used the pristine file that was installed with the httpd rpm. I copied the /usr/share/httpd/noindex/index.html to /var/www/html/index.shtml. Notice the extension change. I modified the httpd.conf line specifying index files so that index.shtml files would be seen as directory index files in addition to index.html files. DirectoryIndex index.html index.shtml I made a textual modification to the index.shtml to make sure that it was being parsed by the server; I prepended "Test n" where n is a number to ".If you are a member of the general public:" I added the line: <!--#echo var="DATE_LOCAL" --> to various places in the file incrementing n so that I could be sure the file change had been served by the server. Each time the server served the file with the correct n, but never included the date. This is as plain vanilla as I can get. SSI is not being parsed. I then added the xbit hack and change the permissions on /var/www/html/index.shtml tp 755. I restarted the server. Still no SSI was parsed.
Created attachment 838795 [details] httpd.conf file
Created attachment 838796 [details] The index.shtml file
Sorry for late response, I was away during Christmas. I have tried your httpd.conf and index.shtml and the problem is you are missing "Options Includes" inside <Directory "/var/www/html">. If I add this option there, SSI works as expected. See http://httpd.apache.org/docs/current/mod/mod_include.html#enabling for more info.
Closing based on comment 13.
My index files were xhtml files and used the .xhtml extent. The configuration file had: <IfModule mime_module> # ... other directives AddType text/html .shtml AddOutputFilter INCLUDES .shtml </IfModule> I renamed my index file to index.shtml and SSI worked. So I added .xhtml to the mime_module. <IfModule mime_module> # ... other directives AddType text/html .shtml .xhtml AddOutputFilter INCLUDES .shtml .xhtml </IfModule> And SSI worked with my .xhtml files.