Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


How to configure LEB + lowendscript nginx so 2 diff sites on same server can communicate?
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

How to configure LEB + lowendscript nginx so 2 diff sites on same server can communicate?

d60ebad60eba Member
edited August 2011 in General

Hi,

I have a LEB configured using the lowendscript. Doing this doesn't work:

vi get.php
<?
echo file_get_contents("hxxp://IP_OF_SERVER");
?>

(change xx to tt) then put into browser http://IP_OF_SERVER/get.php

After much head scratching, I thought what was happening here is worker 1 is sending out the request for data. But seeing as the worker limit is 1, there's no worker available to send the data back. So it hangs. So I can't get two different sites on the same server to communicate (via XMLRPC).

So, I changed the nginx.conf to

worker_processes  2;

(otherwise it's identical to the default lowendscript provides), and restarted everything, and I can see 3 nginx and 2 php-cgi in the top command .. but it still hangs with "upstream timed out (110: Connection timed out)" in the error log.

Have any of you LEBers managed to get 2 sites on the same server XMLRPCing to each other? If so, what's your config?

Thanks!

Comments

  • change the fcgi children to 2 in the php init script.

    Thanked by 1d60eba
  • d60ebad60eba Member
    edited August 2011

    Nice one, worked well.

    I did:

    vi /etc/init.d/php-cgi

    and added

    PHP_FCGI_CHILDREN=2

    to the top.

    Many thanks!

  • It's time we delete /etc/init.d/php-cgi (or /etc/init.d/php-fastcgi) and sudo apt-get install php5-fpm to manage our PHP processes.

    Thanked by 2Mon5t3r tux
  • I have the same issue a while ago, basically its when one request calls another request, but its set todo 1 request at a time, so that new request has to wait for its own request to finish, which can't finish because its waiting todo that new request, so you just time out.

    Just switch to PHP-FPM (which does it dynamically) ir change your children to more then 1 in PHP-CGI and NGINX.

  • nginx does not need 2 worker processes, it can handle multiple requests at the same time from 1 process.

  • Xeoncross said: It's time we delete /etc/init.d/php-cgi (or /etc/init.d/php-fastcgi) and sudo apt-get install php5-fpm to manage our PHP processes.

    agree.. more less headache. :D

Sign In or Register to comment.