How to connect separate memcache server on Ubuntu and Use from other server?
<p>I have LAMP based PHP &amp; MySql web application hosted on digitalocean separate servers in Singapore region. One PHP server + one remote MySql DB server, both are working fine. Because the app has to read more than the write, I wanted to add one memcache server. </p>

<p>What I've tried so far: - Use these steps from this <a href="https://www.digitalocean.com/community/tutorials/how-to-install-and-use-memcache-on-ubuntu-14-04" rel="nofollow"> tutorial</a>
on a 2gb droplet.</p>

<p>Now I have a one memcache server with public <code>ip:129.x.x.x</code> and private <code>ip:10.x.x.x</code>,</p>

<p>1-p 11211</p>

<p>2.-m 2048</p>

<p>3.-c 1024</p>

<p>4.-l 127.0.0.1</p>

<p>memcached server successfully installed and cached the test data on localhost. But I want to use this on other remote web server,  </p>

<p>So I have changed in <code>memcached.conf</code> file  <code>-l 127.0.0.1</code> to THIS memcached server private IP  <code>-l 10.x.x.x</code>.</p>

<p>Now when I check on memcached server and type <code>ps aux | grep memcached</code> it shows: </p>

<pre><code>tcp        0      0 10.x.x.x:11211      *:*     LISTEN     3742/memcached
</code></pre>

<p>When I check stats <code>echo "stats settings" | nc 10.x.x.x 11211</code> it shows that all things about memcached server and it is running.</p>

<p>For testing purposes I made a file <code>test.php</code> and save on PHP server and try to connect.</p>

<pre><code>&lt;?php
  $mc = new Memcached();
  $mc-&gt;addServer("**10.x.x.x**", 11211);
  $result = $mc-&gt;get("test_key");
  if($result) {
    echo $result;
  } else {
    echo "No data on Cache. Please refresh.";
    $mc-&gt;set("test_key", "test data from Cache!") or die ("Failed to save data at Memcached server");
  }
?&gt;
</code></pre>

<p>But it is always showing an <code>HTTP ERROR 500</code> error page, a"page isn’t working error on PHP server, <code>192.x.x.x is currently unable to handle this request</code> but my other PHP and MySql app running on same server. </p>

<p>The same code is running and caching data successfully on memcached server but not working in remote PHP server. </p>

<p>When I try <code>telnet 10.x.x.x 11211</code> it is connecting successfully, <code>sudo iptables -L</code> outputs that INPUT policy ACCEPT anywhere. </p>

<p>I've tried a lot of googling but it is not helping me with anything.</p>