Brian Dessent | 1 Oct 2003 02:14
Favicon

Re: Debian 3.0r1 Apache 1.3.26 cgi-bin behavior depends on script name and browser (?)

David Christensen wrote:

> And here is one that Mozilla attempts to download, while IE says "The
> page cannot be found":
> 
>     dpchrist <at> d3020g:~/public_html/cgi-bin:CVS> cat intro3.pl
>     #!/usr/bin/perl -w
>     use strict;
> 
>     print "Content-Type: text/html\n\n";
> 
>     print <<END;
>     <html>
>     <head><title>My Page Title</title></head>
>     <body><p>My page body</p></body>
>     </html>
>     END
>     exit(0);

You need to use \r\n for line endings in the HTTP headers, not \n.

This is exactly the sort of reason why you should always use CGI.pm and
not try to handle HTTP headers, forms, encoding, etc. with code that
your write.  It's almost guaranteed that there is always some minor
thing that will break "home brewed" scripts that is handled properly by
CGI.pm.

Brian

---------------------------------------------------------------------
(Continue reading)

Joshua Slive | 1 Oct 2003 03:58
Picon

Re: Virtual Host directives ignored?


On Tue, 30 Sep 2003, Harrell, Roger wrote:

> I am havning some trouble with the VirtualHost directives. It appears Apache
> is ignoring them. No matter what domain I browse to it is serving from the
> document root. It's not even pulling the first VirtualHost directive info
> for any domain. I have set:
> NameVirtualHost

> I initially tried with * for the IP but when trying to start http got a
> "using * and non-* based virtual hosting not supported" error.

You must have some other <VirtualHost> sections.  You need to replace them
all with * or *:80.

Joshua.

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

Nathan Ollerenshaw | 1 Oct 2003 03:54
Picon

Re: Debian 3.0r1 Apache 1.3.26 cgi-bin behavior depends on script name and browser (?)

On Oct 1, 2003, at 9:14 AM, Brian Dessent wrote:

> This is exactly the sort of reason why you should always use CGI.pm and
> not try to handle HTTP headers, forms, encoding, etc. with code that
> your write.  It's almost guaranteed that there is always some minor
> thing that will break "home brewed" scripts that is handled properly by
> CGI.pm.

Or go one step even better, and use CGI::Application. Not only does it 
handle all the mess for you (by using CGI.pm) but it also provides a 
framework for your application that makes sense.

Mix it up with HTML::Template to do the HTML presentation, and 
Form::Validator (I think thats the module) and you have everything you 
need to make an application quickly and safely.

The great thing about CGI::Application, though, as everyone knows, is 
that if you decide you need it to run faster, you can with very little 
modification make it a mod_perl app.

Just my 2c. :)

Nathan.

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org
(Continue reading)

Nathan Ollerenshaw | 1 Oct 2003 03:57
Picon

Re: mod_php question

On Oct 1, 2003, at 6:50 AM, Jimmy McDonald wrote:

> I'm kind of confused. I just installed Redhat 9 and chose php as an
> option during install.

[...]

> So php isn't built in and there is no module installed and
> httpd.conf doesn't try to load one.

Actually, I think you'll find that RedHat's httpd.conf includes a 
directory in /etc/httpd that has one file per module to load, or 
something like that. I never checked because it's always worked for me 
to just install all the packages and start apache.

Try putting a index.php file in /var/www/htdocs (or is it 
/var/www/html?) with the following:

<?php

phpinfo();

?>

then hit the root of the webserver. You should see some nice output 
from PHP telling you what it was compiled with, the defaults that have 
been set, etc.

Nathan.

(Continue reading)

Joshua Slive | 1 Oct 2003 04:09
Picon

Re: Multiple Names for site


On Tue, 30 Sep 2003, Peter Fleck wrote:
> This is the documentation I was referring to:
>
> http://httpd.apache.org/docs-2.0/mod/core.html#virtualhost
>
> <VirtualHost addr [: port ] [ addr [: port ]]     ...>
>
> where 'addr' can be "A fully qualified domain name for the IP address
> of the  virtual host;
>
> Looks to me like that's what I did:
>
> <VirtualHost www.cancer.umn.edu octopus.cancer.umn.edu>
>
> And it seems to be working for both domains.
>
> Is one method better than the other?

Yes.  As the docs in the "see also" section of the VirtualHost directive
docs say, you should be using the IP address or "*" to match all IP
addresses.

If you put in a hostname, apache simply looks up the ip address
corresponding to that hostname and uses that.  This leads to unnecessary
DNS dependencies.  See:
http://httpd.apache.org/docs-2.0/dns-caveats.html

