[us...@httpd] http/1.1 persistent connection issue.

2009-06-03 Thread vincent.blondel

Hello all,

I am trying to develop a little program that should be able to send
http/1.1 requests.  This is all running fine but I get some problems
with the persistent connection.

I mean I can send one request in my http connection but the second one
does not seem to work properly.

Maybe I made an error in my code, maybe I do not understand something in
http/1.1 ?

Can somebody help me please ? ... many thks.

- source code ---

#include arpa/inet.h
#include netinet/in.h
#include sys/types.h
#include sys/socket.h
#include unistd.h
#include strings.h
#include stdio.h
#include stdlib.h

const static char GET [] =
{
GET / HTTP/1.1\r\n
Host: 127.0.0.1\r\n
User-Agent: UserAgent\r\n
Connection: keep-alive\r\n
\r\n
};

int main(int argc, char **argv)
{
int bufsize = 0;
char buffer[1024] = \n;

int32_t i32SocketFD = socket(PF_INET, SOCK_STREAM, 0);
if (-1 == i32SocketFD) {
fprintf(stderr, Error i32SocketFD);
exit(-1);
}
struct sockaddr_in stSockAddr;
bzero(stSockAddr, sizeof(stSockAddr));
stSockAddr.sin_family = AF_INET;
stSockAddr.sin_port = htons(80);
int32_t i32Res = inet_pton(AF_INET, 127.0.0.1, (void *)
stSockAddr.sin_addr);
if (0  i32Res){
fprintf(stderr, i32Res);
exit(-1);
} else if (0 == i32Res){
fprintf(stderr, Error i32Res 2);
exit(-1);
}

if (-1 == connect(i32SocketFD, (struct sockaddr *) stSockAddr,
sizeof(stSockAddr))) {
fprintf(stderr, Error connect);
exit(-1);
}

if (send(i32SocketFD, GET, strlen(GET), 0) == -1) {
fprintf(stderr, Error sending data.);
}

while((bufsize = read(i32SocketFD, buffer, sizeof(buffer) - 1))){
printf(%s,buffer);
}

if (send(i32SocketFD, GET, strlen(GET), 0) == -1) {
fprintf(stderr, Error sending data.);
}

while((bufsize = read(i32SocketFD, buffer, sizeof(buffer) - 1))){
printf(%s,buffer);
}

shutdown(i32SocketFD, 2);
close(i32SocketFD);
}
-
ATTENTION:
The information in this electronic mail message is private and
confidential, and only intended for the addressee. Should you
receive this message by mistake, you are hereby notified that
any disclosure, reproduction, distribution or use of this
message is strictly prohibited. Please inform the sender by
reply transmission and delete the message without copying or
opening it.

Messages and attachments are scanned for all viruses known.
If this message contains password-protected attachments, the
files have NOT been scanned for viruses by the ING mail domain.
Always scan attachments before opening them.
-



-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] How to config Reverse Proxy does not proxy some specific URIs or Files?

2009-06-03 Thread Krist van Besien
On Tue, Jun 2, 2009 at 7:31 PM, Qingshan Xie xieq...@yahoo.com wrote:

 Hello!

   Our Reverse Proxy servers proxy everything to backend generally.  How can 
 we configure it not proxy some specific URIs or Files, for example, the local 
 index.html?



See
http://httpd.apache.org/docs/2.2/mod/mod_proxy.html#proxypass

for an example.


Krist


-- 
krist.vanbes...@gmail.com
kr...@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] configuring mysql with php

2009-06-03 Thread aman parashar
he php with the apache server works fine. But with the mysql , it doesnt
show nothing even when i tried if it has the mysql library is present,
nothing comes out.Empty browser, plz i need help.I appreciate for your
precious time. Even it couldnt give me error or anything,i couldnt figure if
the php has really connected to the mysql server.

All the files are downloaded in the same directory c:\download\...

and i renamed the php.ini_recommend to php.ini


Re: [us...@httpd] configuring mysql with php

2009-06-03 Thread Darryle Steplight
Did you start the mysql server?

On Wed, Jun 3, 2009 at 4:51 AM, aman parashar mnpr...@gmail.com wrote:
 he php with the apache server works fine. But with the mysql , it doesnt
 show nothing even when i tried if it has the mysql library is present,
 nothing comes out.Empty browser, plz i need help.I appreciate for your
 precious time. Even it couldnt give me error or anything,i couldnt figure if
 the php has really connected to the mysql server.

 All the files are downloaded in the same directory c:\download\...

 and i renamed the php.ini_recommend to php.ini



-- 
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] configuring mysql with php

2009-06-03 Thread Lester Caine

