Solved

SSI linking different servers

Posted on 2001-08-17
7
169 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
  • 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
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 

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 50 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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Most of the sites are being standardized with W3C Web Standards. W3C provides lot of web standard services to the web. They have the web specification, process and documentation for all the web standards. You can apply HTML, CSS and Accessibility st…
Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
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 …

760 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now