#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    I found the document of Apache::Sandwich, http://www.perl.com/CPAN-local/autho...ch-2.04.readme

    But I still wonder how to install this module to Apache ?
    run the makefile.pl ?

    Thanks
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    tar -zxvf Apache-Sandwich-2.04.tar.gz
    cd Apache-Sandwich-2.04
    perl Makefile.PL
    make
    make install

    DONE

    note: check Makefile.PL and see if the 1st line is the path to Perl.
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    Result:
    [linux]# make install Installing /usr/lib/perl5/site_perl/5.005/Apache/Sandwich.pm
    Installing /usr/lib/perl5/man/man3/Apache::Sandwich.3
    Writing /usr/lib/perl5/site_perl/5.005/i386-linux/auto/Apache/Sandwich/.pack1
    Appending installation info to /usr/lib/perl5/5.00503/i386-linux/perllocal.po

    Modify httpd.conf:
    <Location /foo>
    #any request for /foo and it's document tree
    #are run through our Apache::Sandwich::handler
    SetHandler perl-script
    PerlHandler Apache::Sandwich

    #we send this file first
    PerlSetVar HEADER "/my_header.html"

    #requested uri (e.g. /foo/index.html) is sent in the middle

    #we send output of this mod_perl script last
    PerlSetVar FOOTER "/perl/footer.pl"
    </Location>

    [linux]# httpd restart
    Syntax error.........httpd.conf
    Invalid command 'PerlHandle', perhaps mis-spelled or defined by a module not inclided in the server configuration

    What can I do now ?
    Thanks
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Syntax error.........httpd.conf
    Once it's installed, you should play around with .htacess instead of your httpd.conf.
    I remember you were trying to have a rotate banner on the header and with a static footer. So you should set the header to point to your banner script instead.
    Example of your .htaccess file in /foo dir:
    <Location /foo>
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER "/perl/banner.pl"
    PerlSetVar FOOTER "/footer.txt"
    </Location>

    If your httpd.conf is now messed up, you should remove or comment out the new lines you have added and restart the server.
    # /path/to/apachectl graceful
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    I try to use .htaccess and check the document, but .htaccess didn't support the method <Location> and <Directory>.
    So ..., it still didn't work.
    Then, I found a <Location> state in httpd.conf, list below:
    <IfModule mod_perl.c>
    Alias /perl/ /home/httpd/perl/
    <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Registry
    Options +ExecCGI
    </Location>
    </IfModule>
    That means, <Location> is right in httpd.conf.
    Then, I run "httpd -l" to list compiled-in modules, but don't found "Sandwich".
    I think, the PerlHandleer error when I restart httpd, maybe came from "Apache can't found the Module Sandwich".
    Would you please tell me what can I do ?
    Thanks

  10. #6
  11. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    So do you have this in your httpd.conf now?
    <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER "/banner.pl"
    PerlSetVar FOOTER "/footer.txt"
    </Location>
    Be sure your banner.pl and footer.txt exist there.
    >>I run "httpd -l" to list compiled-in modules, but don't found "Sandwich".
    Sandwich.pm is a perl module, not an apache module.
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    ya, the /foo directory has head.html and foot.html, and put this lines in httpd.conf.
    Alias /foo/ /home/httpd/html/foo/
    <IfModule mod_perl.c>
    <Location /foo>
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER "/head.html"
    PerlSetVar FOOTER "/foot.html"
    </Location>
    </IfModule>
    I can restart httpd, but no action.
    If we put this lines in httpd.conf
    <Location /perl>
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER "/head.html"
    PerlSetVar FOOTER "/foot.html"
    </Location>
    Then show a Invalid command PerlHandler when restart httpd.
  14. #8
  15. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    How does it go right now? If you don't mind to wait me 2 or 3 days, I will try to install that to my web server and give you the exact configuration so to solve the problems.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    It didn't work yet.

    And I found RPM on the net. http://linusp.usp.br/rpm2html/CPAN/1...01-1.i386.html
    But I don't know how to remove Sandwich that I installed before.

    And another article on the net. http://www.bitmechanic.com/mail-arch...rent/0791.html
    But I still don't understand how to install Sandwich.


    Thank for your help

  18. #10
  19. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Try
    cd Apache-Sandwich-2.04
    make deinstall

    good luck!
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    make deinstall
    []# *** No rule to make target 'deinstall'. Stop
    Then........How can I remove Sandwich
  22. #12
  23. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    Have you tried to remove Sandwich.pm manually?
    Can you install 2.01 at all?
  24. #13
  25. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    Ya,
    I install the RPM file of Sandwich.
    redhat.com tell me, the Sandwich files list are
    1. /usr/lib/perl5/man/man3/Apache::Sandwich.3
    2. /usr/lib/perl5/site_perl/5.005/Apache/Sandwich.pm
    3. /usr/lib/perl5/site_perl/5.005/i386-linux/auto/Apache/Sandwich/.packlist
    After install, I can't find the file .packlist

    And then, I keep these lines in httpd.conf:
    <IfModule mod_perl.c>
    Alias /foo/ /home/httpd/html/foo/
    <Location /foo>
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER "head.html"
    PerlSetVar FOOTER "foot.html"
    </Location>
    </IfModule>
    Then ...... no any "sandwich" on the file /home/httpd/html/foo/index.htm

    Which directory do I need to put the file "head.html" and "foo.html" on ?
    Thanks

  26. #14
  27. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Which directory do I need to put the file "head.html" and "foo.html" on ?
    Maybe /home/httpd/html/include so these files don't get sandwiched themselves.
    According to the Readme file of Sandwich, you are supposed to put something like this:
    1) head.pl
    your banner script which doesn't print the closing </body> nor </html> tag.
    2) the files to be sandwich are any files in /foo directory.
    So you don't need to put any header or footer in these files.
    (e.g. the html part without <html><body></body></html> )
    3) foot.html
    could be as simple as this..
    </body>
    </html>
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2000
    Posts
    79
    Rep Power
    15
    My httpd.conf:
    <Directory "/home/httpd/html/foo/">
    Options +ExecCGI
    </Directory>
    <IfModule mod_perl.c>
    <Location "/home/httpd/html/foo/">
    SetHandler perl-script
    PerlHandler Apache::Sandwich
    PerlSetVar HEADER head.pl
    PerlSetVar FOOTER foot.pl
    </Location>
    </IfModule>
    My /home/httpd/html/foo/head.pl
    #!/usr/bin/perl
    print "Content-Type: text/htmlnn";
    print "This is Head...n";
    My /home/httpd/html/foo/foot.pl
    #!/usr/bin/perl
    print "Content-Type: text/htmlnn";
    print "This is Foot...n";
    Then test head.pl and foot.pl under text mode, it's OK.
    []# httpd restart
    ............No Sandwich
    Would you please tell me why ?

    [This message has been edited by rtna (edited May 05, 2000).]

IMN logo majestic logo threadwatch logo seochat tools logo