Enable SSI in WampServer 2.5
Posted by: bjose (---.staff.iinet.net.au)
Date: April 15, 2015 05:13AM

I want to include SSI <!--#include virtual="/page.html" --> in my page
What are the settings that needs to be made

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: April 15, 2015 11:33AM

How to activate SSI - Server Side Includes

This is a simple process as documented in the Apache Manual

First start WAMPServer

Using the wampmanager menus edit the httpd.conf file.

- wampmanager -> Apache -> httpd.conf

Find this section

<Directory "d:/wamp/www/">
    #
    # 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
    # [httpd.apache.org]
    # for more information.
    #
    Options Indexes FollowSymLinks

    #
    # AllowOverride controls what directives may be placed in .htaccess files.
    # It can be "All", "None", or any combination of the keywords:
    #   AllowOverride FileInfo AuthConfig Limit
    #
    AllowOverride all

    #
    # Controls who can get stuff from this server.
    #

#   onlineoffline tag - don't remove
    Require local
</Directory>

And change this line
Options Indexes FollowSymLinks

to
Options Indexes FollowSymLinks Includes


Not just any file is parsed for SSI directives.
You have to tell Apache which files should be parsed.
You can tell Apache to parse any file with a particular file extension, such as .shtml, with the following directives:


Now find this section of httpd.conf
    #
    # 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

And remove the comments on these 2 lines

    AddType text/html .shtml
    AddOutputFilter INCLUDES .shtml

If you have coded SSI instructions in a file with a .html extension then you would use
    AddType text/html .html
instead of .shtml


Now restart the Apache service so it can pick up these config changes.

- wampmanager -> Apache -> Service -> Restart Service

the icon should go from Green to Orange and then back to Green.

If it does not return to Green, you have made a mistake, edit the httpd.conf file again and find your mistake.

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: bjose (---.staff.iinet.net.au)
Date: April 16, 2015 02:57AM

i tried the above settings but it does not still read the content inside the SSI<!--#include virtual="page.html">
I have included all the jquery files in there and page still cannot read it.

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: April 16, 2015 09:55AM

Please check your syntax, if you are using exactly what you say you are using i.e.

<!--#include virtual="page.html">

then your syntax is wrong, try

<!--#include virtual="page.html" -->

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: bjose (---.staff.iinet.net.au)
Date: April 17, 2015 02:41AM

I am using the right syntax. Any ideas why the SSI scripts are not being read inspite of applying the above settings and restarting the WAMPManager

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: April 17, 2015 09:53AM

As this directive can be source code location dependant, can you tell me where the file containing the SSI code is stored on disk i.e. is it in the \wamp\www folder or a subfolder of that or is it in a virtual host?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-



Edited 1 time(s). Last edit at 04/17/2015 10:17AM by RiggsFolly.

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: bjose (---.staff.iinet.net.au)
Date: April 20, 2015 02:15AM

I have placed all the content in \wamp\mystuff

Options: ReplyQuote
Re: Enable SSI in WampServer 2.5
Posted by: RiggsFolly (---.as43234.net)
Date: April 20, 2015 10:00AM

So have you created Virtual Hosts so that Apache knows where to find this folder and who can access it?

---------------------------------------------------------------------------------------------
(Windows 10 Pro 64bit) (Wampserver 3.3.4 64bit) Aestan Tray Menu 3.2.5.4
<Apache versions MULTIPE> <PHP versions MULTIPLE> <MySQL Versions MULTIPLE>
<MariaDB versions MULTIPLE> <phpMyAdmin versions MULTIPLE> <MySQL Workbench 8.0.23>

Read The Manuals Apache -- MySQL -- PHP -- phpMyAdmin
Get your Apache/MySQL/mariaDB/PHP ADDONs here from the WAMPServer alternate Repo
-X-X-X- Backup your databases regularly Here is How dont regret it later! Yes even when developing -X-X-X-

Options: ReplyQuote


Sorry, only registered users may post in this forum.