Question:
How to enable Server Side Include in Apache?
Mawan
2006-03-20 04:10:01 UTC
I use XAMPP installer (product of ApacheFriends.org) to automatically install Apache ,MySQL, and PHP. The problems is: Server Side Include is deactivated by default. How to enable it? Why SSI is deactivated by default? Is this dangerous if I try to enable it?
Three answers:
efremescu
2006-03-20 04:18:10 UTC
Server Side Include (or SSI) is a useful feature that enables you to do things like include files into your web pages. The most common use for this feature is to allow you to design a navigation bar, put it in a separate file and then include that in all of your web pages. When you need to change the navigation bar you change just the include file, not every web page on your server. The change in the include file simply propogates through all the pages that include it.



Configuring Apache to enable SSI support



The first thing to do is ensure that your server has the mod_include module installed and enabled. Most Linux systems come with this preconfigured so you should not have to worry about this.



The next step is to edit your httpd.conf file to enable Includes. You will typically find this file in /etc/httpd/conf. The directive that needs to be set is as follows:



Options +Includes



Not all files will automatically support SSI and the recommended practice is that you do not configure your server so that all files support SSI. Web pages that support SSI must be scanned by the server for includes before they are displayed putting a extra overhead on the performance of the system. It is better to only have the server perform that for pages that actually contain includes. This can be achieved in a number of ways:



- Apache can be configured to parse any file with a particular file extension, such as .shtml, with the following directives in the http.conf file:

AddType text/html .shtml AddHandler server-parsed .shtml

This is a great approach when you know in advance whether a page needs to use server side includes or not but can be a problem if you need to change an existing page since you would have to rename the page to use the new filename extension and also change any links that point to this file.



- Use the XBitHack directive in the httpd.conf file:



XBitHack on

XBitHack tells the Apache server to parse files for SSI directives if they have the execute bit set. In other words, to add SSI directives to an existing page, you simply need to make the file executable using the chmod command. For example:





chmod +x mypage.html



NOTE: When experimenting with pages that support SSI it is important to ensure the pages are actually served up by the Apache web server. A common mistake web designers make is to work on local HTML files in a work directory and directly open the web pages in a browser. In this situation the SSI includes are not activated because the pages are not being handled by the web server. When testing always upload the pages to the web server.
?
2016-12-13 12:50:51 UTC
Enable Ssi Apache
?
2016-10-15 09:59:31 UTC
because youre a dummy, study the For Dummies sequence; study all to be an excellent cyber web developer and dressmaker; one million) desktops for dummies 2)html 4 for dummies 3)construction a internet site for dummies 4)arising cyber web content for dummies 5) arising relatives web pages for dummies 6)cyber internet site layout for dummies 7)css cyber internet site layout for dummies 8)javascript for dummies for dummies books for the kit you would be utilizing in cyber web arising; one million)dreamweaver 8 for dummies 2)seen cyber web developer 2005 show version for dummies


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...