?
Solved

SSI linking different servers

Posted on 2001-08-17
7
Medium Priority
?
178 Views
Last Modified: 2013-12-25
I'm just learning SSI. Please forgive my ignorance.
I?m using the file option to build up a web page: <!--#include file="/includes/XXX.html"--> on an Apache server.

And I?ve discovered you can only have includes in the www root directory and the includes directory.

Apache configures it in:
<Directory /var/www/includes>
        Options Includes
</Directory>

Though I haven?t changed it yet, I guess this option can allow me to add or change the includes directory.

I want to write a page built up on #include file data from several different servers to report on sites I manage so I can have some shtml like this:

<!--#include file="http://www.site1.com/includes/XXX.html"-->
<!--#include file=" http://www.site2.net/includes/XXX.html"-->
<!--#include file=" http://www.site3.org/includes/XXX.html"-->

How do I configure my shtml and/or Apache to allow this?

And if the answer to my question, is ?you can?t do this? please don?t bother replying!

Thank you for your time and help.

Stoke
0
Comment
Question by:Stoke
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
7 Comments
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6397914
<!--#include virtual="/cgi-bin/include.cgi?url=www.site1.com/includes/XXX.html" -->
<!--#include virtual="/cgi-bin/include.cgi?url=www.site2.com/includes/XXX.html" -->

where include.cgi simply gets the required file passed in as value of the url parameter.

or, if you have wget for example:

  <!--#exec cmd="wget http://www.site1.com/includes/XXX.html" -->
0
 

Author Comment

by:Stoke
ID: 6405474
Dear Ahoffmann,

This looks like an excellent solution. Would you send me the include.cgi script please?

Thank you,

Stoke
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 6405572
use LWP;
USE LWP::UserAgent;
use URI;
use HTTP::Request;
use CGI;
$::q=new CGI;
$::url=q->param('url');
$n=new HTTP::Request(GET=>"$url");
$u=LWP::UserAgent->new(agent=>"is this nice"); $x=$u->request($n);
print $x->content;
# to be improved ;-)
0
Docker-Compose to Simplify Multi-Container Builds

Our veteran DevOps Author takes you through how to build a multi-container environment, managed with a single utility in order to simplify your deployments.

 

Author Comment

by:Stoke
ID: 6405627
Hi,

I put the script on and got:
The server encountered an internal error or misconfiguration and was unable to complete your request.

I checked the error log on it came up with:

Premature end of script headers

Please do you know what I need to do to fix it?
0
 

Author Comment

by:Stoke
ID: 6406668
I managed to create a perl script to redirect to another website, but the problem it created is that it took the entire page to the new web site. I want to be able to build up a page based on information from other websites.
0
 
LVL 51

Accepted Solution

by:
ahoffmann earned 200 total points
ID: 6406990
> Premature end of script headers
I missed
    print $::q->header;
'cause I thought you use this script multiple to build a single page.

>  want to be able to build up a page based on information
from other websites.
You only can get complete pages, not just parts it. You must filter what you need yourself.
0
 

Author Comment

by:Stoke
ID: 6408920
I think you've helped me enough to build up the pages I need. Thank you.
0

Featured Post

Setting up LaraDock for Laravel

Learn how to set up LaraDock in a Laravel project - LaraDock gives us an easy way to run a Laravel application using Docker in a single command.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
Shoutout to Emily Plummer (http://www.experts-exchange.com/members/eplummer26.html) for giving me this article! She did most of it, I just finished it up and posted it for her :)    Introduction In a previous article (http://www.experts-exchang…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question