httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Boyle Owen" <Owen.Bo...@swx.com>
Subject RE: [users@httpd] Count in SSI
Date Tue, 01 Apr 2003 10:43:13 GMT
>-----Original Message-----
>From: Jan Banan [mailto:b@grabbarna.nu]
>
>Hehe... mod_perl was not in use I realized... after adding this to 
>httpd.conf it went lightening fast:
>
>  <Files index.cgi>
>      SetHandler perl-script
>      PerlHandler Apache::Registry
>      Options ExecCGI
>  </Files>
>
>One thing that disturbs me... I like to write the above three lines in 
>.htaccess instead so it applies only to that directory. I tried to put 
>these lines in .htaccess but then I get this in error_log :
>
>   [Tue Apr  1 12:06:53 2003] [error] access to 
>   /path/to/the/file.jpg failed for xx.yy.zz.uu, reason: 
>   file permissions deny server execution
>
>But the file /path/to/the/file.jpg is 644 and the directory is 755... 
>so why is it screaming?

Because you are trying to execute a 644 file. Since this is a JPG, you
shouldn't be executing it so the problem is with the configuration
rather than the file.

If you put the lines above in a .htaccess, they will apply to the
directory. If you have static files (e.g. JPG) in the dir, apache will
try to execute them. Why not continue to use your <Files> container in
the htaccess to limit the scope to the index.cgi program?

