#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    2
    Rep Power
    0
    I am searching for a way to look at generated files in Apache before they are transmitted to the client. The files can be generated by any dynamic page (PHP, CGI, JSP, etc.). Can this be done at all? Can this be done using an Apache Module?
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Can this be done at all? Can this be done using an Apache Module?

    Don't understand at all. Why can't you view your own files before launching your site?

    If you want to look at the generated files, then you are already the client. If you want to intercept the file, you are still the unique client.

    Start here to search for a particular module of Apache -> http://modules.apache.org/
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2000
    Posts
    2
    Rep Power
    0
    Thanks for your reply. Let me further explain: I want to programmatically add extra post-processing to requests before they are sent out to clients (For instance, adding additional or changing HTML code), and to do that for all types of requests (cgi, php, etc). I do not want to do so as a proxy or a client, but from within the Apache server itself. The only solution I could find was Servlet Chaining, which isn't supported by Apache JServ.

    <BLOCKQUOTE><font size="1" face="Verdana,Arial,Helvetica">quote:</font><HR>Originally posted by freebsd:
    >>Can this be done at all? Can this be done using an Apache Module?

    Don't understand at all. Why can't you view your own files before launching your site?

    If you want to look at the generated files, then you are already the client. If you want to intercept the file, you are still the unique client.

    Start here to search for a particular module of Apache -> http://modules.apache.org/
    [/quote]

  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>I want to programmatically add extra post-processing to requests before they are
    sent out to clients

    This example would get the client's http referer and determine what output to send.

    #!/usr/local/bin/perl

    $referer = "$ENV{'HTTP_REFERER'}";

    print "Content-type: text/htmlnn";
    print "<html>n<body>n";
    if ($referer) {
    print "It appears you are coming from ";
    print "$referern";
    }
    else {
    print "Hello Worldn";
    }
    print "</body>n</html>n";

    Or within an html document, or PHP, you can use "include". Anyway, you should put whatever codes within your script to do whatever post-processing tasks.

    If you are talking about Apache, you can put something like this in your .htaccess file:

    RedirectMatch index.html http://foo.bar.com/file.jsp

    [This message has been edited by freebsd (edited August 07, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo