Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
litespeed_wiki:lsmcd:sasl [2018/07/23 20:09] Robert Perper [Configure for Python] |
litespeed_wiki:lsmcd:sasl [2019/02/25 13:32] Robert Perper [Configure for PHP] |
||
---|---|---|---|
Line 4: | Line 4: | ||
Enabling SASL is database wide. Once SASL is enabled, all non-SASL databases will need to be regenerated. You will also need to regenerate your databases (the files stored in the ''Cached.ShmDir'' parameter of your node.conf file) if you wish to remove SASL. | Enabling SASL is database wide. Once SASL is enabled, all non-SASL databases will need to be regenerated. You will also need to regenerate your databases (the files stored in the ''Cached.ShmDir'' parameter of your node.conf file) if you wish to remove SASL. | ||
+ | |||
+ | You can secure data by user if you enable SASL. This is particularly helpful if you wish to install a single copy of memcached and then share it across your user secured network. See https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:lsmcd:sasl_secure_user_data for full details. | ||
===== Configuring SASL ===== | ===== Configuring SASL ===== | ||
Line 17: | Line 19: | ||
In particular you need to specify in your node.conf file: <code>CACHED.USESASL=TRUE</code> | In particular you need to specify in your node.conf file: <code>CACHED.USESASL=TRUE</code> | ||
+ | |||
+ | Once you have changed this value, you must delete your existing LSMCD files: <code>rm -rf /dev/shm/lsmcd</code> | ||
==== Create and Configure a SASL Configuration File ==== | ==== Create and Configure a SASL Configuration File ==== | ||
Line 49: | Line 53: | ||
<?php | <?php | ||
$mem_var = new Memcached(); | $mem_var = new Memcached(); | ||
- | $mem_var->setSaslAuthData('user', 'password'); | ||
$mem_var->setOption(Memcached::OPT_BINARY_PROTOCOL, true); | $mem_var->setOption(Memcached::OPT_BINARY_PROTOCOL, true); | ||
$mem_var->setOption(Memcached::OPT_COMPRESSION, false); | $mem_var->setOption(Memcached::OPT_COMPRESSION, false); | ||
$mem_var->addServer("127.0.0.1", 11211); | $mem_var->addServer("127.0.0.1", 11211); | ||
+ | $mem_var->setSaslAuthData('user', 'password'); | ||
$response = $mem_var->get("SampleKey"); | $response = $mem_var->get("SampleKey"); | ||
if ($response) { | if ($response) { |