Rgds,
Owen Boyle
Disclaimer: Any disclaimer attached to this message may be ignored. 
>
>/Jan
>
>On Tue, 1 Apr 2003, Jan Banan wrote:
>
>> Just one thought... how do I know that mod_perl is being 
>used? The Apache 
>> server identifies itself by
>> 
>>     Server: Apache/1.3.27 (Unix) mod_perl/1.27
>> 
>> Maybe I need to do something more than just having the filname like
>> index.cgi and start it with "#!/usr/local/bin/perl" ?
>> 
>> /Jan
>> 
>> On Tue, 1 Apr 2003, Jan Banan wrote:
>> 
>> > I tested by rewriting my index.shtml into a cgi-script 
>(index.cgi) and the 
>> > result is exactly the same... the client requests a new 
>page as soon as 
>> > possible after it has received the previos page and it 
>takes about 4-5 
>> > secs between each page. 
>> > 
>> > When using a simple index.shtml with no perl-calls it 
>takes no more than 
>> > one second, so there seem to be no problem with SSI, the 
>problem seem to 
>> > be that apache 1.3.27 takes seconds to start/stop 
>executing a perl-script 
>> > with mod_perl/1.27.
>> > 
>> > Any suggestions of how to fasten this up are very welcome!!
>> > 
>> > /Jan
>> > 
>> > On Tue, 1 Apr 2003, Jan Banan wrote:
>> > 
>> > > I am using modperl: Server: Apache/1.3.27 (Unix) 
>PHP/4.2.3 mod_perl/1.27
>> > > I rewrote the perl-script like this:
>> > > 
>> > >    #!/usr/local/bin/perl
>> > >    use Time::HiRes qw(gettimeofday tv_interval);
>> > >    $t0 = [gettimeofday];
>> > >    ($sec, $min, $hour)=localtime(time-2);
>> > >    $year += 1900;
>> > >    $mon++;
>> > >    print "Content-Type: text/plain\n\n";
>> > >    print (sprintf ("%.2d%.2d%.2d", $hour, $min, $sec));
>> > >    $t1 = [gettimeofday];
>> > >    $t0_t1 = tv_interval $t0, $t1;
>> > >    print STDERR "Time diff: $t0_t1\n";
>> > > 
>> > > This is the time diffs I get in Apache error_log:
>> > > 
>> > >   Time diff: 0.000337
>> > >   Time diff: 0.000339
>> > >   Time diff: 0.000348
>> > >   Time diff: 0.000366
>> > >   Time diff: 0.000333
>> > > 
>> > > So the perl-script seem to execute really fast. But what 
>may take time is 
>> > > the SSI line:
>> > >    <!--#include virtual="/cgi-bin/slow_clock.pl" -->
>> > > because the client webbrowser is sending a GET every 
>second but it only 
>> > > receives a result every 4-5 second.
>> > > If I change the SSI line to
>> > >    <!--#config timefmt="%H%M%S" --><!--#echo var="DATE_LOCAL"
-->
>> > > (so I am not able to slow the clock my 2 secs) then the 
>client get a 
>> > > respons each second (as I want).
>> > > 
>> > > So either there seem to be something really slow with SSI
>> > >    <!--#include virtual="/cgi-bin/slow_clock.pl" -->
>> > > or for Apache to start/stop using Perl.
>> > > 
>> > > Any suggestions are very welcome!!
>> > > 
>> > > /Jan
>> > > 
>> > > On 31 Mar 2003, Garth Winter Webb wrote:
>> > > 
>> > > > Are you running mod_perl?  A request to this CGI 
>should definitely not
>> > > > take a few seconds.  It shouldn't even take a second.  
>The speed of your
>> > > > machine is not at issue here.  I've got a PII 300MHz 
>machine serving
>> > > > content from multiple scripts that do way more than 
>this one and the
>> > > > response is less than a second.
>> > > > 
>> > > > Use mod_perl if you not already.  You could load 
>Time::HiRes from your
>> > > > script, record the time at the beginning and at the 
>end and write the
>> > > > difference to STDERR which you can pick up in your log 
>file.  By using
>> > > > mod_perl you won't incur a hit for loading Time::HiRes 
>(or Perl, or any
>> > > > module it uses for that matter) after the first hit.  
>This will tell you
>> > > > how much time is being spent running your script.
>> > > > 
>> > > > G
>> > > > 
>> > > > On Mon, 2003-03-31 at 09:17, Jan Banan wrote:
>> > > > > > You have to call an external program which may be 
>in CGI, e.g.
>> > > > > >         <!--#include virtual="/cgi-bin/slow_clock.pl"
-->
>> > > > > > where slow_clock.pl always returns the time of two 
>seconds ago.
>> > > > > 
>> > > > > I did that by creating the following /cgi-bin/slow_clock.pl :
>> > > > > 
>> > > > >    #!/usr/local/bin/perl
>> > > > >    print "Content-Type: text/plain\n\n";
>> > > > >    ($sec, $min, $hour)=localtime(time-2);
>> > > > >    print (sprintf ("%.2d%.2d%.2d", $hour, $min, $sec));
>> > > > > 
>> > > > > The problem is that this is extremely slow. I like 
>the user to be able to 
>> > > > > send/receive a GET every second, but each request 
>takes a few seconds to 
>> > > > > execute on this 550 MHz Pentium III running RedHat 
>Linux 7.2 and Apache 
>> > > > > 1.3.27 :-( 
>> > > > > Probably I need to buy a faster computer... or just 
>put the clock back 
>> > > > > two seconds, hrm.
>> > > > > 
>> > > > > /JB
>> > > > > 
>> > > > > 
>> > > > > 
>---------------------------------------------------------------------
>> > > > > The official User-To-User support forum of the 
>Apache HTTP Server Project.
>> > > > > See <URL:http://httpd.apache.org/userslist.html> for 
>more info.
>> > > > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> > > > >    "   from the digest: 
>users-digest-unsubscribe@httpd.apache.org
>> > > > > For additional commands, e-mail: users-help@httpd.apache.org
>> > > > 
>> > > 
>> > > 
>> > > 
>---------------------------------------------------------------------
>> > > The official User-To-User support forum of the Apache 
>HTTP Server Project.
>> > > See <URL:http://httpd.apache.org/userslist.html> for more info.
>> > > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> > >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> > > For additional commands, e-mail: users-help@httpd.apache.org
>> > > 
>> > > 
>> > 
>> > 
>> > 
>---------------------------------------------------------------------
>> > The official User-To-User support forum of the Apache HTTP 
>Server Project.
>> > See <URL:http://httpd.apache.org/userslist.html> for more info.
>> > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>> >    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> > For additional commands, e-mail: users-help@httpd.apache.org
>> > 
>> > 
>> 
>> 
>> ---------------------------------------------------------------------
>> The official User-To-User support forum of the Apache HTTP 
>Server Project.
>> See <URL:http://httpd.apache.org/userslist.html> for more info.
>> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
>> For additional commands, e-mail: users-help@httpd.apache.org
>> 
>> 
>
>
>---------------------------------------------------------------------
>The official User-To-User support forum of the Apache HTTP 
>Server Project.
>See <URL:http://httpd.apache.org/userslist.html> for more info.
>To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>   "   from the digest: users-digest-unsubscribe@httpd.apache.org
>For additional commands, e-mail: users-help@httpd.apache.org
>
>

This message is for the named person's use only. It may contain
confidential, proprietary or legally privileged information. No
confidentiality or privilege is waived or lost by any mistransmission.
If you receive this message in error, please notify the sender urgently
and then immediately delete the message and any copies of it from your
system. Please also immediately destroy any hardcopies of the message.
You must not, directly or indirectly, use, disclose, distribute, print,
or copy any part of this message if you are not the intended recipient.
The sender's company reserves the right to monitor all e-mail
communications through their networks. Any views expressed in this
message are those of the individual sender, except where the message
states otherwise and the sender is authorised to state them to be the
views of the sender's company. 



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message