aman parashar wrote:
he php with the apache server works fine. But with the mysql , it doesnt 
show nothing even when i tried if it has the mysql library is present, 
nothing comes out.Empty browser, plz i need help.I appreciate for your 
precious time. Even it couldnt give me error or anything,i couldnt 
figure if the php has really connected to the mysql server.


All the files are downloaded in the same directory c:\download\...

and i renamed the php.ini_recommend to php.ini


You will get more help on a PHP list 
http://www.php.net/mailing-lists.php

MySQl is not enabled by default, so you will need to uncomment the 
correct extension for the version of MySQL you are actually using, and 
then restart Apache to load it.


( I prefer a real database so I'm not sure which ones you need ;) )

--
Lester Caine - G8HFL
-
Contact - http://lsces.co.uk/wiki/?page=contact
L.S.Caine Electronic Services - http://lsces.co.uk
EnquirySolve - http://enquirysolve.com/
Model Engineers Digital Workshop - http://medw.co.uk//
Firebird - http://www.firebirdsql.org/index.php

-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] combining ldap and file authentication

2009-06-03 Thread dimce

Hi all Apache cracks,

Is it possible to force both file and ldap authentication in Apache? 
The idea is that first the user gets a password window and is asked for the
login details from a passwd file and after that he is asked for a ldap
password and only if both are true he is allowed access.
I already tried with:
Location /secure
  AuthType Basic
  AuthName Auth
  AuthBasicProvider file ldap
  AuthUserFile /etc/apache/passwd
  AuthLDAPURL ldap://...
  require valid-user
/Location
But this seems to work for either type of authentication and I don't get a
second authentication window.

Thanks,
Dimce.
-- 
View this message in context: 
http://www.nabble.com/combining-ldap-and-file-authentication-tp23851905p23851905.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] combining ldap and file authentication

2009-06-03 Thread Tom Evans
On Wed, 2009-06-03 at 06:55 -0700, dimce wrote:
 Hi all Apache cracks,
 
 Is it possible to force both file and ldap authentication in Apache? 
 The idea is that first the user gets a password window and is asked for the
 login details from a passwd file and after that he is asked for a ldap
 password and only if both are true he is allowed access.
 I already tried with:
 Location /secure
   AuthType Basic
   AuthName Auth
   AuthBasicProvider file ldap
   AuthUserFile /etc/apache/passwd
   AuthLDAPURL ldap://...
   require valid-user
 /Location
 But this seems to work for either type of authentication and I don't get a
 second authentication window.
 
 Thanks,
 Dimce.

This isn't possible with either apache or regular HTTP authentication.
HTTP is stateless, this would require two requests and to know that the
first phase of authentication was successful (and presumably, what type
of authentication it was) requires state. 

Secondly, both of your authentication providers are Basic, which doesn't
(iirc) allow multiple headers to be supplied. Even if it did, the
behaviour you requested - browser prompts for first password, browser
prompts for second password - requires this exchange: 

1) browser requests page
2) server responds with '401 Unauthorized'
3) browser prompts for first username and password
4) server accepts first set of credentials, responds with '401
Unauthorized'
5) browser prompts for second username and password

However, most/all browsers will empty their basic auth cache for that
server/realm immediately on receiving a 401 response, so it will no
longer submit the first set of credentials.

The only way to provide this kind of authentication scheme is with
session based authentication (and therefore not using apache auth
modules).

Tom


-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Apache uses FIFO scheduling ??

2009-06-03 Thread ricardo13

hi,

I would like about How work Apache ??
I read a scientific about that Apache works like FIFO.
Is it true ?? 

Thank you
Ricardo
-- 
View this message in context: 
http://www.nabble.com/Apache-uses-FIFO-schedulingtp23857087p23857087.html
Sent from the Apache HTTP Server - Users mailing list archive at Nabble.com.


-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd]

2009-06-03 Thread Lyudmila L. Balakireva
Hello,
I need to supply different content handler based on presence of certain
request header.
Is it any simple ready to use solution exists for the problem?  Like
configuration direction (example please). Or I need to implement input
filter to check header and set the content handler ? any examples for
this?
Any help will be appreciated,
Luda



-
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-unsubscr...@httpd.apache.org
  from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



Re: [us...@httpd] http/1.1 persistent connection issue.

