You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Sean McKendall <se...@yahoo.com> on 2005/09/20 15:05:03 UTC

[users@httpd] 502 Bad Gateway

Hello all,

I've managed to set up Apache, Domino, PHP, and MySQL on the same machine. 
Apache is running on port 80 and Domino is running on port 81.  I would like 
Apache to forward any .nsf file to port 81.  So, 
www.mydomain.com/database.nsf should redirect to 
www.mydomain.com:81/database.nsf.  I believe I've accomplished this by the 
following:

RewriteEngine on
RewriteRule ^(.*).nsf(.*) http://www.mydomain.com:81$1.nsf$2 [P]

Also, I'd like to redirect www.mydomain.com to 
www.mydomain.com/database.nsf.  I believe I've done this correctly by using 
the following redirect:

Redirect permanent /index.html http://www.mydomain.com/database.nsf

After the httpd.conf file is finally configured, I test things out.  Going 
to www.mydomain.com gives me a 502 Bad Gateway message.  In the error.log 
file, I see:

[Tue Sep 20 07:00:14 2005] [error] (OS 10061)No connection could be made 
because the target machine actively refused it.  : proxy: HTTP: attempt to 
connect to xxx.xxx.xxx.xxx:81 (www.mydomain.com) failed

What could I be doing wrong here?

Any help would be appreciated.

Thanks,
    - Sean 


---------------------------------------------------------------------
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


Re: [users@httpd] 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
I'm not entirely certain if it is or how to check.  I guess I can start 
there.

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: "Sean McKendall" <se...@yahoo.com>; "Apache Users" 
<us...@httpd.apache.org>
Sent: Tuesday, September 20, 2005 10:39 AM
Subject: Re: [users@httpd] 502 Bad Gateway