Joshua.

(Continue reading)

Nathan Ollerenshaw | 1 Oct 2003 04:37
Picon

Re: mod_php question

On Oct 1, 2003, at 10:57 AM, Nathan Ollerenshaw wrote:

> Actually, I think you'll find that RedHat's httpd.conf includes a 
> directory in /etc/httpd that has one file per module to load, or 
> something like that. I never checked because it's always worked for me 
> to just install all the packages and start apache.

Actually, I'm wrong, I just checked.

I think it adds a block to the corect place in the httpd.conf when you 
add the package.

Nathan.

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

lou loui | 1 Oct 2003 05:53
Picon
Favicon

Apache trick to protect the Helix Basic Serer

Two ips, one server (running Apache 2 on https:443 and Helix Basic http:80).
Who is protect the Helix Basic media content and How?

Access to the media is given by an url link on the site, but an user can 
then take the address and play the media connecting directly with the Helix 
Basic server. The link alias will change every day so I get a little 
protection, but its not enough.

I can play with whatever Linux or Apache authentication feature, my users 
are stored in a mysql database in wich I could put the ip adress of the user 
(php), what would be the best way to do this?

Any of these brainstormed ideas would possibly work.

1. use Apache mod_access to filter access to directory with media content. 
would'nt it interfere with the Helix Basic if both listen to port 80?

2. use Apache mod_rewrite and the fact that Helix can be restricted to 
listen to ip#2(port:80) only to redirect media request made to ip#1 to ip#2.

3. use a Helix Basic authentication feature that I did not find yet.

4. Use an linux feature to check access to videos made by the Helix server, 
and check the database to see if ip address is allowed to connect.

So as you can see, I really need a tip on this.

_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus
(Continue reading)

David Christensen | 1 Oct 2003 06:31
Gravatar

Re: Debian 3.0r1 Apache 1.3.26 cgi-bin behavior depends on script name and browser (?)

users <at> httpd.apache.org:

Brian Dessent wrote:
> You need to use \r\n for line endings in the HTTP headers, not \n.

Thanks for the reply.  :-)

I already tried newline expansion -- no effect.  I get the same wrong
behavior whether I use my original version of the script:

    dpchrist <at> d3020g:~/public_html/cgi-bin$ cat intro3.pl
    #!/usr/bin/perl -w
    use strict;

    print "Content-Type: text/html\n\n";

    print <<END;
    <html>
    <head><title>My Page Title</title></head>
    <body><p>My page body</p></body>
    </html>
    END
    exit(0);

    dpchrist <at> d3020g:~/public_html/cgi-bin$ perl intro3.pl
    Content-Type: text/html

    <html>
    <head><title>My Page Title</title></head>
    <body><p>My page body</p></body>
(Continue reading)

Brian Dessent | 1 Oct 2003 07:05
Favicon

Re: Debian 3.0r1 Apache 1.3.26 cgi-bin behavior depends on script name and browser (?)

David Christensen wrote:

> The problem is the name "intro3.pl".  (And also "intro7.pl", and
> probably others that will only occur during a customer demonstration ;-)

What are the permissions and user/group of all these script files?  Try
making them all 755 and see if that changes anything.  And what user is
Apache running as, and is suexec in use?

Brian

---------------------------------------------------------------------
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 <at> httpd.apache.org
   "   from the digest: users-digest-unsubscribe <at> httpd.apache.org
For additional commands, e-mail: users-help <at> httpd.apache.org

Robert Andersson | 1 Oct 2003 09:30
Picon

Re: How many connected users

Free Grafton wrote:
> While the information on mod_status information is helpful, you are
correct
> in that it isn't showing me the total number of users. I am reticent to
keep
> increasing the server limit and maxclients as it appears to make no
> difference on the time that sessions are timing out for individuals when
> they are logged in. They are already set to 1000 on each. I have checked
all
> my PHP settings and there isn't really anything there that would make a
> difference in this case as far as I can tell.

It is possible to develop an algorithm which calculates the number of active
sessions you have at any one time, but how is that going to help you? You
are experiencing performance problems, and then, sessions don't matter; only
connections do.

In order to reduce the load on the server, you could add some logic in your
"session creation" code, that would only create a session if the number of
current active sessions is less than N. However, that's not a really good
idea either. You are best off trying to get your box to serve all its
visitors.

Regards,
Robert Andersson

---------------------------------------------------------------------
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 <at> httpd.apache.org
(Continue reading)


Gmane