The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.
|
 |
|
Dev Shed Forums
> System Administration
> Apache Development
|
How to install Apache::Sandwich ? please
Discuss How to install Apache::Sandwich ? please in the Apache Development forum on Dev Shed. How to install Apache::Sandwich ? please Apache Development forum discussing HTTP Server general topics, configuration, and modules. Apache is an open source web server that runs on multiple platforms.
|
|
 |
|
|
|
|

Dev Shed Forums Sponsor:
|
|
|

April 28th, 2000, 02:35 PM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|

April 28th, 2000, 06:00 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
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.
|

April 29th, 2000, 12:21 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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
|

April 29th, 2000, 02:00 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
>>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
|

April 29th, 2000, 11:40 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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
|

April 29th, 2000, 03:38 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
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.
|

April 30th, 2000, 12:08 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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.
|

May 2nd, 2000, 01:55 AM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
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.
|

May 2nd, 2000, 10:31 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|

May 2nd, 2000, 02:58 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Try
cd Apache-Sandwich-2.04
make deinstall
good luck!
|

May 2nd, 2000, 03:36 PM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
make deinstall
[]# *** No rule to make target 'deinstall'. Stop
Then........How can I remove Sandwich
|

May 2nd, 2000, 03:55 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
Have you tried to remove Sandwich.pm manually?
Can you install 2.01 at all?
|

May 4th, 2000, 10:12 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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
|

May 4th, 2000, 06:56 PM
|
|
Guest
|
|
Posts: n/a
Time spent in forums:
Reputation Power:
|
|
|
>>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>
|

May 5th, 2000, 09:08 AM
|
|
Contributing User
|
|
Join Date: Apr 2000
Posts: 79
Time spent in forums: < 1 sec
Reputation Power: 14
|
|
|
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).]
|
Developer Shed Advertisers and Affiliates
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Rate This Thread |
Linear Mode
|
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|