The Issue:
I've recently been working enabling HTTP/2 for a large PHP+JS application (generally a Backbone-based SPA served by a PHP back-end). While most resources load fine, two requests are getting stuck in the "Stalled" state for exactly 5 minutes before resolving and downloading as normal.
The two request in question are a simple XMLHttpRequest to our back-end and a request for a Font Awesome font file. Other font files and back-end requests are loaded just fine, but these two will consistently hang up when HTTP/2 is enabled.
Debugging Information:
Here are the headers associated with the font file request listed in Chrome's dev tools:
...and here's the output from chrome://net-internals, with the hangup occurring at HTTP_TRANSACTION_READ_HEADERS (see the dt of almost 30000ms):
Further Details:
This application is served using a build of apache2 that includes the mod_http2 module rather than the standard version of apache2 that is packaged with Ubuntu. The same behavior is reported in the latest versions of Firefox, Chrome, and Chrome beta on Ubuntu 16.04.
For the sake of local development, all SSL is being run through a self-signed OpenSSL certificate, generated with OpenSSL version 1.0.2j.
It should also be noted that all other successful requests are running through Backbone-related methods, which delegate to jQuery's $.ajax, where the failed XMLHttpRequest is using the native JS XMLHttpRequest Object.
Thanks for your help.
What version of Apache and mod_http2 are you using?
There's been a load of fixes for this sort of thing and Apache 2.4.25 is about to be released including those fixes, so suggest you upgrade to that when it comes out in next day or two and try again.
Alternatively, if you don't want to wait, you can try updating mod_http2 independently by doing the following (assuming Apache is installed in /usr/local/apache2/ but adjust that as appropriate):
#Download and install mod_http2 outside of a regular Apache release
#Latest version is here: https://github.com/icing/mod_h2/releases/
wget https://github.com/icing/mod_h2/releases/download/v1.8.3/mod_http2-1.8.3.tar.gz
tar -zxvf mod_http2-1.8.3.tar.gz
cd mod_http2-1.8.3
./configure --with-apxs=/usr/local/apache2/bin/apxs
make
sudo make install
Then restart Apache and confirm from error log that you are running mod_http2-1.8.3.
If that doesn't work then raise an issue here: https://github.com/icing/mod_h2/ as the mod_http2 developer (#icing) is very responsive to issues. Assuming this is an Apache bug of course.
Related
First of all, my thanks to this community for helping me solve many, many issues over the years. In fact, I have never needed to post a new question - I was always able to find an answer (eventually).
Not so this time. I am a moderately experienced hobby developer, self-hosting a small set of sites on my Mac Mini (Apache 2.4, PHP 8.0, MySQL 5.6). I built a reasonably complex site (www.fundas.us/manhattanzen) and everything was working perfectly.
I then decided to add SSL encryption to my server (certificate purchased from ssl.com) and installed it with no issues. Checking the SSL configuration via "SSL Checker" and Whynopadlock.com confirms that the certificate is properly installed. The only "warning" I get is that I only have TLSv1 enabled on the server. This despite the fact that my httpd-ssl.conf file says "SSLProtocol -all SSLv3". I mention this in case it is the cause of my troubles.
The issue I am experiencing is that the SSL encrypted site works perfectly using Firefox and Chrome on the Mac Mini (Mojave), but fails using Safari on the same Mac and fails using any of the browsers on my iPad or iPhone. Safari's web console shows "Failed to load resource: The network connection was lost." and the server log shows "child pid XXXXX exit signal Segmentation fault (11)".
The resources that fail to load are some (but not all) of the css and js resources that reside on the local (Mac Mini) server. All other resources (residing on external servers) load fine.
I have tried a number of suggestions found on Stack Overflow, including
changing file permissions to 777 on the offending resources (js, css files)
setting KeepAlive to Off in httpd-default.conf
minifying offending resource files
increasing SSLSessionCache in httpd-ssl.conf
None of it has made any difference. I should also point out that I have configured .htaccess in the root folder of my site to force all incoming connections to https://
This seems like the last hurdle to make this website fully encrypted and fully functional and I am thoroughly stuck. I will appreciate any pointers you have for me. Many thanks.
Was able to figure this out and wanted to answer my own question, in case it helps anybody else.
First, the strange test results from SSL validation sites that my server was not TLSv1.2 ready. I fixed this by changing the SSLProtocol line in httpd-ssl.conf to explicitly only permit TLSv1.2 ("SSLProtocol all -SSLv3" --> "SSLProtocol TLSv1.2")
Second, the odd behavior of Safari (on both desktop and mobile) occasionally hanging unable to load a page (while other browsers had no issues). I found the solution to this at https://serverfault.com/questions/937253/https-doesnt-work-with-safari. Making the recommended change to httpd-ssl.conf and adding the line "Header unset Upgrade" solved the Safari issue.
ColdFusion 2016 stopped rendering website files in browser after I updated my Mac software to latest one, Mojave 10.14.1. Instead of seeing the rendered page in the browser I can see my repository files only.
I noticed that some previous settings regarding local server and Apache were removed after update. I did restore missing settings back how they were before and even reinstalled ColdFusion 2016, but still have that problem with rendering websites on the ColdFusion platform.
After running /Applications/ColdFusion2016/cfusion/runtime/bin and sudo ./wsconfig, I the get Web Server Configuration Window with content inside
[ localhost ] Apache : /private/etc/apache2.
Is there anyone who can help to resolve this issue please?
Change the directory to
/Application/ColdFusion2016/cfusion/runtime/bin
Run
sudo ./wsconfig
The documentation does not mention sudo, but I am suggesting it to be safe.
Source: https://helpx.adobe.com/coldfusion/configuring-administering/web-server-management.html
After testing ColdFusion 2016 platform using port :8500 I found out that CF server uses Tomcat path (wrong path) instead of Apache one (for Mac virtual directory file: httpd-vhost.conf) and both of them are running at the same time.
I have just successfully deployed Quercus on Glassfish 4.1. I tested in the browser
http://localhost:8080/quercus-4.0.39/ and saw this:
Congratulations! Quercus™ Open Source 4.0.39 is interpreting PHP
pages. Have fun!
Then ran Netbeans Tools > Options > PHP > Activate PHP Support
It worked. I now see this:
So I made 3 tests:
I ran a php page in an html application but instead of displaying the page it prompts a download box to open in Notepad
I created a new PHP project with below configuration:
But when I run the app with above configuration I receive this error:
Firefox can't establish a connection to the server at localhost.
So I tried with a third test with other configuration:
When I run this third test I get a HTTP Status 404 - Not Found error on GlassFish server.
What am I doing wrong? Thank you!
The problems with your tests are:
PHP needs to be interpreted by a web server. Your browser doesn't know what to do with a PHP file, so it just treats it like a file rather than a page to render. Apache is the most common and easiest server to do that with, GlassFish is unnecessary and probably not the best choice for PHP.
In this test, you are trying to visit a web server which doesn't exist. You don't have any server that listens on port 80.
Here, GlassFish is reporting that it can't find the resource you requested. Have you made sure to put your PHP project in the right directory for Quercus (like in step 4 of your documentation link) and made sure you're visiting a valid URL?
I think the best thing for you to do is move away from Quercus. The latest version of it is very old and implements an old version of PHP (version 5, whereas the latest is 5.6). Looking at the official website, the project appears to be dead, with broken links and very old documentation.
I would suggest you investigate installing a WAMP (Windows, Apache, MySQL, PHP) or LAMP (Linux, Apache, MySQL, PHP) stack. There are lots of very easy installers for this approach which will help you get up to speed and a lot of helpful tutorials and documentation.
For those who using tomcat, below are the steps :-
Right click your project --> properties --> Run Configuration --> For Run As, select PHP Built-in Web Server
Go to Tools --> Options --> PHP tab --> in Php 5 interpreter, browse the correct location for php
Then it should works !
In my case , my php is in /usr/bin/php7.0, so I put the path in Php 5 interpreter.
I'm setting up Apache on Centos the way I have done in the past, but for some reason mod_spdy is not running. I'm following the instructions here:
https://developers.google.com/speed/spdy/mod_spdy/
When I run rpm -U mod-spdy-beta_current_x86_64.rpm I get this message:
warning: mod-spdy-beta_current_x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 7fac5991: NOKEY
package mod-spdy-beta-0.9.4.3-420.x86_64 is already installed
If I open chrome://net-internals/#spdy and my site in another tab, it doesn't show my site. If I look in the network panel, I don't see the x-mod-spdy header.
Update: If I use Firefox firebug, I see the x-mod-spdy header. I don't see my site in Chrome spdy sessions, but I see other sites in it.
What could I be doing wrong?
Ok it seems the issue is that Chrome 40.x dropped support for SPDY/3 and only supports SPDY/3.1, but the mod_spdy module for Apache only supports SPDY/3, so basically no SPDY for Chrome users if you use Apache as a web server.
mod_spdy is currently in a bad state where either Google nor Apache is maintaining it after Google donated it to the Asf. Google recently made the statement that they will drop the SPDY support from Chrome in early 2016, but what they forgot to say that they started dropping older versions of SPDY already (including SPDY/3) (I like these partially true statements by the way), so basically if you are on Apache then for your Chrome users you can't provide SPDY short of implementing SPDY/3.1 yourself.
So, how was that "do no evil"? :-)
See details: https://groups.google.com/forum/#!topic/mod-spdy-discuss/FPEj0zG5I0Y
and https://code.google.com/p/mod-spdy/issues/detail?id=100&colspec=ID%20Type%20Status%20Priority%20Owner%20Summary%20Stars
One option you might consider is switching to Nginx and using SPDY/3.1 over there.
Mono 3.2 MVC4 WebAPI application is running in Debian x64 VPS server. Mono is compiled from source and 4.5 subtree is used.
Application requires Chrome or Safari browser.
After refreshing browser window several times server does not work properly. I tried all known free possibilites:
Apache + mod_mono
After pressing browser refresh button several times server randomly returns 500 error for some pages
and apache error log contains "failed to map path" exception.
I posted it in
https://stackoverflow.com/questions/20356779/how-to-fix-failed-to-map-path-errors-in-mono-mvc4-application
and in
Mono ASP.NET mailing list without any response.
There are number of mono applications in server, maybe mod_mono selects wrong thread or is there some bug in webapi mapping implementation in mono.
Nginx + mono-fastcgi-server4.exe
Holding down F5 key causes 200% CPU usage forever in mono-fastcgi-server4.exe
I posted it in
https://stackoverflow.com/questions/20512978/how-to-limit-mono-197-cpu-usage-in-mono-fastcgi-server
and in
Mono ASP.NET mailing list without any solution.
Is looks like there is bug in mono fastcgi server or it is not compatible with mono 3.2
Using xsp4.exe directly
It causes "server does not return data" in Chrome if browser window is refreshed several times.
I posted this in
https://code.google.com/p/chromium/issues/detail?id=329311
without response.
Maybe xsp4 does not implement http protocol properly.
Havent tried ServiceStack since it cannot used for closed source development which is required. Also application uses also images, css, js files and MVC views which needs also served.
How to create proper server for mono which returns correct data ?
When 500 errors happen, somewhere in the mono class libraries an exception was thrown, you can find out more by using tracing:
mono --trace=E:System.Exception YourApp.exe
This way it's very possible that you find out what is causing the load problems you're seeing in each case (to do this for mono-fastcgi, you would need to add the trace argument in the script that calls mono-fastcgi-server4.exe).