On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> After setting RewriteLogDirective to 3...
> [www.mydomain.com/sid#23bbf0][rid#5867f0/initial] (1) go-ahead with proxy
> request proxy:http://www.mydomain.com:81/database.nsf [OK]

Are you sure that your server on port 81 is listening on the loopback
interface and not solely on the external interface?

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@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


Re: [users@httpd] 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
Would anyone be able to tell me why this works?  I understand how my hosts 
file functions, but I don't understand why I needed to make this change for 
Apache to work.

    - Sean

----- Original Message ----- 
From: "Sean McKendall" <se...@yahoo.com>
To: <js...@gmail.com>
Cc: <us...@httpd.apache.org>
Sent: Monday, October 10, 2005 2:22 PM
Subject: Re: [users@httpd] 502 Bad Gateway


I resolved this by editing my hosts file and changing the line "127.0.0.1
localhost" to "127.0.0.1  www.mydomain.com".

It works, but I'm not sure why and I don't know if it's really the right
thing to do.

    - Sean

----- Original Message ----- 
From: "Sean McKendall" <se...@yahoo.com>
To: <us...@httpd.apache.org>; <js...@gmail.com>
Sent: Tuesday, September 20, 2005 11:07 AM
Subject: Re: [users@httpd] 502 Bad Gateway


I'm not entirely certain if it is or how to check.  I guess I can start
there.

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: "Sean McKendall" <se...@yahoo.com>; "Apache Users"
<us...@httpd.apache.org>
Sent: Tuesday, September 20, 2005 10:39 AM
Subject: Re: [users@httpd] 502 Bad Gateway


On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> After setting RewriteLogDirective to 3...
> [www.mydomain.com/sid#23bbf0][rid#5867f0/initial] (1) go-ahead with proxy
> request proxy:http://www.mydomain.com:81/database.nsf [OK]

Are you sure that your server on port 81 is listening on the loopback
interface and not solely on the external interface?

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@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


Re: [users@httpd] 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
I resolved this by editing my hosts file and changing the line "127.0.0.1 
localhost" to "127.0.0.1  www.mydomain.com".

It works, but I'm not sure why and I don't know if it's really the right 
thing to do.

    - Sean

----- Original Message ----- 
From: "Sean McKendall" <se...@yahoo.com>
To: <us...@httpd.apache.org>; <js...@gmail.com>
Sent: Tuesday, September 20, 2005 11:07 AM
Subject: Re: [users@httpd] 502 Bad Gateway


I'm not entirely certain if it is or how to check.  I guess I can start
there.

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: "Sean McKendall" <se...@yahoo.com>; "Apache Users"
<us...@httpd.apache.org>
Sent: Tuesday, September 20, 2005 10:39 AM
Subject: Re: [users@httpd] 502 Bad Gateway


On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> After setting RewriteLogDirective to 3...
> [www.mydomain.com/sid#23bbf0][rid#5867f0/initial] (1) go-ahead with proxy
> request proxy:http://www.mydomain.com:81/database.nsf [OK]

Are you sure that your server on port 81 is listening on the loopback
interface and not solely on the external interface?

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@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


Re: [users@httpd] 502 Bad Gateway

Posted by Joshua Slive <js...@gmail.com>.
On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> After setting RewriteLogDirective to 3...
> [www.mydomain.com/sid#23bbf0][rid#5867f0/initial] (1) go-ahead with proxy
> request proxy:http://www.mydomain.com:81/database.nsf [OK]

Are you sure that your server on port 81 is listening on the loopback
interface and not solely on the external interface?

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


Re: [users@httpd] 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
Accessing http://www.mydomain.com:81/database.nsf directly only loads the 
text for the website.  It isn't able to find the css file, images, etc.  The 
database's base URL is "http://www.mydomain.com/database.nsf".  I believe 
that's why it's unable to find those items.

As for the RewriteLog, it's empty.  Nothing seems to be written to it, but 
the file has been created.  Not sure why this is happening.

- Sean

----- Original Message ----- 
From: "Joshua Slive" <js...@gmail.com>
To: <us...@httpd.apache.org>; "Sean McKendall" <se...@yahoo.com>
Sent: Tuesday, September 20, 2005 8:26 AM
Subject: Re: [users@httpd] 502 Bad Gateway


On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> Hello all,
>
> I've managed to set up Apache, Domino, PHP, and MySQL on the same machine.
> Apache is running on port 80 and Domino is running on port 81.  I would 
> like
> Apache to forward any .nsf file to port 81.  So,
> www.mydomain.com/database.nsf should redirect to
> www.mydomain.com:81/database.nsf.  I believe I've accomplished this by the
> following:
>
> RewriteEngine on
> RewriteRule ^(.*).nsf(.*) http://www.mydomain.com:81$1.nsf$2 [P]
>
> Also, I'd like to redirect www.mydomain.com to
> www.mydomain.com/database.nsf.  I believe I've done this correctly by 
> using
> the following redirect:
>
> Redirect permanent /index.html http://www.mydomain.com/database.nsf
>
> After the httpd.conf file is finally configured, I test things out.  Going
> to www.mydomain.com gives me a 502 Bad Gateway message.  In the error.log
> file, I see:
>
> [Tue Sep 20 07:00:14 2005] [error] (OS 10061)No connection could be made
> because the target machine actively refused it.  : proxy: HTTP: attempt to
> connect to xxx.xxx.xxx.xxx:81 (www.mydomain.com) failed
>
> What could I be doing wrong here?

What happens if you try to directly access
http://www.mydomain.com:81/database.nsf
What is in the RewriteLog for the request?

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


Re: [users@httpd] 502 Bad Gateway

Posted by Joshua Slive <js...@gmail.com>.
On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> Hello all,
> 
> I've managed to set up Apache, Domino, PHP, and MySQL on the same machine.
> Apache is running on port 80 and Domino is running on port 81.  I would like
> Apache to forward any .nsf file to port 81.  So,
> www.mydomain.com/database.nsf should redirect to
> www.mydomain.com:81/database.nsf.  I believe I've accomplished this by the
> following:
> 
> RewriteEngine on
> RewriteRule ^(.*).nsf(.*) http://www.mydomain.com:81$1.nsf$2 [P]
> 
> Also, I'd like to redirect www.mydomain.com to
> www.mydomain.com/database.nsf.  I believe I've done this correctly by using
> the following redirect:
> 
> Redirect permanent /index.html http://www.mydomain.com/database.nsf
> 
> After the httpd.conf file is finally configured, I test things out.  Going
> to www.mydomain.com gives me a 502 Bad Gateway message.  In the error.log
> file, I see:
> 
> [Tue Sep 20 07:00:14 2005] [error] (OS 10061)No connection could be made
> because the target machine actively refused it.  : proxy: HTTP: attempt to
> connect to xxx.xxx.xxx.xxx:81 (www.mydomain.com) failed
> 
> What could I be doing wrong here?

What happens if you try to directly access
http://www.mydomain.com:81/database.nsf
What is in the RewriteLog for the request?

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


Re: [users@httpd] Re: 502 Bad Gateway

Posted by Dmitriy Kirhlarov <dk...@oilspace.com>.
On Tue, Sep 20, 2005 at 10:17:48AM -0500, Sean McKendall wrote:
> I opened a command prompt, typed "telnet localhost:81" and pressed enter.
> 
> The result: Could not open a connection to host on port 23 : Connection 
> failed

try
telnet localhost 81

and, when connection started,
GET /address_to_your_file HTTP/1.1
Host: localhost


(TWO Enters after Host string)

WBR
-- 
Dmitriy Kirhlarov
OILspace, 26 Leninskaya sloboda, bld. 2, 2nd floor, 115280 Moscow, Russia
P:+7 095 105 7247 F:+7 095 105 7246 E:DmitriyKirhlarov@oilspace.com
OILspace - The resource enriched - www.oilspace.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-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
I opened a command prompt, typed "telnet localhost:81" and pressed enter.

The result: Could not open a connection to host on port 23 : Connection 
failed

----- Original Message ----- 
From: "Krist van Besien" <kr...@gmail.com>
To: <us...@httpd.apache.org>; "Sean McKendall" <se...@yahoo.com>
Sent: Tuesday, September 20, 2005 10:04 AM
Subject: Re: [users@httpd] Re: 502 Bad Gateway


On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> I can ping that domain on the machine itself and it resolves to the 
> correct
> IP address.

Try doing a telnet localhost:81 from the webserver itself.

Krist


-- 
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
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


Re: [users@httpd] Re: 502 Bad Gateway

Posted by Krist van Besien <kr...@gmail.com>.
On 9/20/05, Sean McKendall <se...@yahoo.com> wrote:
> I can ping that domain on the machine itself and it resolves to the correct
> IP address.

Try doing a telnet localhost:81 from the webserver itself.

Krist


-- 
krist.vanbesien@gmail.com
Solothurn, Switzerland

---------------------------------------------------------------------
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


Re: [users@httpd] Re: 502 Bad Gateway

Posted by Sean McKendall <se...@yahoo.com>.
I can ping that domain on the machine itself and it resolves to the correct 
IP address.

----- Original Message ----- 
From: "Joost de Heer" <sa...@xs4all.nl>
To: "Sean McKendall" <se...@yahoo.com>
Cc: <us...@httpd.apache.org>
Sent: Tuesday, September 20, 2005 9:04 AM
Subject: [users@httpd] Re: 502 Bad Gateway


> RewriteEngine on
> RewriteRule ^(.*).nsf(.*) http://www.mydomain.com:81$1.nsf$2 [P]
>
> After the httpd.conf file is finally configured, I test things out.  Going
> to www.mydomain.com gives me a 502 Bad Gateway message.  In the error.log
> file, I see:
>
> [Tue Sep 20 07:00:14 2005] [error] (OS 10061)No connection could be made
> because the target machine actively refused it.  : proxy: HTTP: attempt to
> connect to xxx.xxx.xxx.xxx:81 (www.mydomain.com) failed

Does 'www.mydomain.com' resolve to the correct IP address on the machine
with the webserver? Because you use the [P] flag, the request is done by
the webserver, and not by the client.

Joost


---------------------------------------------------------------------
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


[users@httpd] Re: 502 Bad Gateway

Posted by Joost de Heer <sa...@xs4all.nl>.
> RewriteEngine on
> RewriteRule ^(.*).nsf(.*) http://www.mydomain.com:81$1.nsf$2 [P]
>
> After the httpd.conf file is finally configured, I test things out.  Going
> to www.mydomain.com gives me a 502 Bad Gateway message.  In the error.log
> file, I see:
>
> [Tue Sep 20 07:00:14 2005] [error] (OS 10061)No connection could be made
> because the target machine actively refused it.  : proxy: HTTP: attempt to
> connect to xxx.xxx.xxx.xxx:81 (www.mydomain.com) failed

Does 'www.mydomain.com' resolve to the correct IP address on the machine
with the webserver? Because you use the [P] flag, the request is done by
the webserver, and not by the client.

Joost


---------------------------------------------------------------------
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