WHM/Apache + jQuery Ajax Server Configuration

Asked

Viewed 255 times

3

Recently I started having the following problem in my server domains with WHM:

When executing an asynchronous AJAX call in the background, I cannot proceed, that is, I cannot access anything else in the same domain by the same terminal that executed the call while the process does not complete.

This passes the impression of slowness in the system, when in fact it is only the problem of the domain being "blocked" while there is a process in the background (even if you open another tab of the browser)

If you access from another terminal - even if you are on the same network - you access normally.

This is something that happens in local tests (using PHP Built in) because Builtin does not allow more than one simultaneous connection.

But this should not occur on the server.

As before it was not like this, I believe this is due to some change in the server settings.

But since I have no idea what it might be, I can’t locate anything in the settings that might cause this behavior.

Obs: The system is built in PHP 7. The server uses apache 2.4 + Cloudlinux to prevent resource abuse by a single domain

  • Have you contacted your server support? Does this happen anywhere on the system? Took a look at the browser’s Web Console to see if it shows any errors?

  • @Wendelrodrigues the answer is the same for the 3 questions: Yes. In the case of the second question, it happened throughout the system, but it is only felt when the process is slower.

  • But then, the support said nothing? Saw different on the console? It has to post something to see?

  • Maybe this link can help you: https://answall.com/questions/56304/servor-apache-php-n%C3%A3o-responde-enquanto-est%C3%A1-fazendo-uma-requisi%C3%A7%C3%A3o-Soap. It seems to be a problem similar to the one you described, so when you access from another terminal it works, because the lock is in your session.

  • I thought about it too, but the files q use session already close with session_write_close(), and q most do not use session

  • Dude, the server must be blocking the requests then. Have you checked with them? Does your server have Stats? See which pages have the most access and whether they are the ones that cause the problems.

  • Requests are not being blocked. They execute. Only one at a time.

  • 1

    @Wendelrodrigues thank you so much for your attention and help so far. I found out which server change was crashing: CORS. Fixed and working. As soon as I have time, I will post the reply in detail. Regardless of this, could you please detail in response what you put about the session_write_close()? Although that wasn’t the case in this case, but then I’ll give you the reward for your help

  • Um, interesting. I’ll read about it. Put yes later. ;) Vlws

Show 4 more comments

2 answers

2


Problem solved

A while ago, I had a similar problem, reported here: Running processes in the background - Accessing same script twice

However, this time the reason was another: the last update of our server with WHM modified a directive that prevented Cross-Domain. And as many of our processes use CORS, there was a blockage.

To fix, instead of changing the server to work, we used the tip on this other link: Ajax cross-Omain request with pure Javascript (no Apis)

I hope the tips in these 2 links can be helpful to others who go through similar problems.

Thanks in particular to @Wendelrodrigues for their help!

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.