Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

Txutx

macrumors newbie
Original poster
Feb 19, 2009
3
0
Hello,
I have to develop a web using SSI (<!--include virtual="file").
I am using Emacs for editing the code and firefox with a validation pluging to verify it, but I have realized it does not work.

I have been reading other threads about modifying files, and talking about servers but I do not understand a word.

Can anyone please explain me if it is possible, which tools do I need or which files should I modify? I have a MacBook with Tiger version. An explanation for beginners please.

Thanks in advance,

Txutx
 
The web server needs SSI to be turn on and configured.
Pages using SSI need a .shtml extension (by default anyways).

There are threads here that talk about turning on SSI on Mac.
 
I have to develop a web using SSI (<!--include virtual="file").

On top of what angelwatt said, your syntax is wrong and the web server will not parse it properly.

The correct syntax is:

HTML:
<!--#include virtual="relative_path_to/file.ext" -->

Notice the # symbol, the spacing and the --> on the end.

How to setup SSI
Here is a great page on many of the SSI directives you can use.

1) Enable SSI, configure .shtml as the extension to parse SSI
2) Create example.shtml and add in SSI directives with the correct syntax and you're GTG

-jim
 
Hello again,
I am trying to incluye SSI on my page html. I have tried to follow the instructions of what I have read in the forum but I am not able of making it work.

I hope anybody could help me to fix what I am doing wrong.

I have a folder in my Desktop which is called /doc_es/ and inside it two files copyright.shtml and ssi_trial.html.

-------------------------------------------------
copyright.shtml
-------------------------------------------------
<p> Copyright 2002 <a href="http://yourdom.com">You</a>.</p>

------------------------------------------------
ssi_trial.html
------------------------------------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
<head>
<title> Copyright Information </title>
</head>

<body>
<h1>Copyright information </h1>
<!--#include virtual="/Users/macbook/Desktop/doc_es/copyright.shtml"
-->
</body>
</html>
---------------------------------------------------------------------
I am using MAMP to have a local web server.
---------------------------------------------------------------------
I have read that before start using the SSI I have to activate them by modifying the file /etc/httdp/httdp.conf

These are the changes I have made:

* I have verified the following lines are uncommented:
Load Module includes_module libexec/httpd/mod_include.so
AddModule mod_include.c

* I have changed the location folder of my files

DocumentRoot ”/Users/macbook/Desktop/doc_es”
<Directory />
Options FollowSymLinks MultiViews Includes
Exec CGI
AllowOverride All
</Directory>

<Directory “/Users/macbook/Desktop/doc_es”>
Options Includes Indexes Follow SymLinks MultiViews
AllowOverride All
Order allow, deny
Allow from all
</Directory>

<IfModule mod_dir.c>
DirectoryIndex index.shtml index.html
</IfModule>

* And I have uncommented :
AddType text/html .shtml
AddHandler server-parsed .shtml
------------------------------------------------------------------
Then, I have saved the file with the changes in the Desktop and I have moved the modified http.conf to the /etc/httpd/ folder.
------------------------------------------------------------------
I have restarted the server
------------------------------------------------------------------
I have seen that the file instead of having wheel has macbook on the information (ls –l)

-rw-r—r—1 macbook macbook

I have used the following instruction just in case but nothing has changed.

%nidum group.| grep ‘admin|macbook|wheel’

-----------------------------------------------------------
I have opened the file using the firefox

http://localhost:8888/ssi_trial.html

But I cannot see the part inserted by the copyright.shtml. (At mamp, the Document root is /Users/macbook/Desktop/doc_es) and I have also modified the expression of the path to the shtml file included in the ssi_trial.html file, but nothing.

Any other idea ?
I am very new on this, and I have no more ideas.

Thanks in advance,

Susana
 
Your .html needs to be .shtml. Whatever file uses the SSI syntax needs to be parsed ans SHTML so it'll need that extension. Your copyright file can be .html since it doesn't use any SSI syntax.
 
Thank you very much for the indications.
I will review all the code in order to be able to use SSI with .shtml.

Txutx
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.