503 service unavailable. Apache crashes once in 7-10 days - apache

I use Apache server on Ubuntu 14.04. In order redirect all requests from mypage.com to mypage.com:8080/myapp I use mod_proxy. My 000-default.conf looks as follows:
<VirtualHost *:80>
# The ServerName directive sets the request scheme, hostname and port that
# the server uses to identify itself. This is used when creating
# redirection URLs. In the context of virtual hosts, the ServerName
# specifies what hostname must appear in the request's Host: header to
# match this virtual host. For the default virtual host (this file) this
# value is not decisive as it is used as a last resort host regardless.
# However, you must set it for any further virtual host explicitly.
#ServerName www.example.com
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
# error, crit, alert, emerg.
# It is also possible to configure the loglevel for particular
# modules, e.g.
#LogLevel info ssl:warn
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
ProxyPass / http://mypage.com:8080/myapp/ retry=0 timeout=10
ProxyPassReverse / http://mypage.com:8080/myapp/
ServerName mypage.com
# For most configuration files from conf-available/, which are
# enabled or disabled at a global level, it is possible to
# include a line for only one particular virtual host. For example the
# following line enables the CGI configuration for this host only
# after it has been globally disabled with "a2disconf".
#Include conf-available/serve-cgi-bin.conf
</VirtualHost>
And that is my ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 80
Listen 81
<IfModule ssl_module>
Listen 443
</IfModule>
<IfModule mod_gnutls.c>
Listen 443
</IfModule>
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
And everything works fine until in a several days I always get 503 Service Unavailable error page. and this is written in error.log before error occurs
[Sun Oct 25 21:22:27.779422 2015] [core:error] [pid 14595] [client 38.104.233.252:45239] AH00126: Invalid URI in request GET HTTP/1.1 HTTP/1.1
[Mon Oct 26 02:30:20.925532 2015] [core:error] [pid 15416] [client 190.252.95.102:53508] AH00126: Invalid URI in request GET: index.php HTTP/1.0
[Mon Oct 26 08:22:27.771751 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
[Mon Oct 26 08:22:27.774040 2015] [proxy:error] [pid 15402] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s
[Mon Oct 26 08:22:27.774111 2015] [proxy_http:error] [pid 15402] [client 5.28.160.27:48692] AH01114: HTTP: failed to make connection to backend: mypage.com
[Mon Oct 26 10:55:51.655213 2015] [proxy:error] [pid 15406] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
[Mon Oct 26 10:55:51.655422 2015] [proxy:error] [pid 15406] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s
[Mon Oct 26 10:55:51.655470 2015] [proxy_http:error] [pid 15406] [client 169.57.5.20:60000] AH01114: HTTP: failed to make connection to backend: mypage.com
[Mon Oct 26 13:32:00.442031 2015] [proxy:error] [pid 15408] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
[Mon Oct 26 13:32:00.442356 2015] [proxy:error] [pid 15408] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s
[Mon Oct 26 13:32:00.442413 2015] [proxy_http:error] [pid 15408] [client 217.168.189.15:50222] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn
[Mon Oct 26 13:32:12.245050 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
[Mon Oct 26 13:32:12.245179 2015] [proxy:error] [pid 15402] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s
[Mon Oct 26 13:32:12.245190 2015] [proxy_http:error] [pid 15402] [client 217.168.189.15:50225] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn
[Mon Oct 26 13:34:44.343614 2015] [mpm_prefork:notice] [pid 991] AH00169: caught SIGTERM, shutting down
[Mon Oct 26 13:36:07.703185 2015] [mpm_prefork:notice] [pid 991] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations
[Mon Oct 26 13:36:07.708761 2015] [core:notice] [pid 991] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 27 01:20:23.236327 2015] [mpm_prefork:notice] [pid 991] AH00169: caught SIGTERM, shutting down
[Tue Oct 27 01:20:24.265160 2015] [mpm_prefork:notice] [pid 3247] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations
[Tue Oct 27 01:20:24.265243 2015] [core:notice] [pid 3247] AH00094: Command line: '/usr/sbin/apache2'
[Tue Oct 27 01:41:17.177723 2015] [mpm_prefork:notice] [pid 3247] AH00169: caught SIGTERM, shutting down
[Tue Oct 27 01:41:18.219244 2015] [mpm_prefork:notice] [pid 11636] AH00163: Apache/2.4.7 (Ubuntu) PHP/5.5.9-1ubuntu4.11 configured -- resuming normal operations
[Tue Oct 27 01:41:18.219351 2015] [core:notice] [pid 11636] AH00094: Command line: '/usr/sbin/apache2'
After I restart my machine it works fine again. Then in 7-10 days it crashes again. Tried a lots of things in internet but always get this error at most in several weeks. Struggling with already for some months.
SELinux is disabled.

The problem is not with Apache because its still serving a 503 page
The problem is with the application running on port number 8080, you are reverse proxying / to http://mypage.com:8080/myapp/ and when Apache is trying to proxy the request its not getting back the response from the 8080 app and so its trowing the message 'Service Unavailable' . Its inferred from the underlying part of the log.
[Mon Oct 26 13:32:00.442031 2015] [proxy:error] [pid 15408] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
[Mon Oct 26 13:32:00.442356 2015] [proxy:error] [pid 15408] AH00959: ap_proxy_connect_backend disabling worker for (mypage.com) for 0s
[Mon Oct 26 13:32:00.442413 2015] [proxy_http:error] [pid 15408] [client 217.168.189.15:50222] AH01114: HTTP: failed to make connection to backend: mypage.com, referer: http://mypage.com/admn
[Mon Oct 26 13:32:12.245050 2015] [proxy:error] [pid 15402] (111)Connection refused: AH00957: HTTP: attempt to connect to 127.0.1.1:8080 (mypage.com) failed
So check and post(if necessary) the logs of the server running on port number 8080

Related

ProxyRemote works with HTTP URL but not with HTTPS

ProxyRemote Directive doesn't work with HTTPS:
<VirtualHost *:443>
ServerName foo.foo
SSLProxyEngine on
SSLProxyVerify none
#SSLProxyVerifyDepth 10
SSLProxyCheckPeerCN off
# SAAS: disable hostname check
SSLProxyCheckPeerName off
SSLProxyCheckPeerExpire off
SSLProxyCACertificatePath /etc/ssl/certs/
ProxyRemote * https://10.27.73.178:443/
ProxyPass /api/ https://foo.gw.dev/api/
ProxyPassReverse /api/ https://foo.gw.dev/api/
SSLEngine on
SSLCertificateFile /storage/user/conf/ssl/web_cert.pem
SSLCertificateKeyFile /storage/user/conf/ssl/web_key.pem
SSLCertificateChainFile /storage/user/conf/ssl/web_chain.pem
SSLCACertificatePath /storage/user/conf/ssl/
SSLVerifyClient none
</VirtualHost>
It works if I specify http URL, like
ProxyRemote * http://10.27.73.178:3128/
I think it is a certificate checking issue, where exactly should I specify the proxy CA certificate?
I get the following error logs:
[Wed Nov 27 14:35:40.961981 2019] [proxy_http:trace1] [pid 32633:tid 140286441285376] mod_proxy_http.c(1931): [client 127.0.0.1:54302] HTTP: serving URL https://foo.gw.dev/api/
[Wed Nov 27 14:35:40.961989 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(2302): AH00942: HTTPS: has acquired connection for (foo.gw.dev)
[Wed Nov 27 14:35:40.961993 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(2355): [client 127.0.0.1:54302] AH00944: connecting https://foo.gw.dev/api/ to foo.gw.dev:443
[Wed Nov 27 14:35:40.962067 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(2564): [client 127.0.0.1:54302] AH00947: connected /api to 10.27.73.178:443
[Wed Nov 27 14:35:40.962086 2019] [proxy:trace2] [pid 32633:tid 140286441285376] proxy_util.c(2999): HTTPS: fam 2 socket created to connect to foo.gw.dev
[Wed Nov 27 14:35:41.172521 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(3033): AH02824: HTTPS: connection established with 10.27.73.178:443 (foo.gw.dev)
[Wed Nov 27 14:35:41.172570 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(2660): AH00948: CONNECT: sending the CONNECT request for foo.gw.dev:443 to the remote proxy 10.27.73.178:443 (10.27.73.178)
[Wed Nov 27 14:35:41.383758 2019] [proxy:error] [pid 32633:tid 140286441285376] (104)Connection reset by peer: AH00958: HTTPS: attempt to connect to foo.gw.dev:443 via http CONNECT through 10.27.73.178:443 (foo.gw.dev) failed
[Wed Nov 27 14:35:41.383798 2019] [proxy_http:error] [pid 32633:tid 140286441285376] [client 127.0.0.1:54302] AH01114: HTTP: failed to make connection to backend: 10.27.73.178
[Wed Nov 27 14:35:41.383802 2019] [proxy:debug] [pid 32633:tid 140286441285376] proxy_util.c(2317): AH00943: HTTPS: has released connection for (foo.gw.dev)

Apache crashing when doing concurrent requests with Symfony dev mode

I'm making a symfony 3.4 application as REST service (so I have installed the usual JMS Serializer, FoSRest and lexik/jwt-authentication-bundle) and testing it on XAMPP (Windows 10).
When i make XHR requests through my frontend application using app_dev.php as endpoint it (very) often happens that Apache crashes when making 2+ requests at the same time.
Reading here and there it looks like that this issue is often caused by an attempt to write on the session file since symfony default session handler is session.handler.native_file.
So i first tried to put null (which, according to the documentation, uses native PHP session handler), this made the crashes happen less often but didn't fix the issue completely
Then i tried using Symfony\Component\HttpFoundation\Session\Storage\Handler\PdoSessionHandler which made the crashes happen even less than before, but there's still the occasional crash
Now that i'm using a database as session handler though i'm noticing that no session is being written on the database when i make XHR requests (While it does if i open a normal web page served by the application), which shouldn't surprise me since I set my security.yml such that the REST routes must be stateless, and yet toying with the handler_id configuration influences how often my apache crashes
The same thing doesn't happen if I open multiple web pages served by the same application, nor it happens if I use the production endpoint (app.php).
Is there any way to fix this completely?
EDIT:
As requested
Can you add the apache error logs and php error logs?
It just repeats like this for each time it restarted. I have noticed this line: AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting. which might be interesting investigating upon
[Sun Dec 17 00:39:58.548676 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 22856 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:39:59.544151 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:39:59.740710 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:39:59.740710 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:39:59.740710 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:39:59.746705 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 29076
[Sun Dec 17 00:40:01.201423 2017] [ssl:warn] [pid 29076:tid 592] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:01.414295 2017] [ssl:warn] [pid 29076:tid 592] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:01.455312 2017] [mpm_winnt:notice] [pid 29076:tid 592] AH00354: Child: Starting 150 worker threads.
[Sun Dec 17 00:40:17.006680 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:40:17.371667 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:17.403690 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:40:17.403690 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:40:17.403690 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:40:17.409694 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 24332
[Sun Dec 17 00:40:18.667139 2017] [ssl:warn] [pid 24332:tid 524] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:18.858441 2017] [ssl:warn] [pid 24332:tid 524] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:18.895469 2017] [mpm_winnt:notice] [pid 24332:tid 524] AH00354: Child: Starting 150 worker threads.
[Sun Dec 17 00:40:20.972550 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00428: Parent: child process 24332 exited with status 3221226356 -- Restarting.
[Sun Dec 17 00:40:21.481091 2017] [ssl:warn] [pid 17564:tid 532] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:21.513627 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00455: Apache/2.4.26 (Win32) OpenSSL/1.0.2l PHP/7.1.7 configured -- resuming normal operations
[Sun Dec 17 00:40:21.513627 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00456: Apache Lounge VC14 Server built: Jun 15 2017 12:39:41
[Sun Dec 17 00:40:21.513627 2017] [core:notice] [pid 17564:tid 532] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Sun Dec 17 00:40:21.519144 2017] [mpm_winnt:notice] [pid 17564:tid 532] AH00418: Parent: Created child process 27440
[Sun Dec 17 00:40:22.991094 2017] [ssl:warn] [pid 27440:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:23.266105 2017] [ssl:warn] [pid 27440:tid 552] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Sun Dec 17 00:40:23.301132 2017] [mpm_winnt:notice] [pid 27440:tid 552] AH00354: Child: Starting 150 worker threads.
When you say apache crash means that you have to start apache again,
or you just get an error? Which error do you get?
I Just get the usual application crashed window saying "Apache has stopped working", if i click "Close the application" it restarts by itself and the request that caused the crash simply fails with no status code or error message (which is expected since the connection with the server stopped). As you can see there's no specific error in the logs except for that status code
How you have setup apache and php mod_apache, php-fpm? Which apache
server limits do you have, how many php workers?
I'm not sure how to answer this question, i'm using stock apache and php from the XAMPP package with no edits to the configuration. I can tell you php is loaded as apache handler, so no CGI or FastCGI. Anyways on simple pages or using production mode in Symfony it works fine
NEWS:
I have discovered that since i was doing CORS requests it was creating a session file for each request, i fixed that and it slightly improved my issue, but it's still there
I have tried using redis as session handler for PHP but it actually made things worse
I have made a simple test where i called the same page (which uses session) 1000 times, it works fine as long as i put session_write_close(); at the end, otherwise it crashes
As stated in my last comment, I tried using FastCGI and it fixed the issue.
https://blog.tiger-workshop.com/fix-various-apache-crashes-on-windows/
On this page there are 2 suggestions for the error i was receiving AH00428: Parent: child process 29076 exited with status 3221226356 -- Restarting. One fix is to add the following lines to httpd.conf
<IfModule mpm_winnt_module>
ThreadStackSize 8388608
</IfModule>
But it didn't work. The second fix is related to a bug that happens in windows when using PHP as Apache Handler https://github.com/vlucas/phpdotenv/issues/76 so i switched to FastCGI as suggested.
These instructions are more specific to XAMPP than the ones posted in the link above. You need to edit the file xampp\apache\conf\extra\httpd-xampp.conf
Comment the following lines
#
# PHP-Module setup
#
#LoadFile "C:/xampp/php/php7ts.dll"
#LoadFile "C:/xampp/php/libpq.dll"
#LoadModule php7_module "C:/xampp/php/php7apache2_4.dll"
#
#<FilesMatch "\.php$">
# SetHandler application/x-httpd-php
#</FilesMatch>
#<FilesMatch "\.phps$">
# SetHandler application/x-httpd-php-source
#</FilesMatch>
[...] (This one is further down in the file)
#
#<IfModule php7_module>
# PHPINIDir "C:/xampp/php"
#</IfModule>
And add these lines
LoadModule fcgid_module modules/mod_fcgid.so
<IfModule fcgid_module>
FcgidMaxProcesses 300
FcgidMaxProcessesPerClass 300
FcgidOutputBufferSize 65536
FcgidConnectTimeout 10
FcgidProcessLifeTime 0
FcgidMaxRequestsPerProcess 0
FcgidMinProcessesPerClass 0
FcgidFixPathinfo 0
FcgidProcessLifeTime 0
FcgidZombieScanInterval 20
FcgidMaxRequestLen 536870912
FcgidIOTimeout 120
FcgidTimeScore 3
FcgidPassHeader Authorization
FcgidInitialEnv PHPRC "C:\\xampp\\php"
FcgidInitialEnv PATH "C:\\xampp\\php;C:\\Windows\\system32;C:\\Windows;C:\\Windows\\System32\\Wbem;"
FcgidInitialEnv SystemRoot "C:\\Windows"
FcgidInitialEnv SystemDrive "C:"
FcgidInitialEnv TEMP "C:\\xampp\\tmp"
FcgidInitialEnv TMP "C:\\xampp\\tmp"
FcgidInitialEnv windir "C:\\Windows"
DirectoryIndex index.html index.htm index.php
<Files ~ "\.php$">
Options Indexes FollowSymLinks ExecCGI
AddHandler fcgid-script .php
FcgidWrapper "C:/xampp/php/php-cgi.exe" .php
</Files>
</IfModule>

proxy_http:error [pid 12216:tid 1348] [client 135.215.11.191:63376] AH01114: HTTP: failed to make connection to backend: 127.0.0.1

I am working on ROR(Ruby on rails) project and that application is hosted on APACHE 2.4 server.
My Application is running fine without fail but some times it is getting down. And I have to restart server to make it up.
I checked the error.log file in APACHE and found below lines that can explorer more to you.
LOG
[Tue Jul 26 12:34:43.837275 2016] [wsgi:warn] [pid 12216:tid 668] mod_wsgi: Compiled for Python/2.7.9+.
[Tue Jul 26 12:34:43.837275 2016] [wsgi:warn] [pid 12216:tid 668] mod_wsgi: Runtime using Python/2.7.12.
[Tue Jul 26 12:34:43.880279 2016] [mpm_winnt:notice] [pid 12216:tid 668] AH00354: Child: Starting 64 worker threads.
[Tue Jul 26 12:46:57.009585 2016] [proxy:error] [pid 12216:tid 1348] (OS 10061)No connection could be made because the target machine actively refused it. : AH00957: HTTP: attempt to connect to 127.0.0.1:3020 (127.0.0.1) failed
[Tue Jul 26 12:46:57.009585 2016] [proxy:error] [pid 12216:tid 1348] AH00959: ap_proxy_connect_backend disabling worker for (127.0.0.1) for 60s
[Tue Jul 26 12:46:57.009585 2016] [proxy_http:error] [pid 12216:tid 1348] [client 135.215.11.191:63376] AH01114: HTTP: failed to make connection to backend: 127.0.0.1
Please suggest something that I don't need to restart my server frequently. And my application runs for long time.

Xampp Apache server not responding to request

I have installed Xampp server (xampp-win32-5.6.8-0-VC11-installer) on Windows 8 64 bit os. I have deployed the HelloWorld application folder in htdocs directory and added a virtual host in httpd-vhosts.conf file like below
<VirtualHost localhost:80>
DocumentRoot C:/xampp/htdocs/
RewriteEngine On
ProxyRequests Off
ServerName localhost
<Directory C:/xampp/htdocs/Aasifeweb/app/>
Require all granted
Allow from all
</Directory>
<Location />
ProxyPass http://localhost/Aasifeweb/app/#/home
ProxyPassReverse http://localhost/Aasifeweb/app/#/home
ProxyPassReverseCookiePath / http://localhost/Aasifeweb/app/#/home
</Location>
</VirtualHost>
Apache error Log file
[Fri Aug 07 19:23:26.149126 2015] [ssl:warn] [pid 2684:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 07 19:23:26.200160 2015] [core:warn] [pid 2684:tid 448] AH00098: pid file C:/xampp/apache/logs/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
[Fri Aug 07 19:23:26.268206 2015] [ssl:warn] [pid 2684:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 07 19:23:26.298225 2015] [mpm_winnt:notice] [pid 2684:tid 448] AH00455: Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8 configured -- resuming normal operations
[Fri Aug 07 19:23:26.298225 2015] [mpm_winnt:notice] [pid 2684:tid 448] AH00456: Apache Lounge VC11 Server built: Jan 28 2015 16:48:40
[Fri Aug 07 19:23:26.298225 2015] [core:notice] [pid 2684:tid 448] AH00094: Command line: 'c:\\xampp\\apache\\bin\\httpd.exe -d C:/xampp/apache'
[Fri Aug 07 19:23:26.301227 2015] [mpm_winnt:notice] [pid 2684:tid 448] AH00418: Parent: Created child process 3576
AH00548: NameVirtualHost has no effect and will be removed in the next release C:/xampp/apache/conf/extra/httpd-vhosts.conf:20
[Fri Aug 07 19:23:26.763535 2015] [ssl:warn] [pid 3576:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 07 19:23:26.885617 2015] [ssl:warn] [pid 3576:tid 448] AH01909: www.example.com:443:0 server certificate does NOT include an ID which matches the server name
[Fri Aug 07 19:23:26.918638 2015] [mpm_winnt:notice] [pid 3576:tid 448] AH00354: Child: Starting 150 worker threads.
[Fri Aug 07 19:23:29.637450 2015] [mpm_winnt:error] [pid 3576:tid 4852] AH00326: Server ran out of threads to serve requests. Consider raising the ThreadsPerChild setting
This problem occurs when i add virtual host configuration to the httpd-vhosts.conf file. When i remove the virtual host, the server seems to respond. The deployed application is written in angular-js framework
Important: The request seems to be appending the resource path again and again. But, I'm not sure why this happens?
GET /Aasifeweb/app/%23/homeAasifeweb/app/%23/homeAasifeweb/app/%23/homeAasifeweb/app/%23
When I hit http://localhost in browser, it keeps loading. There are lot of solutions in the internet, but nothing works for me.
Things I have tried to solve the problem
I have done netsh winsock reset
I have changed the port of the
apache server
I have disabled skype and antivirus
Please let me know your views
I didn't have to use ProxyPass at all. I just had to point the directory and Angularjs - ng-route takes care of page routing.
<VirtualHost localhost:80>
DocumentRoot C:/xampp/htdocs/Aasifeweb/app
</VirtualHost>

Apache as Proxy for Tomcat with Subdomain

Even though I found some similar reports on SO no suggestion solved my issue. So I decided to raise a question myself.
I am running Confluence (and Jira) as WARs on a Tomcat instance on Ubuntu. The application is accessible via http://localhost:8080/confluence. I would like to configure apache as a proxy to allow public access via http://confluence.<servername>.de. Following the instructions on https://confluence.atlassian.com/display/DOC/Using+Apache+with+mod_proxy#UsingApachewithmod_proxy-complex I did the following steps:
appended the attributes proxyName="confluence.<servername>.de" and proxyPort="80" to the Connector element in /var/lib/tomcat7/conf/server.xml.
Defined a virtual host in /etc/apache2/sites-enabled/confluence.conf
The confluence.conf has the following content:
<VirtualHost *:80>
ServerName confluence.<servername>.de
ProxyRequests Off
ProxyPreserveHost On
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
ProxyPass / http://localhost:8080/confluence
ProxyPassReverse / http://localhost:8080/confluence
ProxyHTMLURLMap / /confluence/
<Location />
Order allow,deny
Allow from all
</Location>
</VirtualHost>
With this configuration I cannot invoke http://localhost:8080/confluence due to this (wget) output:
--2014-12-23 08:38:13-- http://localhost:8080/confluence
Resolving localhost (localhost)... ::1, 127.0.0.1
Connecting to localhost (localhost)|::1|:8080... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:8080... connected.
HTTP request sent, awaiting response... 302 Found
Location: http://confluence.<servername>.de/confluence/ [following]
--2014-12-23 08:38:13-- http://confluence.<servername>.de/confluence/
Resolving confluence.<servername>.de (confluence.<servername>.de)... 92.51.163.197
Connecting to confluence.<servername>.de (confluence.<servername>.de)|92.51.163.197|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-12-23 08:38:13 ERROR 404: Not Found.
If I remove the attributes proxyName and proxyPort this access is possible. However, the invocation via http://confluence.<servername>.de still yields errors. The output of Apache log suggests that the URL rewrite is corrupt:
[Tue Dec 23 08:50:47.952647 2014] [authz_core:debug] [pid 24715:tid 140609413170944] mod_authz_core.c(828): [client 37.201.226.149:11808] AH01628: authorization result: granted (no directives)
[Tue Dec 23 08:50:47.952809 2014] [proxy:debug] [pid 24715:tid 140609413170944] mod_proxy.c(1104): [client 37.201.226.149:11808] AH01143: Running scheme http handler (attempt 0)
[Tue Dec 23 08:50:47.952838 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2020): AH00942: HTTP: has acquired connection for (localhost)
[Tue Dec 23 08:50:47.952851 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2072): [client 37.201.226.149:11808] AH00944: connecting http://localhost:8080/confluence to localhost:8080
[Tue Dec 23 08:50:47.953069 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2206): [client 37.201.226.149:11808] AH00947: connected /confluence to localhost:8080
[Tue Dec 23 08:50:47.953176 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2483): (111)Connection refused: AH00957: HTTP: attempt to connect to [::1]:8080 (localhost) failed
[Tue Dec 23 08:50:47.953277 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2610): AH00962: HTTP: connection complete to [::1]:8080 (localhost)
[Tue Dec 23 08:50:47.956860 2014] [proxy:debug] [pid 24715:tid 140609413170944] proxy_util.c(2035): AH00943: http: has released connection for (localhost)
[Tue Dec 23 08:50:47.988123 2014] [authz_core:debug] [pid 24715:tid 140609402681088] mod_authz_core.c(828): [client 37.201.226.149:11808] AH01628: authorization result: granted (no directives)
[Tue Dec 23 08:50:47.988231 2014] [proxy:debug] [pid 24715:tid 140609402681088] mod_proxy.c(1104): [client 37.201.226.149:11808] AH01143: Running scheme http handler (attempt 0)
[Tue Dec 23 08:50:47.988250 2014] [proxy:debug] [pid 24715:tid 140609402681088] proxy_util.c(2020): AH00942: HTTP: has acquired connection for (localhost)
[Tue Dec 23 08:50:47.988264 2014] [proxy:debug] [pid 24715:tid 140609402681088] proxy_util.c(2072): [client 37.201.226.149:11808] AH00944: connecting http://localhost:8080/confluenceconfluence/ to localhost:8080
[Tue Dec 23 08:50:47.988277 2014] [proxy:debug] [pid 24715:tid 140609402681088] proxy_util.c(2206): [client 37.201.226.149:11808] AH00947: connected /confluenceconfluence/ to localhost:8080
[Tue Dec 23 08:50:47.990134 2014] [proxy:debug] [pid 24715:tid 140609402681088] proxy_util.c(2035): AH00943: http: has released connection for (localhost)
Am I missing anything? By the way, if I adjust the virtual host configuration in a way that the URL http://<servername>.de/confluence is used as a proxy everything works fine.
Any suggestion would be greatly appreciated.
My personal preference is to deploy applications in subfolders and set up proxy like:
ProxyPass "/confluence/" "http://localhost:8080/confluence/"
ProxyPassReverse "/confluence/" "http://localhost:8080/confluence/"
No need for ProxyHTMLURLMap, that's probably why you see "AH00944: connecting http://localhost:8080/confluenceconfluence/ to localhost:8080"
Setting up like you intended might be a little tricky, since you need the fully qualified domain name of your machine to be confluence.servername.de and you need an A record in your local DNS for this as well. I second Slash's question: can you ping confluence.servername.de?
When this is taken care of, you may also want to look into using these directives, as needed:
ProxyRequests Off
ProxyVia Off
RemoteIPHeader X-Forwarded-For
RequestHeader unset Accept-Encoding
ProxyHTMLEnable On
ProxyHTMLExtended On
<Proxy *>
Require all granted
</Proxy>