2009-06-03 Thread Lyle Wincentsen
On Wed, Jun 3, 2009 at 2:25 AM, vincent.blon...@ing.be wrote:


 Hello all,

 I am trying to develop a little program that should be able to send
 http/1.1 requests.  This is all running fine but I get some problems
 with the persistent connection.

 I mean I can send one request in my http connection but the second one
 does not seem to work properly.

 Maybe I made an error in my code, maybe I do not understand something in
 http/1.1 ?

 Can somebody help me please ? ... many thks.

 - source code ---

 #include arpa/inet.h
 #include netinet/in.h
 #include sys/types.h
 #include sys/socket.h
 #include unistd.h
 #include strings.h
 #include stdio.h
 #include stdlib.h

 const static char GET [] =
 {
GET / HTTP/1.1\r\n
Host: 127.0.0.1\r\n
User-Agent: UserAgent\r\n
Connection: keep-alive\r\n
\r\n
 };

 int main(int argc, char **argv)
 {
int bufsize = 0;
char buffer[1024] = \n;

int32_t i32SocketFD = socket(PF_INET, SOCK_STREAM, 0);
if (-1 == i32SocketFD) {
fprintf(stderr, Error i32SocketFD);
exit(-1);
}
struct sockaddr_in stSockAddr;
bzero(stSockAddr, sizeof(stSockAddr));
stSockAddr.sin_family = AF_INET;
stSockAddr.sin_port = htons(80);
int32_t i32Res = inet_pton(AF_INET, 127.0.0.1, (void *)
 stSockAddr.sin_addr);
if (0  i32Res){
fprintf(stderr, i32Res);
exit(-1);
} else if (0 == i32Res){
fprintf(stderr, Error i32Res 2);
exit(-1);
}

if (-1 == connect(i32SocketFD, (struct sockaddr *) stSockAddr,
 sizeof(stSockAddr))) {
fprintf(stderr, Error connect);
exit(-1);
}

if (send(i32SocketFD, GET, strlen(GET), 0) == -1) {
fprintf(stderr, Error sending data.);
}

while((bufsize = read(i32SocketFD, buffer, sizeof(buffer) - 1))){
printf(%s,buffer);
}

if (send(i32SocketFD, GET, strlen(GET), 0) == -1) {
fprintf(stderr, Error sending data.);
}

while((bufsize = read(i32SocketFD, buffer, sizeof(buffer) - 1))){
printf(%s,buffer);
}

shutdown(i32SocketFD, 2);
close(i32SocketFD);
 }


It might be helpful if you included the stderr output, or whatever
indications you are getting that it does not seem to work properly.


[us...@httpd] Not really an Apcahe question but I am sure someone here can answer it...

2009-06-03 Thread Mike Lyon
So if I bring up a firefox browser and simply type in sears it will take
me to www.sears.com. If I type in apple it takes me to www.apple.com but
then if I type in some other random company, it takes me no where. Is this
some kind of special DNS record or something at that specific domain for
this to work?

Thanks,
Mike


Re: [us...@httpd] Not really an Apcahe question but I am sure someone here can answer it...

2009-06-03 Thread Evan Platt

At 03:07 PM 6/3/2009, you wrote:
So if I bring up a firefox browser and simply type in sears it 
will take me to http://www.sears.comwww.sears.com. If I type in 
apple it takes me to http://www.apple.comwww.apple.com but then 
if I type in some other random company, it takes me no where. Is 
this some kind of special DNS record or something at that specific 
domain for this to work?


http://alwaysaskwhy.com/jameselee/blog/2006/07/firefox_tip_search_from_the_address_bar.html

Firefox uses a I'm feeling lucky google search...

(Not my link). 



-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org



[us...@httpd] Host bypass custom build CGI

2009-06-03 Thread phpaltcgi

Can I bypass a web host's mod_php with a
separate, private PHP running as CGI?

Background, host won't upgrade its mod_php.
I may need 5.2.9 bugfixes, depending.
They won't mind if I do it, but won't help.
They're nonprofit.

The question is whether it's possible.
I have shell access, but not root; assume
no sysadmin help or opposition.  I have
gcc from shell. OS is RHEL of some flavor.
Their Apache offers mod_cgi.

I'd rig a copy of PHP 5.2.9 to run as
pure CGI.  I'm fine with the slowdown.
I may be adventuresome and try 5.3.0 RC.

This host expressed terror at a minor
upgrade, PHP 5.2.6 to 5.2.9, which
it termed a MAJOR system change
- their SHOUTCAPS, not mine.

User disruption was the worry claimed.  Yet
they routinely do mass notices/reboots for
kernel upgrades, MX change, etc.  Go figure.

So I reckon best to use a custom PHP
behind their Apache 2.  Then I can leave
them alone.

There are other motivations, like PECL
modules which they wouldn't install for
lack of manpower, they said.


-
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-unsubscr...@httpd.apache.org
 from the digest: users-digest-unsubscr...@httpd.apache.org
For additional commands, e-mail: users-h...@httpd.apache.org