Server Side Includes for Apache and parsing text files

I have an old website I used to do zipped up and I decided to set it up on my personal webserver in OS X . I got apache configured to allow server side includes (edited the httpd.conf to all them:
<Directory />
Options FollowSymLinks Indexes MultiViews Includes
AllowOverride None
</Directory>
But I can't get the pages to come up. See I have this .shtml page which loads fine and a part of it has this line:
<!--#include file="news/news.txt" -->
But it won't parse that txt file and show the html that its formatted in.
Anyone have any ideas on how to get it to parse that txt file? Even if I load just that txt file it shows raw code not it formatted. Please help.

Ignore that first reply. I thought I was dealing with server.
As usual, I fogot to make sure that Includes was in the Options directive for the DOCUMENT_ROOT or VirtualHost. After 10 years, you'd think I'd remember that. I just configged one of my macs to do SSI. Here's the 3 lines that I changed:
Line 399 (the DOCUMENT_ROOT definition): Options Indexes FollowSymLinks MultiViews Includes
Line 887 (To use server parsed HTML): AddType text/html .shtml
Line 888: AddHandler server-parsed .shtml
apachectl restart
and off it went!
Roger

Similar Messages

  • Using a server side package to copy and delete flat files.

    Can anyone tell me if it is possible to copy or delete flat files using comands issued from within a PL/SQL program unit on the server. I know of the package UTL_FILE for the reading and writing of flat files.

    Malcolm,
    if you use 8i, you can create a Java class to do that for you, and call one of it's metohds from PL/SQL, see http://www.oracle.com/oramag/oracle/00-Mar/o20java.html
    null

  • Server Side Includes and Divs

    I have a template (dwt) for my site with editable regions for
    menus. I want to use Server Side Includes for the menu, as not all
    the pages will have the same menu.
    I have designed the site template (and pages) with css and
    divs. The area for the SSI is a div of size 145x335. The menu which
    I want to put inside this div will be a div based menu. I havent
    had any luck displaying the Div from the SSI yet. I have been
    looking on Google for help, but not much luck. I can get the Div to
    appear but the formatting doesnt show up.
    Im putting the SSI code in where I want it on the page, but
    im not sure exactly which code to get rid of in the shtml file. I
    know I need to remove body, head parts etc
    My site template uses CSS stored on the document, not an
    external css file.
    Any ideas?

    > Im sure Ive not got it right yet!! My head wont work
    lately!
    Yes. It's not working well here, either.
    Create your template with the editable region. In it, have
    links to a) the
    general stylesheet for all the pages, and b) the general
    stylesheet for all
    of the includes (these don't really need to be separate
    files). Spawn a
    child page, drop in the desired include, and save that page
    as
    whocares.shtml.
    That's it....
    The incude files themselves can be names anything you want -
    I like the
    'monkeybutt' extension, e.g.,
    yourinclude.monkeybutt
    The include files can make reference to CSS selectors, but
    cannot have
    embedded CSS rules, or links to external CSS files.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "~Billy~" <[email protected]> wrote in
    message
    news:eq234v$eq6$[email protected]..
    > Ive made myself confused now! I need it spelling out to
    me!
    >
    > Ok, a template file (dwt) with its css as an external
    style sheet.
    >
    > Rest of the sites pages made from the template file.
    >
    > Next, the template has one editable region for a choce
    of 2 div based
    > menus to
    > be placed into. Place either of these div menus into the
    template editable
    > region by creating two seperate SHTML files - one for
    each menu with the
    > body/head removed(and with internal or external css?)
    >
    > Next put the SSI code into the body of the template
    where I want the SSI
    > to
    > appear.
    >
    > Im sure Ive not got it right yet!! My head wont work
    lately!
    >

  • Trouble Testing Server Side Includes using personal web sharing

    I am using the book "Standard complant websites using dreamweaver 8" One of the exercises has me testing that server side includes are enabled by creating two files ssi_test.shtml and hello.html. I have placed these two files in the documents subfolder which web server is the main folder.
    Since I only see a blank page when I test, the book says I need to tweak the Apache configuration to enable SSI. It says to open httpd.conf file (which I can not find) . I am suppose to insert the following lines: AddType text/html .shtml and Addhandler server-parsed .shtml
    Where is this file httpd.conf file located?
    How do I modify it?
    Thanks for your support
    James
    powermac G4 Mac OS X (10.3.9)

    It is in /private/etc/httpd directory.
    You will need a file editor that knows how to authenticate or to learn some basics with the command line and unix to use sudo to edit the file.
    <pre>sudo pico /private/etc/httpd/httpd.conf</pre> is where I recommend you start if you don't know emacs or vi or another of the fine unix editing tools that are provided...
    An article that was intended to fix a different problem - but has all the steps you need to locate the terminal application, learn about sudo, etc... is http://docs.info.apple.com/article.html?artnum=301580

  • Server Side Includes with .irpt pages

    I am intrested in using server side includes within my .irpt pages for example
    <!#INCLUDE FILE="file.inc">
    specifically inside of my applet tags to reference a standard set of parameters that I would like to be passed into my display templates.  Does xMII have a similar representation of server side includes for .irpt pages?

    It might make your head explode, but in a good way...
    Also, you'll need 11.5 or newer to run this. There are so incredibly many opportunities that this might open up for you to deliver not only static, but also dynamic embedded server-side content.
    There are many aspects of xMII that are largely untapped.  A few common ones are the ability of the Runner servlet (which invokes xMII BLS transactions) to stream virtually any type of content back to the requestor (XML, HTML, text, images, PDFs, Excel, whatever).
    The other feature that not too many people use is the ability to use an xMII BLS transaction as a "stylesheet".
    Lastly, there is the little-known "<SERVLET>" tag that can be used in IRPT pages.
    Put all these pieces together, and amazing things can be done.  The example I'm going to show you uses a BLS transaction, but it can also be done with an XSL stylesheet (if the desired included HTML is static).  But let's go for the cool approach...
    Let's assume you have some "stuff", such HTML page content, that you want included in a specific position on your web page.  Let's also assume that this "stuff" resides in a file accessible at http://localhost/MyInclude.html (the file extension doesn't really matter).
    Create a new BLS transaction with no inputs and an output of type String (the name of the output doesn't matter - but in our case, let's assume you name it HTMLOutput).  To workaround a cosmetic bug (which will be fixed in a future patch), you should also create a second output (doesn't matter what name or type) - so add one called "DummyOutput" of type String.  Not worth explaining why - just do it. 
    Next, add either a TextLoader or HTMLLoader action (in the Web group) to your transaction (they both do the same thing, actually - just different icons).  In the Output links tab, assign the StringContent of the loader action to the transaction output.  This basically accomplishes the loading and streaming of your included "stuff".
    Save this transaction.  Let's save it in a folder called CoolStuff, with the name IncludeTest.
    In your IRPT page, add the following code where you want the "stuff" to appear.
      <SERVLET NAME="Illuminator">
           <param name="Stylesheet" value="xacute://CoolStuff/IncludeTest" />
         <param name="OutputParameter" value="HTMLOutput" />
         <param name="Output-Content-Type" value="text/html" />
         <param name="Content-Type" value="text/html" />
      </SERVLET>
    Save the IRPT page, load it, and you're in business!
    You can probably already start to envision to possibilities for adding more sophisticated business logic to create "dynamically" embedded content in your IRPT pages...
    Best regards,
    Rick

  • Are nested server side includes supported in DW?

    Using DW 5.5 on Win 7, Apache 2.2 setup. Does DW Design view support nested server-side includes? I have to work on an old legacy site with nested ssi's that I haven't worked on for quite awhile, and I noted that while working on a page the left side column was not displaying in Display mode, so where the left column should be is just an empty blank div.
    I could swear that DW used to display the nested ssi's, but looking at it now, it certainly isn't.
    The left side column is just a div that is ssi included in the bodies of the pages ( nothing special ). It ssi includes various pieces such as news, announcements, etc. Everything displays fine on the website, but in the Design view the nested SSI's don't display.
    Thanks,
    Doug

    Ken, yes it's an include(s) inside an include. In this case the leftcolumn.html is server-side included in all the pages on the site. Inside the leftcolumn.html are four server-side includes for announcements, news, calendar, and next meeting info. Each of those are separate .html files that are constantly edited. It makes things nice and neat and I can give permission to other people to edit the individual files without screwing up the leftcolumn.html or the whole page. So leftcolumn.html is just a div with a width/margins/background color class and the four server-side includes. Of course you have to tell IIS or Apache you want to allow .html files to use ssi's, but that is simple enough and I think nicer than using .shtml's. YMMV.
    What I thought I remembered was that the left column was fully displayed in the Split or Design modes, but I guess I was wrong. All I see is an empty leftcoumn div that has the proper width and background color. I work almost exclusively in DW code view or sometimes Split View, or use another editor like Brackets or CFBuilder, and just switch to a browser to view the pages.
    Doug

  • Server-side includes in css

    I am trying to incorporate server-side includes for my nav.
    links. I created the website using css. I am able to preview the
    navigationals (with proper links when I hovered) with F12 iexlorer,
    but when I upload everything and view it from IE, Mozilla, etc.
    they aren't there. My left nav. is totally blank.
    I am very new to web making and learned what I could from
    internet sites. Here are examples of my ssi code:
    My index page has a php extension (index.php) and has this
    inserted for the include:
    <?php include("menu.html");?>
    menu.html looks like:
    <ul>
    <li><a href="index.php">Home</a></li>
    <li><a href="searchplans.php">Search Plans
    </a></li>
    <li><a href="modifydesign.php">Modify
    Design</a></li>
    <li><a href="designpricing.php">Design
    Pricing</a></li>
    <li><a href="purchaseplan.php">Purchase
    Plan</a></li>
    <li><a href="contactus.php">Contact
    Us</a></li>
    </ul>
    I know that my server supports ssi, because I previously
    created a very basic site (not using css) using shtm extensions and
    an includes folder. When I called them they said that they support
    php too, but thought it was a problem with my settings in
    Dreamweaver.
    If you have any advice, I would be very grateful. I am
    banging my head on this one.

    Be sure to upload menu.html to your server.
    HTH,
    Randy
    > <?php include("menu.html");?>

  • Cannot Preview Server Side Includes in Browser

    I am working on building a new site using server side
    includes for the main header graphic and menu items. For testing
    purposes, I created an .html file with one <div> tag
    containing a single graphic and an .shtml file with the server side
    include code placed in the <head> area. (Doesn't seem to work
    if I place it anywhere within the <body> tag... not sure
    why). At any rate, I can see the SSI in the design view of my
    document, but cannot see it whenever I go to preview the page in my
    browser (Firefox 2.0.0.3). Everything works fine if I upload the
    files to my Web server and view them that way, but why can't I see
    the SSI when working on my local files? The Dreamweaver help files
    explain that I should be able to do so, but it's just not working.
    Well, I'm now at a loss and cannot figure out if I'm doing
    something wrong of if this is just a bug of some kind. Can anyone
    help me to solve this problem so that I can get back on track?
    Much appreciated,
    ~Greg

    >I am working on building a new site using server side
    includes for the main
    > header graphic and menu items. For testing purposes, I
    created an .html
    > file
    > with one <div> tag containing a single graphic and
    an .shtml file with the
    > server side include code placed in the <head>
    area.
    This is not going to work at all. You cannot place body HTML
    in the <head>
    region.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Myrrhlin225" <[email protected]> wrote in
    message
    news:f1hdmh$clh$[email protected]..
    >I am working on building a new site using server side
    includes for the main
    > header graphic and menu items. For testing purposes, I
    created an .html
    > file
    > with one <div> tag containing a single graphic and
    an .shtml file with the
    > server side include code placed in the <head>
    area. (Doesn't seem to work
    > if I
    > place it anywhere within the <body> tag... not
    sure why). At any rate, I
    > can
    > see the SSI in the design view of my document, but
    cannot see it whenever
    > I go
    > to preview the page in my browser (Firefox 2.0.0.3).
    Everything works
    > fine if
    > I upload the files to my Web server and view them that
    way, but why can't
    > I
    > see the SSI when working on my local files? The
    Dreamweaver help files
    > explain
    > that I should be able to do so, but it's just not
    working. Well, I'm now
    > at a
    > loss and cannot figure out if I'm doing something wrong
    of if this is just
    > a
    > bug of some kind. Can anyone help me to solve this
    problem so that I can
    > get
    > back on track?
    >
    > Much appreciated,
    > ~Greg
    >
    >

  • Contribute changing relative path for server-side include

    I am using Contribute CS3, version 4.1, and my pages crash
    every time a send a draft for review, because Contribute is
    rewriting a relative URL in a server-side include.
    The server-side include (before I send for review) reads:
    <!--#include file="../foo/bar.fileextention"-->
    After I edit other portions of the page and send the draft
    for review, it reads:
    <!--#include file="http:
    //www.servername.com/foo/bar.fileextension"-->
    Which results in the draft being unreadable.
    Is there any way to tell Contribute not to monkey with this
    URL? I have hunted, read the forums, checked the knowledge base,
    and coming up empy.
    Thanks in advance for any help you can provide!! I really
    appreciate it!
    -Nicholas

    Answering my own question.
    I researched this complete forum and with taking ideas from
    different posts, I was able to figure this out. I thought I would
    post it for anyone else needing to know the answer in one place:
    Include tags must read:
    <!--#include virtual="includes/fileName.html"-->
    (Include file is NOT a real HTML doc -- no tags in file
    except for CSS, as it would be used if not using Contribute.)
    No reference to .dwt needed nor Template created.
    No Edit instance tags needed anywhere.
    Contribute user navigates to page:
    [Upper right corner] Click Choose...
    [In my structure] User opens includes folder (double clicks)
    User selects THE file (clicks OK)
    User clicks on Edit Page button
    (Text is now editable.)
    User edits text.
    User clicks on Publish button.
    Worked for me several times trying.
    - Janet

  • When i add long text it effects the width of other server side include

    hi
    i have included some pages to my index page in a cell of a
    table by server side include
    when the text is too long it narrows the other text !!!
    although the texts are in table cells !!!
    how can i prohibit this effect ?no one of them effect the
    other
    thanks in advance.

    It would be good to see your site to tell for sure.
    There are several things that can cause this effect. Are the
    included
    tables wider than the cell on your index page? Do any of the
    included pages
    have images that might be wider than your target cell? Does
    your target
    table have a defined height?
    Your include page should have only text with no wrappers
    (tables, etc.) no
    specific height, styles, or images. (yes you can include
    images but you have
    a whole lot of other stuff to consider) If your included text
    is in a cell
    with a width of say 600 but your target cell has a width of
    400, the include
    will widen the target cell to 600 wile narrowing adjoining
    cells because it
    is trying to keep your target table to it's predefined width.
    Height is non supported in most browsers but in some will
    cause your text to
    widen a cell before it lengthens it so get rid of that in
    your target table
    if it's there.
    If one of these ideas doesn't fix your problem, post a link
    to your site and
    to the include page so we can better tell what's going on.

  • What is the difference between jsp :include and server side include

    what is the difference between jsp :include and server side include(request dispatcher include method)????
    i understand that both request dispatcher include method and jsp:include take dynamic data,so when would one use request dispatcher include and when jsp:include.
    Is the usage interchangeable?i believe jsp include is used only for jsp/html but include directive can be used to include servlets ,jsp and html....correct me if i m wrong and
    do suggest if u hav ny other diff in this context...

    The difference really is: in what format do you want your inclusions? If your environment has many Java developers and only a few designers that focus mainly on, say, Flash, that might push you more towards the server-side include() directive. Or, if you have a large set of pages that receive dynamic content that is displayed in a consistent fashion (such as a workflow header area on a page).
    If, on the other hand, you have more web designers, there may be a greater desire to deal in markup rather than Java code. Java developers themselves might prefer to view markup (JSP) that more resembles the eventual output than something occuring in Java code.
    Finally, there are considerations of tiering. While it is totally possible to (and I have previously) implement 'view classes' that render markup or generate layout templates, JSP's offer, IMO, a subtle, psychological advantage. By forcing a developer to work in a different format, markup versus Java source, the separation on view from controller and model becomes a bit easier. It is still possible to make mistakes, but if a developer at some point notices, "Wait, I'm in a JSP, should I be importing a java.sql class?", then the choice to use JSP includes has paid off in spades.
    - Saish

  • Server side includes: outdated and not supported by host?

    I've been using SSI's for ages with no problem from any host. Recently I signed up with a new web hosting company, one of the more established ones in the Seattle area. They do not support SSI's and claim that using them is not safe and is not a modern approach to web design. They suggested I use a more advanced programming language to create my sites, such as ASP.NET (something I have no desire to do).
    Are server side includes outdated and no longer the way to do things? I find that hard to believe.
    -Jesse

    Are server side includes outdated and no longer the way to do things? I find that hard to believe.
    That language is from Microsoft who seem to think so along with Windows based hosting providers offering ASP.NET.
    IIS no longer comes with SSI installed by default. It has to be configured by the hosting provider.
    http://blogs.iis.net/robert_mcmurray/archive/2010/12/28/iis-notes-on-server-side-includes- ssi-syntax-kb-203064-revisited.aspx
    However, classic SSIs (in the sense of including static content from one page inside another) are still one of the most powerful, safe and flexible tools for managing repetitive page elements in any web page. Not to mention easy.
    ASP.NET has its own way of doing the equivalent of SSIs - and lots more beside but much of which does not interest web designers at this stage.
    http://stackoverflow.com/questions/894720/asp-net-equivalent-of-server-side-includes
    http://searchsoftwarequality.techtarget.com/answer/Alternatives-to-server-side-includes-fo r-ASPNET

  • Tabbed panels, Collapsible Panel, and Server Side Include

    Hi,
    I'm having a problem with the way a Server Side Include inside a Collapsible Panel displays.
    Here is how this particular page is set up.
    The page has spry tabbed panels.
    >>A panel has one overall Collapsible panel (the main product tab)
    >>>>Nested in that Collapsible panel are four other collapsible panels (Overview, Features, Screenshots, What's New).
    >>>>>>In each of these four collapsible panels is a server side Include that features that category's content
    E verything works fine as far as opening and closing is concerned. However, the problem is with the display. The content panel doesn't resize with the Include content, and therefore, the Include content extends outside the border of the content panel.
    I'm thinking this is because it is Include content rather than normal content. Is that right?
    Do I fix this by changing the overflow value of one the Tabbed Panel CSS styles? If so, which one should I change, and to what value?
    Or if that's not how to fix it, can anyone tell me how?
    Thanks a lot,
    Mike

    Hi, I'm using the latest version of Spry. I modified some CSS rules of the tabbed panels, but not the javascript file. I didn't do anything to the Collapsible Panel rules.
    Since first posting this thread, I changed the overflow of the Tabbed Panels Content Group CSS rule to "scroll". That did produce a scroll, but I'd much rather have the panel expand. So, I changed it back the way it was.
    Here's the page I'm working on. Click the Court Solutions tab to get to the problem panel.
    http://www.ptssolutions.com/Test/public_safety_products_3.shtml
    It has different results in IE and FireFox, but doesn't work correctly in either.
    Thanks a lot for all your help,
    Mike

  • Server Side Includes and Javascript

    Can one safely include javascript in a server-side include
    (SSI) file? It seems to work but don't know if it will create
    problems down the line. I am using a roll-over navigation bar
    created and generated in Fireworks. It seems to defeat the purpose
    of using SSI if you can't include the javascript since if there was
    a change at some point to the navigation bar you would have to
    change the javascript that went with it. And it is nice to keep all
    that extra coding out of every file on the site. IS there an
    official word on this or some process in creating a SSI file that
    could prevent any problems?
    You can see the file I created using this at
    http://www.hopkinsandporter.com/test.shtml

    > Can one safely include javascript in a server-side
    include (SSI) file?
    Yes, but it makes your parent page's derived code messy.
    > I am using a
    > roll-over navigation bar created and generated in
    Fireworks.
    This is a big mistake for so many reasons.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "TSemmes" <[email protected]> wrote in
    message
    news:e52id2$pt1$[email protected]..
    > Can one safely include javascript in a server-side
    include (SSI) file? It
    > seems
    > to work but don't know if it will create problems down
    the line. I am
    > using a
    > roll-over navigation bar created and generated in
    Fireworks. It seems to
    > defeat the purpose of using SSI if you can't include the
    javascript since
    > if
    > there was a change at some point to the navigation bar
    you would have to
    > change
    > the javascript that went with it. And it is nice to keep
    all that extra
    > coding
    > out of every file on the site. IS there an official word
    on this or some
    > process in creating a SSI file that could prevent any
    problems?
    >
    > You can see the file I created using this at <a
    target=_blank
    > class=ftalternatingbarlinklarge
    > href="
    http://www.hopkinsandporter.com/test.shtml">http://www.hopkinsandporter.co
    > m/test.shtml</a>
    >

  • Server side includes not visible on apache

    Hi when i upload an HTML file with includes on an apache server the includes are not visible. I used the "virtual" parameter. on a windows server it works, also local works everything great. i also tested with PM "file" didn't work. can someone help me out? Thnx

    >Hi when i upload an HTML file with includeson an apache server the includes are not visible.
    The includes are not visible, but is the include code visible in the source code? That will tell whether the server is parsing for includes. By default, the server is probably set not to parse .html files for includes. Read the link that SnakEyez suggested, but also be aware that you can configure your server to parse .htm(l) for includes.

Maybe you are looking for