Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The basic structure of Mencached

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/03 Report--

Overview of Mencached basic deployment Mamcached

Memcached is a distributed cache system that runs in memory. Memcached lacks authentication and security control, which means that the memcached server should be placed behind the firewall.

Experimental preparation

Experimental procedure

Memcached server

1. Install the environment package

[root@localhost libevent-2.1.8-stable] # yum install gcc gcc-c++ make-y

2. Install the Libevent software ontology

Mount the software package and unpack the [root@localhost memcached] # tar zxf libevent-2.1.8-stable.tar.gz-C / opt/ [root@localhost memcached] # cd / opt/libevent-2.1.8-stable/// configuration and compile and install [root@localhost libevent-2.1.8-stable] # / configure\-- prefix=/usr/local/libevent [root@localhost libevent-2.1.8-stable] # make & & make install in the mount directory.

3. Configure and install Memcached

[root@localhost memcached] # tar zxf memcached-1.5.6.tar.gz-C / opt/ [root@localhost memcached] # cd / opt/memcached-1.5.6/ [root@localhost memcached-1.5.6] #. / configure\-- prefix=/usr/local/memached\-- with-libevent=/usr/local/libevent/ [root@localhost memcached-1.5.6] # make & & make install// establish a soft link [root@localhost memcached-1.5.6 ] # ln-s / usr/local/memached/bin/* / usr/local/bin/ launch service [root@localhost memcached-1.5.6] # memcached- d-m 32m-p 11211-u root// "- d": run as daemon (running in the background) / / "- m": specify the maximum amount of memory used / / "- p": specify port / / "- u": specify user [root@localhost memcached- 1.5.6] # netstat-atnp | grep 11211tcp 0 0 0.0.0 grep 11211tcp 11211 0.0.0 LISTEN 12591/memcached tcp6 0: 11211:: * LISTEN 12591/memcached # disable firewall and security features [root@localhost memcached-1.5 . 6] # systemctl stop firewalld.service [root@localhost memcached-1.5.6] # setenforce 0

4. Install Telent to connect to Memcached

[root@localhost memcached-1.5.6] # yum install telnet-yamp / connect memcached [root@localhost memcached-1.5.6] # telnet 192.168.142.66 11211Trying 192.168.142.66...Connected to 192.168.142.66.Escape character is'^]'. Client

Install the LAMP schema

For more information, please see the Discuz Forum (practical section) of my blog LAMP architecture, https://blog.51cto.com/14449528/2447886.

The building part of the forum can not be done.

1. Lifting rights in the database

[root@localhost ~] # mysql-uroot-pmysql > create database sky;mysql > grant all on sky.* to 'skyuser'@'%' identified by' 123123 destroy MySQL > flush privileges

2. Test whether the PHP tool can connect to the database

[root@localhost htdocs] # vim / usr/local/httpd/htdocs/index.php

3. Install and configure memcache client

[root@localhost memcached] # tar zxf memcache-2.2.7.tgz-C / opt/ [root@localhost memcached] # cd / opt/memcache-2.2.7/ [root@localhost memcache-2.2.7] # / usr/local/php5/bin/phpize / / generate a startup script for memcache [root@localhost memcache-2.2.7] # / configure\-- enable-memcache\-- with-php-config=/usr/local/php5/bin/php-config / / compile & install [root@localhost memcache-2.2.7] # make & & make install modify the PHP configuration file [root@localhost memcache-2.2.7] # vim / usr/local/php5/php.ini//736 line and add extension_dir = "/ usr/local/php5/lib/php/extensions/no-debug-zts-20131226/" extension = memcache.so

4. Set up a test page

[root@localhost memcache-2.2.7] # vim / usr/local/httpd/htdocs/index.php

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report