You are here : Home - Web Development - Home Server - SSI
Enable server side includes
To Enable Server Side Includes we have to do 2 things
1. We need to let the server know that we want to use includes.
Open DRIVE:\web\Apache2\conf\httpd.conf in a text editor (one that shows line numbers makes this part easier)
line numbers will vary depending if you follow this guide or not but the edits should be near the line number listed.
Line 267 change
from
Options Indexes FollowSymLinks ExecCGI
to
Options Indexes FollowSymLinks ExecCGI Includes
Remove the # from lines 793 and 794
from
#AddType text/html .shtml
#AddOutputFilter INCLUDES .shtml
to
AddType text/html .shtml
AddOutputFilter INCLUDES .shtml
If you have skipped the php section then you will need to also make sure index.shtml is in the directory index line
DirectoryIndex index.html index.php index.shtml index.html.var
Save httpd.conf and restart the server (use Apache Service Monitor)
To test SSI we need to create 2 files
1.
--
<html>
<head>
<title>hello world
</title>
</head>
<body>
<!--#include virtual="hello.inc"-->
</body>
</html>
--
Save it as DRIVE:\web\Apaches2\htdocs\hello.shtml
2.
--
<b>Hello World!
</b>
--
Save it as
DRIVE:\web\Apaches2\htdocs\hello.inc
Finally
Open your browser and type http://localhost/hello.shtml into the address bar.
If all has went well you should see the words Hello World! in your browser.
You have successfully enabled SSI
Next we'll move on to Step 6 install and test mysql
Setting up a home development server
Step 1 Download all the software
Step 2 install and test Apache
Step 3 install and test Perl
Step 4 install and test php
Step 5 enable server side includes and test
Step 6 install and test mysql
Step 7 install and test phpbb
Step 8 well done
Why not discuss
this article in our forum?
Get your questions answered quickly.
24-May-2003