You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jason Long <ha...@yahoo.com.INVALID> on 2021/03/06 15:28:30 UTC
[users@httpd] Reverse Proxy server show "Service Unavailable".
Hello,
I created two VMs in the VirtualBox. One of them is Reverse Proxy server and another one is Apache Web Server.
The specifications of VM1 (Reverse Proxy) are as follows:
NIC 1 is NAT and Its IP address is "10.0.3.15".
NIC 2 is Internal Network and its IP address is "192.168.1.3".
The specifications of VM2 (Apache Web Server) are as follows:
It has one NIC and its IP address is "192.168.1.4".
Both VMs can see each other. I installed Apache Web Server on the both machines and opened ports 80 and 443 via Firewalld on them:
# firewall-cmd --list-all
FedoraServer (active)
target: default
icmp-block-inversion: no
interfaces: enp0s3
sources:
services: cockpit dhcpv6-client ssh
ports: 80/tcp 443/tcp
protocols:
masquerade: no
forward-ports:
source-ports:
icmp-blocks:
rich rules:
My goal is:
The Internet --> Reverse Proxy (VM1) --> Apache Web Server (VM2)
On the VM1, I did:
# curl http://192.168.1.4
<html>
<head>
<title> This my server. </title>
</head>
<body>
<p> Apache Server. </p>
</body>
</html>
And as you see, it can see VM2 Apache Web Server.
On the VM1, I created a Virtual Host configuration file as below:
# touch /etc/httpd/conf.d/reverse.conf
# nano /etc/httpd/conf.d/reverse.conf
And fill it with below lines:
<VirtualHost *:80>
ProxyPreserveHost On
ProxyPass / http://192.168.1.4/
ProxyPassReverse / http://192.168.1.4/
</VirtualHost>
Then restarted the Apache Web Server.
When I entered VM1 IP address, then I must see the VM2 "index.html" file, but I see below error:
Service Unavailable
The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
Why?
Thanks.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Reverse Proxy server show "Service Unavailable".
Posted by Jason Long <ha...@yahoo.com.INVALID>.
Problem solved.
It was because of SELinux:
# setsebool -P httpd_can_network_connect on
On Saturday, March 6, 2021, 10:11:27 PM GMT+3:30, Jason Long <ha...@yahoo.com.invalid> wrote:
Thanks.
On VM1, I used VirtualBox Port Forwarding:
Protocol Host IP Host Port Guest IP Guest Port
TCP 127.0.0.1 2080 10.0.3.15 80
When I enter "127.0.0.1:2080" in my browser, then logs on VM1 are:
# cat access_log
10.0.3.2 - - [06/Mar/2021:22:03:01 +0330] "GET / HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
10.0.3.2 - - [06/Mar/2021:22:03:01 +0330] "GET /favicon.ico HTTP/1.1" 503 299 "http://127.0.0.1:2080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
# cat error_log
[Sat Mar 06 22:03:01.275035 2021] [proxy:error] [pid 851:tid 1036] (13)Permission denied: AH00957: HTTP: attempt to connect to 192.168.1.4:80 (192.168.1.4) failed
[Sat Mar 06 22:03:01.275093 2021] [proxy_http:error] [pid 851:tid 1036] [client 10.0.3.2:33820] AH01114: HTTP: failed to make connection to backend: 192.168.1.4
[Sat Mar 06 22:03:01.320469 2021] [proxy:error] [pid 850:tid 990] (13)Permission denied: AH00957: HTTP: attempt to connect to 192.168.1.4:80 (192.168.1.4) failed
[Sat Mar 06 22:03:01.320528 2021] [proxy_http:error] [pid 850:tid 990] [client 10.0.3.2:33822] AH01114: HTTP: failed to make connection to backend: 192.168.1.4, referer: http://127.0.0.1:2080/
On VM2:
# cat access_log
#
# cat error_log
#
On Saturday, March 6, 2021, 07:14:09 PM GMT+3:30, Eric Covener <co...@gmail.com> wrote:
> Service Unavailable
> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
>
> Why?
What do both error_logs say?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Reverse Proxy server show "Service Unavailable".
Posted by Jason Long <ha...@yahoo.com.INVALID>.
Thanks.
On VM1, I used VirtualBox Port Forwarding:
Protocol Host IP Host Port Guest IP Guest Port
TCP 127.0.0.1 2080 10.0.3.15 80
When I enter "127.0.0.1:2080" in my browser, then logs on VM1 are:
# cat access_log
10.0.3.2 - - [06/Mar/2021:22:03:01 +0330] "GET / HTTP/1.1" 503 299 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
10.0.3.2 - - [06/Mar/2021:22:03:01 +0330] "GET /favicon.ico HTTP/1.1" 503 299 "http://127.0.0.1:2080/" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36"
# cat error_log
[Sat Mar 06 22:03:01.275035 2021] [proxy:error] [pid 851:tid 1036] (13)Permission denied: AH00957: HTTP: attempt to connect to 192.168.1.4:80 (192.168.1.4) failed
[Sat Mar 06 22:03:01.275093 2021] [proxy_http:error] [pid 851:tid 1036] [client 10.0.3.2:33820] AH01114: HTTP: failed to make connection to backend: 192.168.1.4
[Sat Mar 06 22:03:01.320469 2021] [proxy:error] [pid 850:tid 990] (13)Permission denied: AH00957: HTTP: attempt to connect to 192.168.1.4:80 (192.168.1.4) failed
[Sat Mar 06 22:03:01.320528 2021] [proxy_http:error] [pid 850:tid 990] [client 10.0.3.2:33822] AH01114: HTTP: failed to make connection to backend: 192.168.1.4, referer: http://127.0.0.1:2080/
On VM2:
# cat access_log
#
# cat error_log
#
On Saturday, March 6, 2021, 07:14:09 PM GMT+3:30, Eric Covener <co...@gmail.com> wrote:
> Service Unavailable
> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
>
> Why?
What do both error_logs say?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] Reverse Proxy server show "Service Unavailable".
Posted by Eric Covener <co...@gmail.com>.
> Service Unavailable
> The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later.
>
> Why?
What do both error_logs say?
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org