Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SSI linking different servers

Posted on 2001-08-17
7
Medium Priority
?
180 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
JavaScript has plenty of pieces of code people often just copy/paste from somewhere but never quite fully understand. Self-Executing functions are just one good example that I'll try to demystify here.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…
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

610 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